Sunday, July 2, 2017

Wkhtmltopdf failed (error code: -6). Message: The switch --header-spacing, is not support using unpatched qt, and will be ignored

This is a quick how-to for fixing the error below on odoo version 10 running on Ubuntu 16.04 Xenial.

Wkhtmltopdf failed (error code: -6). Message: The switch --header-spacing, is not support using unpatched qt, and will be ignored
This error comes up as a result of the version of wkhtmltopdf which has been installed via the package manager (apt). To fix this, download the latest stable version of wkhtmltopdf for Linux from this link. Choose your platform correctly 32bit or 64 bit.
$ sudo apt-get purge wkhtmltopdf
$ wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
$ tar xfv wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
$ sudo mv wkhtmltox /opt/
$ sudo ln -s /usr/bin/wkhtmltopdf /opt/wkhtmltox/bin/wkhtmltopdf
 Hopefully it helps you solve this problem