Every developer knows the problem with trying to make a site look and work the same in different browsers. Using a tool with it’s own rendering engine is like trying to make your site work in yet another browser.
The tool I like the best is wkhtmltopdf. It’s a OpenSource tool which uses the Webkit rendering engine. It’s a basic shell tool which works on Windows/Mac/Linux. This tools uses Webkit to render the page, then turns that into a PDF. Webkit is what Apple’s Safari browser uses and originally came from KDE’s Konqueror.
wkhtmltopdf has a lot of cool features like:
- Custom and default PDF header/footer
- username/password/proxy info for protected content
- Book and TOC ability. So you can show all the pages on the left of your reader and get a auto-generated TOC at the start of the document.
- Works on Windows/Mac/Linux, was cake to install and use
wkhtmltopdf http://website/page.html /path/to/page.pdf
That command would go to http://website/page.html using the Webkit rending engine and turn that into a PDF that went to /path/to/page.pdf. Very simple.
I would love to find a tool like wkhtmltopdf that used either the Firefox/Gekco or IE rendering engine, but couldn’t find anything that worked as well as wkhtmltopdf. It would be even better if there was a tool that would allow you to choose between the various rending engines. But I’ll take what I can get, and for right now wkhtmltopdf is the best OpenSource option available.