Wkhtmltopdf is an interesting and excellent tool which uses the updated QT 4.4 WebKit engine to produce high quality of PDF-documents. This tool is also very useful for the Linux users who does not have X-windows install and want to convert any online tutorials/helps/html pages or even websites as snap-shots.
Installing Wkhtmltopdf
Unfortunately no rpm builded so far it seems but you can just download the pre-compiled binary tar from the download url (http://code.google.com/p/wkhtmltopdf/). Ssh your server as root(select the exact source matched your hardware arch).
- # cd /usr/src
# wget http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.10.0_rc2-static-i386.tar.bz2
# bunzip2 wkhtmltopdf-0.10.0_rc2-static-i386.tar.bz2
# tar xvf wkhtmltopdf-0.10.0_rc2-static-i386.tar
# cp -p wkhtmltopdf-i386 /usr/bin/wkhtmltopdf
# wkhtmltopdf -h (to list the help menu)
Wkhtmltopdf Examples
Convert website/url to PDF file
- # wkhtmltopdf <url> <filename>
# wkhtmltopdf http://www.gnutoolbox.com gnutoolbox.pdf
# wkhtmltopdf http://www.gnutoolbox.com/Wkhtmltopdf/ Wkhtmltopdf.pdf
To convert .html files to .ps
- wkhtmltopdf my.html my.ps
To convert a local HTML file to PDF
- wkhtmltopdf my.html my.pdf
Useful Links :
wkhtmltopdf home page
wkhtmltopdf Help Docs