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/
chmod a+x /usr/bin/
ln -s /usr/bin/ /usr/local/bin/wkhtmltopdf
wkhtmltopdf 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