简体   繁体   English

无法在 ubuntu 16.04 中安装带有补丁 qt 的 wkhtmltopdf

[英]unable to install wkhtmltopdf with patched qt in ubuntu 16.04

wkhtmltopdf with patched qt pkg is not available for ubuntu 16.04 .so i am install 14.04 pkg which is install without patched qt but it need it with patched qt. wkhtmltopdf 与修补的 qt pkg 不适用于 ubuntu 16.04。所以我安装 14.04 pkg,它是在没有修补 qt 的情况下安装的,但它需要带有修补 qt 的 pkg。 I also tried with static version but it give some compilation error我也尝试过静态版本,但它给出了一些编译错误

The patched version of wkhtmltopdf is not present in the Ubuntu repository. Ubuntu 存储库中不存在wkhtmltopdf的修补版本。 You can download it from the project website if you want.如果需要,您可以从项目网站下载它 But they still don't have a .deb file for Xenial Xerus, so you need to download the binary file and install the dependencies ( libxrender1 fontconfig xvfb ) manually.但是他们仍然没有 Xenial Xerus 的.deb文件,因此您需要下载二进制文件并手动安装依赖项( libxrender1 fontconfig xvfb )。

Here is a script that installs the patched version from the project website:这是从项目网站安装修补版本的脚本:

sudo apt-get update
sudo apt-get install libxrender1 fontconfig xvfb
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz -P /tmp/
cd /opt/
sudo tar xf /tmp/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
sudo ln -s /opt/wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf

Edit [16/06/2017]: wkhtmltopdf releases were moved to GitHub due to instability of their servers.编辑[16/06/2017]:由于服务器不稳定,wkhtmltopdf 版本已移至 GitHub。 I've updated my answer to provide the right path to download the latest release.我已经更新了我的答案以提供下载最新版本的正确路径。

For version 0.12.4 (latest on 15 Jan 2017)对于版本 0.12.4(最新于 2017 年 1 月 15 日)

sudo apt-get update
sudo apt-get install libxrender1 fontconfig xvfb
wget http://download.gna.org/wkhtmltopdf/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz -P /tmp/
cd /opt/
sudo tar xf /tmp/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
sudo ln -s /opt/wkhtmltox/bin/wkhtmltopdf /usr/bin/wkhtmltopdf

I ran @matheus-marchini's script to install the patched version a while back and just came back to get the instructions again - however, I discovered that in the interim, the hosting site Gna!不久前我运行@matheus-marchini 的脚本来安装修补版本,然后又回来获取说明 - 但是,在此期间,我发现托管站点 Gna! has shut down.已关闭。 After a little search, I was able to replace the link directly from the source, updating the command as follows:经过一番搜索,我能够直接从源代码替换链接,更新命令如下:

wget https://downloads.wkhtmltopdf.org/0.12/0.12.3/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz -P /tmp/

If you want the most recent version (per @afzal-hossain's answer), it would be:如果您想要最新版本(根据@afzal-hossain 的回答),它将是:

wget https://downloads.wkhtmltopdf.org/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz -P /tmp/

I would have written this as a comment instead of as an "answer" but I do not have enough reputation yet to do that.我会把它写成评论而不是“答案”,但我还没有足够的声誉来做到这一点。 Hope this helps someone else!希望这对其他人有帮助!

try this one试试这个

wget http://security.ubuntu.com/ubuntu/pool/universe/w/wkhtmltopdf/wkhtmltopdf_0.12.2.4-1_amd64.deb
sudo dpkg -i wkhtmltopdf_0.12.2.4-1_amd64.deb

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM