Skip to content

Installing wkhtmltopdf

blueheadpublishing edited this page Dec 1, 2011 · 4 revisions

Installing WKHTMLTOPDF

Building From the Source Code

http://code.google.com/p/wkhtmltopdf/wiki/compilation

Mac

curl -O http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-OS-X.i368
mv wkhtmltopdf-0.9.9-OS-X.i368 /usr/local/bin/wkhtmltopdf
chmod +x /usr/local/bin/wkhtmltopdf

Mac with Homebrew

# this can take a while, around 90+ minutes

brew install WKHTMLTOPDF

Windows

# Download and run the wkhtmltopdf.exe file

http://code.google.com/p/wkhtmltopdf/downloads/list

# You will probably need to add wkhtmltopdf.exe to your Windows System Environmental Settings Path (this is a little different for each Windows version).

Right click on your "My Computers" icon, click Advanced Settings, under Environmental Settings
edit the PATH and add the directory path for the wkhtmltopdf.exe file to your PATH.

Linux (ArchLinux)

# Install the wkhtmltopdf package from community

sudo pacman -Sy wkhtmltopdf

Linux (Ubuntu)

# Install the wkhtmltopdf package

sudo aptitude install wkhtmltopdf

or…

# first, installing dependencies

sudo aptitude install openssl build-essential xorg libssl-dev

# for 64bits OS

wget http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-amd64.tar.bz2 
tar xvjf wkhtmltopdf-0.9.9-static-amd64.tar.bz2
mv wkhtmltopdf-amd64 /usr/local/bin/wkhtmltopdf
chmod +x /usr/local/bin/wkhtmltopdf

# for 32bits OS

wget http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-i386.tar.bz2 
tar xvjf wkhtmltopdf-0.9.9-static-i386.tar.bz2
mv wkhtmltopdf-i386 /usr/local/bin/wkhtmltopdf
chmod +x /usr/local/bin/wkhtmltopdf

Linux (Gentoo on Rackspace Cloud)

# search for the following first using emerge –search <files here> I’ve just put the ones i needed. # Note that we may find an easier way later, but wkhtmltopdf responded each time needing these pkgs.

sudo emerge libXext app-admin/eselect-fontconfig x11-libs/libXrender

# for 64bits OS

wget http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-amd64.tar.bz2 
tar xvjf wkhtmltopdf-0.9.9-static-amd64.tar.bz2
mv wkhtmltopdf-amd64 /usr/local/bin/wkhtmltopdf
chmod +x /usr/local/bin/wkhtmltopdf