Install wkhtmltopdf 0.12.4 on CentOS 6.x and 7.x

Install dependencies (if needed)

$ yum install -y xorg-x11-fonts-75dpi
$ yum install -y xorg-x11-fonts-Type1
$ yum install xz

Get latest version of wkhtmltopdf (replace version number if needed)

$ wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz

Untar and move wkhtmltox

$ unxz wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
$ tar -xvf wkhtmltox-0.12.4_linux-generic-amd64.tar
$ mv wkhtmltox /usr/bin/wkhtmltox

Add wkhtmltopdf to .bash_profile (optional)

nano .bash_profile

Add the following line at the end of the .bash_profile file
export PATH=/usr/bin/wkhtmltox/bin:$PATH

And don’t forget..

$ rm wkhtmltox-0.12.4_linux-generic-amd64.tar

Finally enjoy!

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

2018  
Популярное