How to Correctly Install Wkhtmltopdf on Debian 64 Bit

How to correctly install wkhtmltopdf on debian 64 bit?

Ubuntu and Debian packages are compatible most times but not in all cases, i think this is the trouble you're having you're trying to use the Ubuntu's .deb for Debian instead you should get the Debian specific file, (it works for both jessie and wheezy)

wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.1/wkhtmltox-0.12.1_linux-wheezy-amd64.deb
sudo dpkg -i wkhtmltox-0.12.1_linux-wheezy-amd64.deb

Then in the /etc/init.d/openerp-server or /etc/init.d/odoo-server script(s), depending on your which one you have

add /usr/local/bin to the front of path environment variable for example,

PATH=/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin, 

This tells odoo where to look for system binaries it requires or optionally you can copy the files to /usr/bin, if you don't want to mess with those files

sudo cp /usr/local/bin/wkhtmlto* /usr/bin/

Download page for wkhtmltopdf: https://wkhtmltopdf.org/downloads.html

How to install wkhtmltopdf on a linux based (shared hosting) web server

I've managed to successfully install wkhtmltopdf-amd64 on my shared hosting account without root access.

Here's what i did:

Downloaded the relevant static binary v0.10.0 from here: http://code.google.com/p/wkhtmltopdf/downloads/list

EDIT: The above has moved to here

via ssh on my shared host typed the following:

$ wget {relavant url to binary from link above}
$ tar -xvf {filename of above wget'd file}

you'll then have the binary on your host and will be able to run it regardless of if its in the /usr/bin/ folder or not. (or at least i was able to)

To test:

$ ./wkhtmltopdf-amd64 http://www.example.com example.pdf
  • Note remember that if you're in the folder in which the executable is, you should probably preface it with ./ just to be sure.

Worked for me anyway

How to make wkhtmltopdf work in Odoo v10 on Debian 9 Stretch?

Update (2019/02/28)

I found this wiki where Odoo Developers say the version 0.12.5-1 is recommended for Odoo 10 and later


I have read this on a Git Hub Issue. The writer seems one developer of Wkhtmltopdf:

Currently working on a reworked packaging system in the wkhtmltopdf/packaging repository, you can download preview builds for linux. Will create something for 0.12.1 if required, would appreciate fixing any issues with odoo before the 0.12.5 release.

  • wkhtmltox_0.12.1.3-1~stretch_amd64.deb
  • wkhtmltox_0.12.1.3-1~stretch_i386.deb

WKHTMLTOPDF Installation error on Ubuntu

In case anybody is having the similar issue, I got it fixed by following this article.

All features are working perfectly now.


Article contents:

The wkhtmltopdf shell utility is used to generate PDF documents from HTML using WebKit. I’ve tried a few ruby gem wrappers that make use of wkhtmltopdf, but I’ve found that I like using the wicked_pdf gem the best. Regardless of what wrapper you use to call wkhtmltopdf, here are the steps to get wkhtmltopdf installed on Ubuntu (minor adjustments will be needed for non Debian based distributions).

  1. Remove wkhtmltopdf installed using apt-get previously (if previously installed).

     sudo apt-get remove --purge wkhtmltopdf
  2. Install dependencies.

     sudo apt-get install openssl build-essential xorg libssl-dev
  3. Download the static binary as per the architecture (i386/amd64). Extract it, change the owner and then copy it to /usr/local/bin.

     wget http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-i386.tar.bz2
    tar xvjf wkhtmltopdf-0.9.9-static-i386.tar.bz2
    sudo chown root:root wkhtmltopdf-i386
    sudo cp wkhtmltopdf-i386 /usr/local/bin/wkhtmltopdf

For amd64 bit

wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
tar xvJf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
sudo cp wkhtmltox/bin/wkhtmlto* /usr/bin/

How to install and run wkhtmltopdf Docker image

Another simple answer:

# Create image based on the official openjdk 8-jre-alpine image from the dockerhub
FROM openjdk:8-jre-alpine

# Install wkhtmltopdf
RUN apk add --no-cache wkhtmltopdf

ENTRYPOINT ["wkhtmltopdf"]

wkhtmltopdf: cannot connect to X server

I just figured out that I can simply move the static executable to the /usr/bin/ directory and execute it from anywhere.



Related Topics



Leave a reply



Submit