How to install wkhtmltopdf on Centos 6

Had some trouble installing wkhtmltopdf on CentOS 6, so here are the commands to do it:

Install fonts, then icu, then the CentOS 6 RPM for wkhtmltopdf, then x11-server and urw-fonts!  

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

yum install icu

wget https://bitbucket.org/wkhtmltopdf/wkhtmltopdf/downloads/wkhtmltox-0.13.0-alpha-7b36694_linux-centos6-amd64.rpm
 rpm -Uvh wkhtmltox-0.13.0-alpha-7b36694_linux-centos6-amd64.rpm

cd ~website

yum install xorg-x11-server-Xvfb.x86_64
 yum install urw-fonts

export DISPLAY=:0
 export QT_XKB_CONFIG_ROOT=/usr/share/X11/xkb

xvfb-run wkhtmltopdf http://www.google.com.ph google.pdf

go to http://www.website.com/google.pdf

Leave a Reply