This question has been flagged
18 Replies
103595 Views

Using the regular packages available for wkhtmltopdf 0.12.1 results in dependency errors on Ubuntu 18.04 LTS, but Odoo needs the version 0.12.1 to work properly. How can I install wkhtmltopdf 0.12.1 properly on Ubuntu 18.04?

Avatar
Discard

wkhtmltopdf 0.12.4 (with patched qt) works fine with ubuntu 18.04.

Author

IIRC there are issues with version 0.12.4 and 0.12.1 is still the recommend version.

Author Best Answer

Based on Yenthe's issue on Github https://github.com/wkhtmltopdf/wkhtmltopdf/issues/3898 and thanks to the new builds provided by Ashish Kulkarni, the procedure is straightforward:

sudo wget https://builds.wkhtmltopdf.org/0.12.1.3/wkhtmltox_0.12.1.3-1~bionic_amd64.deb
sudo dpkg -i wkhtmltox_0.12.1.3-1~bionic_amd64.deb
sudo apt-get install -f
sudo ln -s /usr/local/bin/wkhtmltopdf /usr/bin
sudo ln -s /usr/local/bin/wkhtmltoimage /usr/bin

apt-get install -f will install the missing dependencies, which are shown as errors by the dpkg command.

You can find other builds for wkhtmltopdf 0.12.1.3 suitable for Odoo on different Linux systems here: https://builds.wkhtmltopdf.org/0.12.1.3/

For detailled information please check the Odoo Wiki: https://github.com/odoo/odoo/wiki/Wkhtmltopdf

Enjoy.

Avatar
Discard

Hey Ermin, thanks for the reply! This does indeed work, I just still have to copy the wkhtmltopdf files so perhaps you can add that here too? I did it like this:

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

sudo ln -s /usr/local/bin/wkhtmltoimage /usr/bin

Then it works great on 18.04 :-)

Author

I'm not sure, I believe I did that but it was not necessary. I'll try it again and will update my answer if you are right.

Author

Of course you are right, I was probably dreaming :-)

and if you are still having problems to print, empty pdf files etc, add this to parameters: report.url = 127.0.0.1:PORT_NUMBER

F.P: Yes, that is a commonly known problem in Odoo. Usually happens in containered deployments :-)

yes, but still many of us are not aware of it :)

Thanks it works

Thank you, this works like a charm

Hi Ermin,

I installed the "wkhtmltopdf-.12.1.3". and confiqure the company "Document Template". its work fine for SO,PO,invoices. But when i take print of the product label or product barcode it will show the error like "Wkhtmltopdf failed (error code: -8). Message: b'' .! can you please help me to solve this.!

Author

I'm late, but please simply read the comment to Ahmed J. ALgharawy's post just below and you'll find the answer to this font problem in my comment.

Thanks it works

Best Answer

Oh, many many many thanks! 

Working like a charm!

Avatar
Discard
Author

You're welcome. But thanking in this forum means upvoting :-)

Can’t because my karma is too low

 

Met vriendelijke groet,

Frank Schouenberg

Enzosystems BV
De Binderij 69
1321 EC Almere
 
The Netherlands
T. +31 36 546 10 46

M. +31 6 407 61 954
www.enzosystems.com
frank@enzosystems.com

 

Van: Ermin Trevisan <trevi@twanda.com>
Verzonden: maandag 4 juni 2018 09:28
Aan: Frank Schouenberg <frank@enzosystems.com>
Onderwerp: Re: Ubuntu 18.04 LTS: How to install wkhtmltopdf 0.12.1

 

You're welcome. But thanking in this forum means upvoting :-)

--
Ermin Trevisan

Sent by Odoo S.A. using Odoo.

Best Answer

Not so fast, @Ermin.  @JKBasseer's comment is entirely appropriate, and shouldn't be downvoted.

I found this comment page from an external googling of my own problems, and this is the most up-to-date discussion of the 'wkhtmltopdf' version hell that Odoo -- and we by extension -- finds ourselves embroiled in.  Your statement that "Version 0.12.1 is still the version recommended by Odoo" is only true up to Odoo 9.  For Odoo 10 and beyond, version 0.12.5 is the recommended version.  (See https://github.com/odoo/odoo/wiki/Wkhtmltopdf).

I wasn't able to readily find this exact version, so I'm running a 0.12.6 beta, which so far has worked fine on Odoo 11 and 12, Ubuntu 18.04 (Bionic Beaver).

You may want to limit this discussion to 0.12.1, but unless you know something to the contrary, this information is more current and useful than your recommendation.  Much of the world has moved beyond Odoo 9.

Avatar
Discard
Best Answer

Hi I try the following, and it works for 

sudo wget https://builds.wkhtmltopdf.org/0.12.1.3/wkhtmltox_0.12.1.3-1~bionic_amd64.deb
sudo dpkg -i wkhtmltox_0.12.1.3-1~bionic_amd64.deb
sudo apt-get install -f
sudo ln -s /usr/local/bin/wkhtmltopdf /usr/bin
sudo ln -s /usr/local/bin/wkhtmltoimage /usr/bi

except for inventory/porduct printing it return the error below

Wkhtmltopdf failed (error code: -8). Message: b''

please advice  

Regards

Ahmed




Avatar
Discard
Author

This is not related to this thread. It seems to be a font issue, please check https://github.com/odoo/odoo/issues/27487

Thanks Ermin,

Yes what you mentioned is correct, it was a Font missing issue roboto.fon

Br

Ahmed

Best Answer

Guys I want to share what has worked me after 2 days of trying this with different solutions. 

Things to note: 

- please check the forum date before consider trying out the solution

- Secondly everyone recommendation of trying of 0.12.1 doesn't matter at all. I have installed the latest version(0.12.4) using the medium blog. 

- Follow that article, remove the old installation and also make sure to use "wkhtmltopdf --version" to test whether your installation has been successful. 

- As am very basic, this helped me that i don't need to be in any specific location in my terminal to install this, i can do from anywhere. Finally the file will be stored under usr/bin/ (after the unzip, after the file moved)

https://medium.com/@aadimator/odoo-wkhtmltopdf-installation-df0f47104c60

Avatar
Discard
Author

This post is about the installation of wkthmltopdf version 0.12.1 and not about other versions of wkhtmltopdf. Version 0.12.1 is still the version recommended by Odoo (see official documentation) and there is a reason for it. If you don't know about the reasons or if you do not care about, then it is up to you to install the version you like, but please do not hijack this clear and specific thread.