From KevinWiki

Jump to: navigation, search



  • For Ubuntu
dpkg -i wkhtmltox- 

You can also get it from the Ubuntu software repository but that version might not be the latest one.

apt-get install wkhtmltopdf 
  • For Mac OS X, use Homebrew Cask (You don't need to download the wkhtmltopdf package from the website).
brew cask install wkhtmltopdf 

The following instructions are outdated.


$ tar -jxvf wkhtmltopdf-0.11.0_rc1-static-i386.tar.bz2 

$ mv wkhtmltopdf-i386 wkhtmltopdf-i386-0.11.0_rc1 

$ chown root:root wkhtmltopdf-i386-0.11.0_rc1 

$ mv wkhtmltopdf-i386-0.11.0_rc1 /usr/bin/ 
  • Create /usr/bin/wkhtmltopdf.sh

xvfb-run -a -s "-screen 0 640x480x16" wkhtmltopdf-i386-0.11.0_rc1 $*

$ chmod a+x /usr/bin/wkhtmltopdf.sh 

$ cd /usr/bin 

$ ln -s wkhtmltopdf.sh wkhtmltopdf 

If running wkhtmltopdf causes the following error

wkhtmltopdf: cannot connect to X server 


/usr/bin/wkhtmltopdf: line 4: xvfb-run: command not found

Install xvfb

$ apt-get install xvfb 
Personal tools