15

I'm trying to convert multiple URLs to PDF. However, when I compile wkhtmltopdf or run apt-get install wkhtmltopdf and try, it says:

Error: This version of wkhtmltopdf is build against an unpatched version of QT, and does not support more then one input document.

If I use the static version, I get Segmentation fault error.

How do I build wkhtmltopdf against a patched version of QT, or are there any other solutions besides converting one by one and reuniting?

My OS is Ubuntu 12.04 64-bit. Thanks.

kristinalim
  • 3,459
  • 18
  • 27
m3rg
  • 688
  • 2
  • 9
  • 25

3 Answers3

19

First check out the source

 git clone git://gitorious.org/~antialize/qt/antializes-qt.git wkhtmltopdf-qt
 cd wkhtmltopdf-qt
 git checkout 4.8.4
 QTDIR=. ./bin/syncqt

Qt must be configured, a good set of configuration options for qt can found by looking at the output of

cat ../wkhtmltopdf/static_qt_conf_base ../wkhtmltopdf/static_qt_conf_linux | sed -re 's/#.*//'
cd wkhtmltopdf-qt
./configure -nomake tools,examples,demos,docs,translations -opensource -prefix "../wkqt"

And Qt compiled and installed (this will take a while)

make -j3 && make install
cd ..

You must now run qmake in the wkhtmltopdf folder.

cd wkhtmltopdf
../wkqt/bin/qmake

Archived Google Code link.

Tom Zych
  • 13,329
  • 9
  • 36
  • 53
m3rg
  • 688
  • 2
  • 9
  • 25
  • 5
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – ProgramFOX Mar 05 '14 at 17:05
  • 1
    I think new versions will work using precompiled binaries but not sure. – m3rg May 22 '15 at 05:43
4

Go http://wkhtmltopdf.org/downloads.html and download appropriate build. Its already patched with QT.

wkhtmltopdf --help
    or
wkhtmltopdf -V

should show

Description:
  Converts one or more HTML pages into a PDF document, using wkhtmltopdf patched qt.
naren
  • 14,611
  • 5
  • 38
  • 45
  • 2
    Unfortunately, the "Bleeding Edge" downloads are not built with patched qt. (ex. wkhtmltox-0.13.0-alpha-7b36694_msvc2013-win64) – Rami A. Mar 31 '19 at 01:18
2

Download the appropriate debian (*.deb) package from wkhtmltopdf.org.

New to Ubuntu ? To install, double click the downloaded *.deb file.

Barun
  • 1,520
  • 2
  • 12
  • 18