Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. I also tried with static version but it give some compilation error

like image 847
Aayush Tiwari Avatar asked Jun 11 '16 15:06

Aayush Tiwari


People also ask

How do I download Wkhtmltopdf on Ubuntu?

To get the latest wkhtmltopdf & wkhtmltoimage installed on Debian 10 / Ubuntu 20.04/18.04 Linux, you'll need to manually download and install from the . deb package. These tools run entirely “headless” and do not require a display or display service.

How do I install Wkhtmltopdf 0.12 1?

deb sudo apt-get install -f sudo ln -s /usr/local/bin/wkhtmltopdf /usr/bin sudo ln -s /usr/local/bin/wkhtmltoimage /usr/bin apt-get install -f will install the missing dependencies, which are shown as errors by the dpkg command. You can find other builds for wkhtmltopdf 0.12.


3 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.

like image 117
Mary Marchini Avatar answered Oct 21 '22 15:10

Mary Marchini


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
like image 39
Afzal Hossain Avatar answered Oct 21 '22 17:10

Afzal Hossain


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!

like image 1
murph Avatar answered Oct 21 '22 15:10

murph