Skip to content

Instantly share code, notes, and snippets.

@lukrizal
Forked from slickplaid/install_wkhtmltopdf.sh
Last active August 29, 2015 14:18
Show Gist options
  • Save lukrizal/68dfd8dd23b0d86dae23 to your computer and use it in GitHub Desktop.
Save lukrizal/68dfd8dd23b0d86dae23 to your computer and use it in GitHub Desktop.
How to install version 0.12.0 (latest as of 5/10/13) of
wkhtmltopdf on Ubuntu 12.04 LTS headless server.
You'll need to have the user in the sudoers group or
modify the script to properly execute the root commands
needed.
There might be a little bit of overkill on the font
inclusions, but I ran into a lot of issues with specific
fonts missing and this seems to fix it.
Reply to this gist if you have questions. If you know
how to build it as a static binary reliably, let me
know. Due to the build time and the number of attempts
I've made at it unsuccessfully, I haven't been able to
get a reproducible 0.12.0 build working yet. The build
time should take about 1/2 to a full hour, so be
prepared for it. A static build can take upwards of 3+
hours.
sudo apt-get update && sudo apt-get upgrade -y;
sudo apt-get build-dep -y libqt4-gui libqt4-network libqt4-webkit;
sudo apt-get install -y openssl build-essential xorg git git-core libssl-dev libxrender-dev t1-xfree86-nonfree xfonts-scalable ttf-ubuntu-font-family ttf-mscorefonts-installer poppler-utils libqt4-dev qt4-dev-tools;
cd ~;
git clone git://gitorious.org/~antialize/qt/antializes-qt.git wkhtmltopdf-qt;
git clone git://github.com/antialize/wkhtmltopdf.git wkhtmltopdf;
cd wkhtmltopdf;
qmake-qt4;
cd ../wkhtmltopdf-qt;
git checkout 4.8.4;
QTDIR=. ./bin/syncqt;
./configure -nomake tools,examples,demos,docs,translations -opensource -prefix ../wkqt;
make -j3 && make install;
cd ../wkhtmltopdf;
../wkqt/bin/qmake;
make -j3 && sudo make install;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment