问题描述
我们需要从html/css生成的功能,例如页眉,页脚,目录和pdf封面.我们在Windows上尝试了WKHTML,它就像一个魅力,当移至我们的服务器时,我们在ubuntu服务器上安装了WKHTML,安装过程虽然成功,但功能有限,它能够从HTML生成pdf,但提到的所有功能(即页眉,页脚,目录和封面)不起作用.以下是它所产生的错误.
We require features like header, footer, table of contents and cover page of pdf, which we want to generate from html/css.We tried WKHTML on windows and it worked like a charm, when moving to our server, we installed WKHTML on our ubuntu server, installation process was successful but it had only limited features, it was able to generate pdf from HTML but all features mentioned (i-e header, footer , table of content and cover page) wasn't working. Following is the error which it was producing.
开关-t不支持使用未修补的qt,并且将被忽略.错误:此版本的wkhtmltopdf是针对未修补的QT版本构建的,并且不支持一个以上的输入文档."
"The switch -t, is not support using unpatched qt, and will be ignored. Error: This version of wkhtmltopdf is build against an unpatched version of QT, and does not support more then one input document."
我们遵循了许多教程,并安装了QT修补程序,其中一个教程在这里( https://code .google.com/p/wkhtmltopdf/wiki/compilation ).我们不确定是否跳过了某件事或做错了什么,是否已安装该功能,但很少有功能可以开始工作,但并非全部.我们能够生成页眉和页脚,但封面和目录仍然无法正常工作.我们真正需要的.
We followed many tutorials and installed it with QT patched, one of the tutorial is here (https://code.google.com/p/wkhtmltopdf/wiki/compilation) . We are not sure if we skipped something or did something wrong, it is installed and few of features has started to work but not all. we are able to generate header and footer but cover page and table of content are still not working. which we really need.
推荐答案
如果有人遇到类似的问题,我可以通过.
In case anybody is having the similar issue, I got it fixed by following this article.
所有功能现在都可以正常运行.
All features are working perfectly now.
文章内容:
-
删除以前使用apt-get安装的wkhtmltopdf(如果以前已安装).
Remove wkhtmltopdf installed using apt-get previously (if previously installed).
sudo apt-get remove --purge wkhtmltopdf
安装依赖项.
Install dependencies.
sudo apt-get install openssl build-essential xorg libssl-dev
根据体系结构(i386/amd64)下载静态二进制文件.解压缩它,更改所有者,然后将其复制到/usr/local/bin.
Download the static binary as per the architecture (i386/amd64). Extract it, change the owner and then copy it to /usr/local/bin.
wget http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-i386.tar.bz2
tar xvjf wkhtmltopdf-0.9.9-static-i386.tar.bz2
sudo chown root:root wkhtmltopdf-i386
sudo cp wkhtmltopdf-i386 /usr/local/bin/wkhtmltopdf
这篇关于WKHTMLTOPDF在Ubuntu上的安装错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!