Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install wkhtmltopdf with patched qt?

Tags:

qt

wkhtmltopdf

I want to convert html to pdf, and I use wkhtmltopdf.

But print size is smaller than I supposed. I want to try --disable-smart-shrinking option but error occured like

$ xvfb-run -- /usr/bin/wkhtmltopdf --disable-smart-shrinking $INPUT $OUTPUT The switch --disable-smart-shrinking, is not support using unpatched qt, and will be ignored.Loading page (1/2) Printing pages (2/2) Done 

Maybe I have to install wkhtmltopdf with patched qt, but I don't know how to install.

I saw following size, but gitorious.org doesn't work.

wkhtmltopdf patched qt?

My OS is Ubuntu14.04, and wkhtmltopdf version is 0.12.2.1

If you know other reason to be printed smaller, tell me please. thanks.

like image 702
hidechae Avatar asked Dec 27 '15 09:12

hidechae


People also ask

What is the latest version of Wkhtmltopdf?

The current stable series is 0.12. 6, which was released on June 11, 2020 – see changes since 0.12. 5.


1 Answers

This straightforward solution (no need to install xvfb, neither compiling QT neither wkhtmltopdf) works like a charm on my Debian Jessie server :

cd mytmpfolder wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz sudo tar xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz sudo mv wkhtmltox/bin/wkhtmlto* /usr/bin/ #create simple html test file echo "<html><body>test</body></html>" >> test.html #perform conversion sudo wkhtmltopdf  --disable-smart-shrinking  --lowquality --enable-external-links --enable-internal-links test.html test.pdf 
like image 129
Tsounabe Avatar answered Sep 20 '22 17:09

Tsounabe