Getting wkhtmltopdf to work - Printing PDF

I had .pdf printing errors with Ver5 but these easy instructions fixed it up. Hope this info is of use to some else.

To install wkhtmltopdf in a Debian/Ubuntu server, follow this steps as root

apt-get install wkhtmltopdf
apt-get install xvfb
printf ‘#!/bin/bash\nxvfb-run --server-args=“-screen 0, 1024x768x24” /usr/bin/wkhtmltopdf $*’ > /usr/bin/wkhtmltopdf.sh
chmod a+x /usr/bin/wkhtmltopdf.sh
ln -s /usr/bin/wkhtmltopdf.sh /usr/local/bin/wkhtmltopdf
wkhtmltopdf http://www.google.com output.pdf

If anyone knows about any issues in regards running a “X” server please let me know. Thanks.

Everything from here wkhtmltopdf runs headless flawlessly.

@pdvyas Opps… just checked my new Centos instance and it prints all good… Looks like I was just using an early version of the V5 vagrant box which needed wkhtmltopdf to be installed. Your headless versions are better than my post above… Cheers
Rick