PDF support in Ubuntu with wkhtmltopdf

The following script will download a version of wkhtmltopdf that is known to work well with Ubuntu 12 and Ubuntu 14 (LTS x64 versions). It installs it, puts it in the right place and installs the required dependencies (updated with new location for wkhtmltopdf binaries).


# this script downloads and installs the correct version of wkhtmltopdf
# you need to be root. 

if (( $EUID != 0 )); then
    echo "Please run as root"

#get the pdf software (dont show anything on the screen)
wget download.gna.org/wkhtmltopdf/0.12/ >/dev/null 2>&1

apt-get install -y php5-curl curl libxrender1 libfontconfig1 xorg libssl-dev fontconfig libjpeg8 xfonts-75dpi libjpeg-turbo8

dpkg -i wkhtmltox-

echo "Installation complete!"

rm wkhtmltox-