In PDF language, we often use the terms outline tree or outlines as synonyms for bookmarks. In topic 2, you created bookmarks automatically by using topic and Section objects. The result was nice, but you can do better if you create the outline using PdfOutline objects. The PdfOutline class offers much more functionality, and you can use it to create bookmarks for existing documents.
|Published (Last):||19 October 2011|
|PDF File Size:||15.36 Mb|
|ePub File Size:||8.38 Mb|
|Price:||Free* [*Free Regsitration Required]|
Assuming that your original PDFs already have bookmarks, then you should concatenate not only the documents using the PdfCopy class , you should also concatenate the different bookmarks structures of the different files using the SimpleBookMark class , not forgetting to take into account that you need to shift the page numbers correctly.
This is done in the ConcatenateBookmarks example in chapter 7 of my book:. If the existing documents don't have any bookmarks or if you don't want to copy any existing documents , then your question is a duplicate of a question I answered half a year ago: Merge pdfs and add bookmark with iText in java.
Learn more. How to Add bookmarks to PDF file? Ask Question. Asked 5 years, 6 months ago. Active 5 years, 6 months ago. Viewed 4k times. SetMergeFields ; pdfDoc. GetFiles genereatedpdfs ; Console.
ShiftPageNumbers tempBookmarks, 1, null ; bookmarks. AddRange tempBookmarks ; SimpleBookmark. ShiftPageNumbers tempBookmarks, 3, null ; bookmarks. AddRange tempBookmarks ; pdf. I've also provided the "full-blown" answer Java and C , but that answer assumes that the existing documents already have bookmarks. It's not clear from your question if this is the case. If you want me to comment on your code right now, you won't like what I'll say.
To avoid this, please throw away your code. Go for a walk. As soon as you have cleared your head, read stackoverflow. Active Oldest Votes. GetBookmark reader ; SimpleBookmark. AddPage copy. Bruno Lowagie Bruno Lowagie Sign up or log in Sign up using Google.
Subscribe to RSS
HELP Adding bookmarks to Existing PDF using PdfStamper ?