我正在尝试安装 wkhtmltopdf,但是当我这样做时:
sudo dpkg -i wkhtmltox-0.12.1_linux-trusty-amd64.deb
I get :
Preparing to unpack wkhtmltox-0.12.1_linux-trusty-amd64.deb ...
Unpacking wkhtmltox (0.12.1) over (0.12.1) ...
dpkg: dependency problems prevent configuration of wkhtmltox:
wkhtmltox depends on libjpeg-turbo8; however:
Package libjpeg-turbo8 is not installed.
dpkg: error processing package wkhtmltox (--install):
dependency problems - leaving unconfigured
Processing triggers for man-db (2.7.0.2-5) ...
Errors were encountered while processing:
wkhtmltox
所以我尝试:
apt-get update
apt-get install libjpeg-turbo8
然后我得到
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libjpeg-turbo8 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or is only available from another source
E: Package 'libjpeg-turbo8' has no installation candidate
我使用的是 64 位 Debian。
我浏览网络寻找解决方案,但不幸的是没有找到任何答案。
如何获取 libjpeg-turbo8?
EDIT:
所以我尝试了apt-get install wkhtmltopdf
尽管事实上并不推荐。
问题在于apt-get install wkhtmltopdf
问题是该版本并不总是好的,我们应该使用 0.12.1
But:
root@dev01:/opt/odoo/modules_scndf# apt-cache policy wkhtmltopdf
wkhtmltopdf:
Installed: 0.12.1-2
Candidate: 0.12.1-2
Version table:
*** 0.12.1-2 0
500 http://ftp.debian.org/debian/ jessie/main amd64 Packages
100 /var/lib/dpkg/status
版本似乎是最好的,即使apt-get install wkhtmltopdf
但当我在 odoo 上启动我的打印时,我仍然得到
Unable to find Wkhtmltopdf on this system. The report will be shown in html.
这意味着他没有按应有的方式安装。
EDIT 2:
现在,当我尝试打印报告时,我会看到一个弹出窗口:
Wkhtmltopdf failed (Error code : -6). Message : 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