问题
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. I also tried with static version but it give some compilation error
回答1:
The patched version of wkhtmltopdf
is not present in the Ubuntu repository. 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.
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. I've updated my answer to provide the right path to download the latest release.
回答2:
For version 0.12.4 (latest on 15 Jan 2017)
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
回答3:
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! 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:
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!
回答4:
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
来源:https://stackoverflow.com/questions/37765698/unable-to-install-wkhtmltopdf-with-patched-qt-in-ubuntu-16-04