How to install wkhtmltopdf patched qt without compiling?

Mariano DAngelo picture Mariano DAngelo · Feb 25, 2016 · Viewed 19.3k times · Source

I'm using google cloud instance for host Odoo, somo reports print to pdf ok, but other with custom paperformat get the following error:

"The switch --header-spacing, is not support using unpatched qt, and will be ignored.The switch --header-html, is not support using unpatched qt, and will be ignored.The switch --footer-html, is not support using unpatched qt, and will be ignored.QXcbConnection: Could not connect to display"

I google it, and to solve I need to compile wkhtmltopdf like this: http://www.grobak.net/id/blog/how-fix-wkhtmltopdf-failed-error-code-6 but this proccess need 3 hs and I'm building a script to install google instances on the run with odoo dependencies.

the .deb package have a dependency broken

Anyone know other solution?

Answer

Krishh picture Krishh · Feb 25, 2016

My system configuration is Ubuntu 14.04 and 64 bit. So, i am downloading according to that.

First you have to check your system OS name by

lsb_release -a

Check to see if your Ubuntu Linux operating system architecture is 32-bit or 64-bit, open up a terminal and run the following command below.

file /sbin/init

Download wkhtmltopdf patched with qt using below command

sudo wget -P Downloads https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb

Here, replace "trusty" with your OS name and if 64 bit only then keep "amd64" like that , otherwise change it to "i386" and down load the deb file.

After that execute the following commands,

cd ~/Downloads
sudo dpkg -i wkhtmltox-0.12.1_linux-trusty-amd64.deb

Now, check wkhtmltopdf version with below command,

wkhtmltopdf -V

Enjoy!!