Hacker News new | ask | show | jobs
by krn 2802 days ago
A basic command line alternative using Headless Chrome[1]:

  chrome --headless --disable-gpu --print-to-pdf https://www.chromestatus.com/
[1] https://developers.google.com/web/updates/2017/04/headless-c...
1 comments

Similar functionality is packaged in wkhtmltopdf, which essentially runs Webkit headless to print to PDF.

https://wkhtmltopdf.org/

The article talks about wkhtmltopdf; in fact, they developed their server in response to its limitations:

The wkhtmltopdf utility has been around awhile and works great when you get it working correctly on your platform. However, the newest version as of this writing 0.12.5 has a bug prevening TOC generation on some platforms. Some Linux platforms require the installation of Microsoft font packs, and compiling from source leads you down a rabbit hole of dependency hell.

txPDF is a simple containerized web services wrapper around wkhtmltopdf, intended to be used as a Microservice component in a larger system.
wkhtmltopdf maintainer here. That's really cool!

Did you manage to find a workaround for https://github.com/wkhtmltopdf/packaging/issues/2? If so, would appreciate a PR :-)

Thanks, I'll check out that issue and see if there is anything I can contribute. wkhtmltopdf is a great utility and we rely on it heavily.