Hacker News new | ask | show | jobs
by ComputerGuru 4788 days ago
Can anyone recommend an equally good opposite (HTML to PDF)?

wkhtmltopdf [0] is probably the most popular, but it's also ridiculously buggy.

0: https://code.google.com/p/wkhtmltopdf/

6 comments

http://phantomjs.org/ is the best so far in my experience since it handles all the client side javascript properly.

The PDF's it outputs are full vector not just rasters, it the same engine used in Chrome to view PDF's and print web pages from my understanding.

We've tried everything, including PrinceXML, and PhantomJS has been the best for us so far.
Not open source, but you might want to check out PrinceXML. It is really good.
Print the HTML document to a postscript printer, but have it print to file.

Then use ps2pdf from ghostscript.

You can automate this with a small amount of work.

Flying Saucer worked great for me: http://code.google.com/p/flying-saucer/
I've had good results with htmldoc (http://www.msweet.org/projects.php?Z1).
In OS X, you can print to PDF from every application.