如何在 Odoo v10 中使用 wkhtmltopdf 库

How to make work wkhtmltopdf library in Odoo v10

我已经使用 sudo apt-get install wkhtmltopdf 安装了 wkhtmltopdf。 但是当我尝试打印一份收到 odoo 警告的报告时:

Wkhtmltopdf failed (error code: -6). Message: 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.No protocol specified
QXcbConnection: Could not connect to display

我该如何解决这个问题?

来自Odoo 网站

Danger

to print PDF reports, you must install wkhtmltopdf yourself: the version of wkhtmltopdf available in debian repositories does not support headers and footers so it can not be installed automatically. The recommended version is 0.12.1 and is available on the wkhtmltopdf download page, in the archive section. As there is no official release for Debian Jessie, you can find ours on the extra section of our nightly server.