|
I have searched the archives and found a few references to a critical problem I am having but I could not find a clear answer – any help would be much appreciated.
I am using iText to create a single PDF by merging a number of PDFs using PDFCopy. I need to create a TOC (not bookmarks) at the beginning of this document with clickable links to the first pages of each of the source PDFs, and I am unable to make these links clickable. Here are some of the things I’ve tried, and the results:
1. using setLocalGoTo in a TOC document and setLocalDestination in each source document, and then merging. This produces a runtime error because, even though the local goto/destination references are identical, they originate in different documents and are thus invalid. 2. using RemoteGoTo with a reference to the final output PDF name. This works as long as the final PDF name is unchanged, but the links fail if the PDF name is changed. 3. using Actions or Annotations in place of LocalGoTo’s – this has the same problem as LocalGoTo 4. using setLocalGoTo in the TOC and creating dummy destinations on a dummy page in the TOC with the same name as the destinations in the source documents, and then merging the TOC without including the dummy page. This produces corrupted links after the merge because the page with the dummy destinations is not present. 5. Using PDFCopy instead of PDFWriter to handle all operations, and generating the TOC at merge time instead of before merge time. This fails because apparently PDFCopy cannot be used in place of PDFWriter for all operations. 6. Postprocessing the merged document to add the links to the final PDF. I cannot find a way to do this.
I am out of ideas – expert help would be greatly appreciated.
-- Marc Stein -- [EMAIL PROTECTED]
|
- [iText-questions] creating a clickable TOC for merged PDFs Marc Stein
