Re:PhantomJS: Archiving the project, suspending development
by chirag64 on Sunday March 04, 2018 @11:08AM
(#16515164)
Shoot, I was just planning to use this for generating PDFs out of a URL on nodejs. Does anyone know of any other library / module out there that is good at this?
[ Parent
| on HN ]
Re:PhantomJS: Archiving the project, suspending development
by randlet on Sunday March 04, 2018 @12:01PM
(#16515378)
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
Re:PhantomJS: Archiving the project, suspending development
by bluehatbrit on Sunday March 04, 2018 @01:30PM
(#16515808)
Sadly 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) 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.
Re:PhantomJS: Archiving the project, suspending development
by runarberg on Sunday March 04, 2018 @11:27AM
(#16515248)
I think you can just use headless firefox[1] or headless chrome[2].
[1]: https://developer.mozilla.org/en-US/Firefox/Headless_mode
[2]: https://developers.google.com/web/updates/2017/04/headless-c...