Wkhtmltopdf is a very flexible open source HTML to PDF converter. It's a command line tool, but don't let that put you off - it's still very easy to use.

Saving a remote web page to PDF, for instance, is as simple as entering:

wkhtmltopdf http://www.google.com google.pdf

The results looked good and had working links, most of the time (they can link to local files or remote URLs, and occasionally the program got it wrong).

You can probably already guess how to convert a local file:

wkhtmltopdf c:\folder\MyFile.html MyFile.pdf

Point the program at multiple HTML documents and it'll combine them into a book with a cover and a table of contents:

wkhtmltopdf cover cover.html toc chapter1.html chapter2.html chapter3.html book.pdf

If you need more flexibility then there are plenty of more advanced switches available. You're able to set the PDF's page size, orientation, dpi, margins, headers, footers, and much, much more.

And although PDF will be the output format of choice for most people, wkhtmltopdf can also save Postscript files. Just specify .ps as the extension of your export file:

wkhtmltopdf http://www.microsoft.com microsoft.ps


Wkhtmltopdf is a powerful tool which generally does a good job of rendering HTML files into PDF. It's relatively easy to use (by command line standards), but also has plenty of advanced options if you need them.