How to Convert Webpage to PDF in Ubuntu/Debian Linux : wkhtmltopdf
Wkhtmltopdf is a command line utility for converting webpage / html to PDF.
Features
- Convert web pages into PDF documents using webkit
- Adding headers and footers (static version only)
- TOC generation (static version only)
- Batch mode conversions
- (Linux) No longer requires an XServer to be running (however the X11 client libs must be installed)
How to install wkhtmltopdf in Ubuntu / Debian
$ sudo apt-get install wkhtmltopdf
Usage:
$ wkhtmltopdf –help
This will provide help for using wkhtmltopdf
If you want to Convert website home page to a PDF document
$ wkhtmltopdf www.keralalinux.com keralalinux.pdf
This will convert the home page of www.keralalinux.com to a file named keralalinux.pdf.
Page orientation can be change using -O option
$ wkhtmltopdf -O Landscape www.keralalinux.com keralalinux.pdf
This will change page orientation to landscape
Page size can be change using -s option
$ wkhtmltopdf -s A4 www.keralalinux.com keralalinux.pdf
This will change page size to a4 it will support A4, letter etc.
Add table of contents to the pdf document with -t option
$ wkhtmltopdf -t www.keralalinux.com keralalinux.pdf












July 9th, 2011 at 2:23 am
Nice…
hello,very cool. http://akasqxezfp.ismyblogs.name/2011/07/07/flower-girl-dresses-c-you-could-make-your-pretty/ ,nice to meet you…
August 20th, 2011 at 12:06 pm
Great One…
I must say, its worth it! My link, http://www.pocketshark.com/blog/page/kris,thanks haha…