M HYPE SPLASH
// updates

How to install wkhtmltopdf 0.12.1 on Ubuntu server?

By Emma Valentine

I am trying to install current stable version 0.12.1, but it only installs 0.9.9. Any chance to install latest version with apt-get install? It seems that 0.9.9 is very old :(

1

6 Answers

In Ubuntu 16.04 and later wkhtmltopdf 0.12.2+ can be installed from the default Ubuntu repositories.

In Ubuntu 14.04, open the terminal and type:

sudo add-apt-repository ppa:ecometrica/servers
sudo apt-get update
sudo apt-get install wkhtmltopdf 

In Ubuntu 12.04, open the terminal and type:

sudo add-apt-repository ppa:pov/wkhtmltopdf
sudo apt-get update
sudo apt-get install wkhtmltopdf 

and one step after this is to reboot the server or else you will get the error: wkhtmltopdf: cannot connect to X server .

5

Steps:

  1. At first install xvfb serwer:

    sudo apt-get install xvfb
  2. Get needed version of wkhtmltopdf from .

    For Ubuntu 14.04 64-bit:

    wget 
  3. Install wkhtmltopdf:

    sudo dpkg -i wkhtmltox-0.12.2.1_linux-trusty-amd64.deb

    Install dependency (if needed):

    sudo apt-get -f install
  4. Create symblic link in /usr/local/bin/:

    echo 'exec xvfb-run -a -s "-screen 0 640x480x16" wkhtmltopdf "$@"' | sudo tee /usr/local/bin/wkhtmltopdf.sh >/dev/null
    sudo chmod a+x /usr/local/bin/wkhtmltopdf.sh
3

I used the following on Ubuntu 14.04.5 LTS

wget
sudo apt-get install libxrender1 xfonts-utils xfonts-base xfonts-75dpi libfontenc1 x11-common xfonts-encodings libxfont1 fontconfig
sudo dpkg -i wkhtmltox-0.12.2_linux-trusty-amd64.deb
sudo reboot now

Note: this is version 0.12.2! So you don't have to deal with installing xvfb since you're probably not running X as it's a server.

If it fails at sudo dpkg -i wkhtmltox-0.12.2_linux-trusty-amd64.deb then proceed with sudo apt get install -f to install with dependencies.

2

Try this Solution :

  1. Download the deb archive and install using DPKG.

    sudo dpkg -i wkhtmltox-0.12.1_linux-trusty-amd64.deb
  2. sudo ln -s /usr/local/bin/wkhtmltopdf /usr/bin 
  3. sudo ln -s /usr/local/bin/wkhtmltoimage /usr/bin

To install wkhtmltopdf 0.12.5 on ubuntu 16.04, try this,

  1. Wkhtmltopdf version 0.12.5 is recommended for odoo 12.

    wget 
  2. Install the package using DPKG.

    sudo dpkg -i wkhtmltox_0.12.5-1.trusty_amd64.deb 
  3. This will install all dependencies.

    sudo apt -f install

After trying the below command, It worked for me

cd ~
yum install -y xorg-x11-fonts-75dpi xorg-x11-fonts-Type1 openssl git-core fontconfig
wget
tar xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
mv wkhtmltox/bin/wkhtmlto* /usr/bin

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy