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.

Author:Gardataur Meztigor
Language:English (Spanish)
Published (Last):19 October 2011
PDF File Size:15.36 Mb
ePub File Size:8.38 Mb
Price:Free* [*Free Regsitration Required]

By using our site, you acknowledge that you have read and understand our Cookie Policy , Privacy Policy , and our Terms of Service. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. Now i want to add bookmark to my pdf file. Hi ,this is what i am trying to do, i am not getting any error but still there is no bookmark in my pdf, i want to add bookmark with 4 sections as showed in the image.

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.

Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast JavaScript is ready to get its own place. Featured on Meta. What posts should be escalated to staff using [status-review], and how do I….

We're switching to CommonMark. Linked 1. Related Hot Network Questions. Question feed. Stack Overflow works best with JavaScript enabled.


Subscribe to RSS



HELP Adding bookmarks to Existing PDF using PdfStamper ?


Related Articles