Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Internal links with wkhtmltopdf?

Tags:

wkhtmltopdf

I have created a PDF from several web pages using wkhtmltopdf.

Is there a way to link across pages, for example from page 10 to 15.

I tried creating an element with an ID and then an anchor to link to it, but this does not work within the same page or across pages. It turns the link into an absolute URL and tries to open it in a web browser.

like image 637
yas Avatar asked Feb 29 '12 20:02

yas


2 Answers

I solved this issue by updating the binary that I was using. I was using 0.8 and switched to 0.11.0 rc1.

Ensure that it is built against QT (the latest binary at http://code.google.com/p/wkhtmltopdf/downloads/detail?name=wkhtmltoimage-0.11.0_rc1-static-amd64.tar.bz2 is.

And then just to be sure enable internal links:

--enable-internal-links 

when you call the conversion

like image 76
Yule Avatar answered Nov 11 '22 14:11

Yule


i had this issue after installing pathced version of QT

i had wkhtmltopdf 0.9.6, than i also switched to 0.11.0 rc1

then worked fine! and no need to use --enable-internal-links. you can just turn off this option by --disable-internal-links* by default its on.

like image 32
ajahongir Avatar answered Nov 11 '22 14:11

ajahongir