Monday, October 24, 2016

Convert HTML Pages into PDF in archlinux using HTML2PDF

wkhtmltopdf and wkhtmltoimage are open source (LGPLv3) command line tools to render HTML into PDF and various image formats using the Qt WebKit rendering engine. These run entirely "headless" and do not require a display or display service.

Installation in archlinux:
$sudo pacman -S wkhtmltopdf
Usage:
Convert HTML to PDF
$wkhtmltopdf url.com url.pdf
Convert HTML to Image
$wkhtmltoimage url.com url.jpeg
GUI interface using HTML2PDF:
AUR Link:
https://aur.archlinux.org/packages/html2pdf/
$wget -c https://aur.archlinux.org/cgit/aur.git/snapshot/html2pdf.tar.gz
$tar -xvzf html2pdf.tar.gz && cd html2pdf
$makepkg -s
$sudo pacman -U *.pkg.tar.xz
If you have problem downloading deb you can get deb here:
https://code.google.com/archive/p/foxoman/downloads
Then put with PKGBUILD

Here's the html2pdf GUI:
Convert HTML Pages into PDF in archlinux using HTML2PDF

Sample results:

Convert HTML Pages into PDF in archlinux using HTML2PDF

If the pages is longer, then the content will be split into several pages.

Ok that's it.

Enjoy
Share on Facebook
Share on Twitter
Share on Google+