4 ms·
You can generate pdfs with headless Chromium/Chrome pretty easily. chromium-browser --headless --disable-gpu --print-to-pdf=output_file_name.pdf file:///pa
by randlet 9y ago
You can generate pdfs with headless Chromium/Chrome pretty easily.
chromium-browser --headless --disable-gpu --print-to-pdf=output_file_name.pdf file:///path/to/your/html
- bluehatbrit 9y agoSadly you get 0 control over headers and footers of the output PDF, meaning you get lovely crappy page numbers around the place with no way to turn them off. This is why, sadly, I have to keep my command line markdown -> pdf converter (https://www.npmjs.com/package/mdpdf https://www.npmjs.com/package/mdpdf) using Phantomjs. So this does work for very basic pdf printouts, but so far phantom is the only tool that offers full control over the PDF output. Even down to things like margins, paper size, etc.