18

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.

yas
  • 3,520
  • 4
  • 25
  • 38
  • 1
    My pdf internal links works fine. I am using the name without path, Please show some code? – ppant Mar 01 '12 at 08:58
  • ppant: How do you actually do the internal links in the HTML side? With anchoring like in the question using `Here`? – Joel Peltonen Jul 12 '12 at 06:32
  • Is this still an issue? Did you manage to fix it? @ppant How did you get them to work? For me the links are constructed like in my comment above and the print nicely, but they are not clickable in Acrobat Reader or in Foxit reader. I have 0.11.0. – Joel Peltonen Oct 16 '13 at 11:45
  • No longer an issue as of Oct '14 – Tom Chiverton Oct 13 '14 at 13:19

3 Answers3

5

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

Yule
  • 9,668
  • 3
  • 51
  • 72
  • 2
    Just to clarify is anyone is wondering, the link is to wkhtmltoimage for 64bit linux. Search for the binary you need (PDF for the OP) for the OS you have. – Joel Peltonen Aug 27 '12 at 11:15
3

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.

ajahongir
  • 469
  • 5
  • 11
2

Internal links appear only to work correctly in certain builds for certain platforms. With the latest WkHTMLtoPDF 0.12.5 releases the unix builds are OK (at least for Centos and Ubuntu) and internal links are generated correctly BUT windows builds DO NOT work and leave broken links. I don't know why this is and have commented on GitHub accordingly. Also when multiple html input documents are used any 'internal' hyperlinks between these are broken (all platforms). In other words cross input document links are NOT fixed up. This would be a really useful feature addition (particularly when generating massive reports) but sadly does not appear to be supported as yet.