Skip to content

Instantly share code, notes, and snippets.

  • Save ercanertan/61b9559dc344ed4f2fae4f103ffed944 to your computer and use it in GitHub Desktop.
Save ercanertan/61b9559dc344ed4f2fae4f103ffed944 to your computer and use it in GitHub Desktop.
Installing wkhtmltopdf 0.12.4, 0.12.5 - Ubuntu 16.04 x64, 0.12.5 - Ubuntu 18.04 x64 - 0.12.5 - MacOS High Sierra 10.13.6

You can check here for getting the latest version. Change the wget url to download newer versions.

Install instructions
wkhtmltopdf 0.12.4 - Ubuntu 16.04 x64
wkhtmltopdf 0.12.5 - Ubuntu 16.04 x64
wkhtmltopdf 0.12.5 - Ubuntu 18.04 x64
wkhtmltopdf 0.12.5 - MacOS High Sierra 10.13.6 & Mojave 10.14
Install verification

wkhtmltopdf 0.12.4 - Ubuntu 16.04 x64

Prerequisites

  • libxrender1

Credits to danielghitoiu

$ sudo apt-get install libxrender1
$ wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
$ tar -xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
$ cd wkhtmltox/bin/
$ sudo mv wkhtmltopdf /usr/bin/wkhtmltopdf
$ sudo mv wkhtmltoimage /usr/bin/wkhtmltoimage
$ sudo chmod a+x /usr/bin/wkhtmltopdf
$ sudo chmod a+x /usr/bin/wkhtmltoimage

wkhtmltopdf 0.12.5 - Ubuntu 16.04 x64

credits to @vmdao

$ wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.trusty_amd64.deb
$ sudo dpkg -i  wkhtmltox_0.12.5-1.trusty_amd64.deb 
$ sudo apt -f install

wkhtmltopdf 0.12.5 - Ubuntu 18.04 x64

credits to @J5Dev

$ sudo apt-get install -y software-properties-common && \
sudo apt-add-repository -y "deb http://security.ubuntu.com/ubuntu xenial-security main" && \
sudo apt-get -yq update && \
sudo apt-get install -y libxrender1 libfontconfig1 libx11-dev libjpeg62 libxtst6 \
                           fontconfig xfonts-75dpi xfonts-base libpng12-0 && \
wget "https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox_0.12.5-1.xenial_amd64.deb" && \
sudo dpkg -i wkhtmltox_0.12.5-1.xenial_amd64.deb && \
sudo apt-get -f install

wkhtmltopdf 0.12.5 - MacOS High Sierra 10.13.6 / Mojave 10.14

Prerequisites

$ brew update && brew cask install wkhtmltopdf

Verify that it is working

$ wkhtmltopdf https://google.com google.pdf

//Linux
$ xdg-open google.pdf

//MacOS
$ open google.pdf

Output

Loading pages (1/6)
Counting pages (2/6)                                               
Resolving links (4/6)                                                       
Loading headers and footers (5/6)                                           
Printing pages (6/6)
Done    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment