Skip to content

Instantly share code, notes, and snippets.

@faniska
Last active March 11, 2024 11:51
Show Gist options
  • Star 42 You must be signed in to star a gist
  • Fork 14 You must be signed in to fork a gist
  • Save faniska/37f896d5e9de5fee925925d7caf3cb9e to your computer and use it in GitHub Desktop.
Save faniska/37f896d5e9de5fee925925d7caf3cb9e to your computer and use it in GitHub Desktop.
Install wkhtmltopdf with patched QT on Ubuntu Linux
# Uncomment the next line if you have installed wkhtmltopdf
# sudo apt remove wkhtmltopdf
cd ~
# Select an appropriate link for your system (32 or 64 bit) from the page https://wkhtmltopdf.org/downloads.html and past to the next line
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
tar xvf wkhtmltox*.tar.xz
sudo mv wkhtmltox/bin/wkhtmlto* /usr/bin
sudo apt-get install -y openssl build-essential libssl-dev libxrender-dev git-core libx11-dev libxext-dev libfontconfig1-dev libfreetype6-dev fontconfig
@solucionatico
Copy link

Great, thanks man.

@pvin
Copy link

pvin commented Apr 23, 2018

Thanks @faniska. It worked.

@marceloalejoc
Copy link

Yes! Thanks.

@i-Tor
Copy link

i-Tor commented Jun 9, 2018

Thank you! This set me up in the right direction. After much investigation, only wkhtml2pdf version that worked was 12.1.

@odoobandung
Copy link

yes

@carlosmaguda
Copy link

thank you worked for me as well

@vladnfr
Copy link

vladnfr commented Oct 25, 2018

Saved my evening!

@AthmanZiri
Copy link

I'm running odoo11 and this worked for me! Thanks

@PratikTUS
Copy link

It's not working, I am using odoo 12 still getting error: Wkhtmltopdf failed (error code: -8). Message: b''

@thkfighter
Copy link

thkfighter commented Mar 10, 2019

It's not working, I am using odoo 12 still getting error: Wkhtmltopdf failed (error code: -8). Message: b''

I've found the solution from the odoo forum:

install the ttf-mscorefonts-installer package and clear your font cache:
sudo apt install ttf-mscorefonts-installer
sudo fc-cache -f -v
by Mitul Shingala

@syeduzairshah
Copy link

@faniska worked like a charm, thanks for sharing

@nevthanhps
Copy link

Thank you! It's work well with Odoo 12 Community on Debian 9

@rvcsdev
Copy link

rvcsdev commented May 17, 2019

It worked! Thank you! You saved me there! :D

@gildaskotako
Copy link

Thank you! It's work well with Odoo 12

@beddiescole
Copy link

Neato! Nifty, man. Thanks, dawg.

@Tahirhan
Copy link

Tahirhan commented Jul 2, 2019

Thanks!

@a8568730
Copy link

a8568730 commented Jul 30, 2019

Thank you! You saved my day! It works with Mint 18.3 Cinnamon 64-bit 3.6.7.

To those who get the error "wkhtmltopdf throws "QSslSocket: cannot resolve CRYPTO_num_locks" when using a template", I follow the advise and it works.

sudo apt-get install libssl1.0-dev

@jpsneto
Copy link

jpsneto commented Jul 30, 2019

Thanks!!
Solved the problem:
Wkhtmltopdf failed (error code: -6). Message: The switch --header-spacing, is not support

@sonoalex
Copy link

thanks!!!

@regispirard
Copy link

Still helpful, thanks !

@madhanrajeswaran
Copy link

Works well on Ubutu 18 & Odoo 13. Great!

@nitingopi
Copy link

wow worked like charm in ubuntu 20
downloaded .deb file and installed it!!!

@altela
Copy link

altela commented Feb 18, 2021

thank you, worked in debian 9 stretch with odoo version 12

@BerangerNt
Copy link

Thank you, definitely useful !

@quentinous
Copy link

Many thanks

@wittkaemper
Copy link

Worked for debian 11 bullseye

@HDias
Copy link

HDias commented Nov 24, 2022

Great @faniska!

Im my case I nedd add too:

ln -s /usr/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf

@XeJames
Copy link

XeJames commented Dec 18, 2022

Using minimalist Debian (TurnkeyLinux Distribution) tar won't have xz installed so error occurs during tar -xfz:

user@odoo ~# tar -xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
tar (child): xz: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now

Solution is to upgrade tar:

user@odoo ~# apt install xz-utils

@totial
Copy link

totial commented Mar 30, 2023

Had text rendering problems with any method.
I got it fixed installing with:
sudo apt-get install wkhtmltopdf

@yize-dev
Copy link

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment