7
votes

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?

3

3 Answers

18
votes

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!!

6
votes

After trying many ways I finally made it work.

First I removed all my previous installation by

  • sudo apt-get remove --purge wkhtmltopdf

  • sudo apt-get autoremove

Then I opened wkhtmltopdf.org and navigated into their Downloads > Archive. In Archive section I downloaded 0.12.1 .deb version by

  • wget <copy the link from website for the.deb file and paste it in terminal here>.

  • sudo dpkg -i <package name>

  • sudo cp /usr/local/bin/wkhtmltopdf /usr/bin

This is because odoo looks for wkhtmltopdf in /usr/bin directory otherwise gives IOError. I also set my webkit_path parameter in Odoo System Parameters to /usr/bin.

Thats it. Hope this helps

0
votes

I was facing same issue with wkhtmltopdf 0.12.4

installed new version of wkhtmltopdf 0.12.6-1

follow below commands to install wkhtmltopdf 0.12.6-1

wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.centos7.x86_64.rpm

yum localinstall wkhtmltox-0.12.6-1.centos7.x86_64.rpm #centos specific command