How to convert html to pdf

Some days ago I had some Webpages to convert to pdf. Every webpage just contained a small table with competition results, but I didn’t want to do on every page the same: Print -> print as file -> choose pdf. So I downloaded all necessary webpages with the Firefox Plugin DownThemAll. After using google for a while, I found the command-line tool wkhtmltopdf

Installation

It is quite easy to install, because it is in the ubuntu pool:

sudo apt-get install wkhtmltopdf

How to use?

wkhtmltopdf has a pretty simple syntax. Just call:

wkhtmltopdf http://URL/to/file.html outputFile.pdf

or if you just have a html file on your computer:

wkhtmltopdf /path/to/file outputFile.pdf

A more detailed description about wkhtmltopdf can be found here

comments powered by Disqus