Gist 86238060ab8a159395cd
✓ Published0🌍 Public
Aandyreagan
Last edited Feb 3, 2016
Created on Feb 3, 2016
This example demonstrates a server-side workflow for converting an HTML file into a PDF document. It reads an input HTML file from the filesystem, passes its contents to the `electron-html-to` library, and pipes the resulting PDF stream to an output file. The script uses the `convertFactory` with its PDF converter path, triggering the conversion asynchronously and handling errors or writing the output stream. The code relies on Node.js core modules `fs` for file operations and `process.argv` for command-line arguments, making it a reusable utility for generating PDFs from static HTML pages.
AI-generated description