Internal links with wkhtmltopdf?

dave picture dave · Feb 29, 2012 · Viewed 9.4k times · Source

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.

Answer

Yule picture Yule · Aug 23, 2012

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