-
Hello, I need to add a "table of contents" (TOC) section to a PDF document consisting of merged PDFs. The TOC should have (using PDF terminology) Annotations of the type Link whose Destinations refer to the first page of each of the merged PDFs. I wonder if there would be a way to achieve this using PDFQuest.
To have working hyperlinks in my TOC, I see two options:
Would that second solution work? Or am I completely off, and another way exists in order to achieve this? Thanks a lot. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
To answer: "When you create a QuestPDF SectionLink, does that produce an Annotation of type Link whose /Dest value type is a name (and not an explicit Destination, such as [22 0 R /Fit]?" I simply tested it. Indeed, adding a section creates a Named Destination, and the referring SectionLink creates an Annotation of type Link that uses as the /Dest value the name of the section. This is good! Is this behavior guaranteed? or is it an implementation detail that may change? If this behavior is guaranteed, it should be possible to use Named Destinations not created by QuestPDF, and have QuestPDF SectionLink use them, given the corresponding Name is known at the QuestPDF Document creation time. Is there any better solution, or issues I did not foresee? |
Beta Was this translation helpful? Give feedback.
To answer:
"When you create a QuestPDF SectionLink, does that produce an Annotation of type Link whose /Dest value type is a name (and not an explicit Destination, such as [22 0 R /Fit]?"
I simply tested it.
Indeed, adding a section creates a Named Destination, and the referring SectionLink creates an Annotation of type Link that uses as the /Dest value the name of the section. This is good!
Is this behavior guaranteed? or is it an implementation detail that may change?
If this behavior is guaranteed, it should be possible to use Named Destinations not created by QuestPDF, and have QuestPDF SectionLink use them, given the corresponding Name is known at the QuestPDF Document creation time.
I…