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
4 Answers
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.
-
3For my ubuntu 16.04 container, I had to modify the last line of the sequence to::
sudo ln -s /opt/wkhtmltox/bin/wkhtmltopdf /usr/bin/wkhtmltopdf
– JimNov 3, 2016 at 18:44 -
1
-
I downloaded it from
https://downloads.wkhtmltopdf.org/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
– poorvaJun 15, 2017 at 14:05 -
1Downloading from
https://downloads.wkhtmltopdf.org
just redirects to the github releases url, so either is fine.– peterJun 28, 2017 at 19:45 -
3For those of us who tried doing an apt-get install originally, it's best to clean that up first with:
sudo apt-get remove --purge wkhtmltopdf
Aug 17, 2017 at 16:04
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
-
1Please be informed that
gna.org
has been closed now. so you should download precompiled binaries from downloads.wkhtmltopdf.org . Please see github.com/wkhtmltopdf/wkhtmltopdf/issues/… Jun 16, 2017 at 4:47
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!
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
-
1Unfortunately, this version is not patched with Qt. It works fine if you don't need any extra features, like headers, footers, margins, etc. Otherwise it's better to download the binary from the project's website. Jul 8, 2016 at 19:56