I am trying to add a bookmark when I merge PDFs into one PDF. It’s, of course, not working. Any help or direction would be greatly appreciated. I need to create a pdf file which contains links and bookmarks in it using Merge Pdf Files and Add Bookmarks to It (Using iTextSharp). Following earlier articles in my iTextSharp series, this particular contribution iTextSharp – Adding Text with Chunks, Phrases and Paragraphs.

Author: Taugore Kajizil
Country: Liberia
Language: English (Spanish)
Genre: Spiritual
Published (Last): 10 September 2013
Pages: 301
PDF File Size: 2.30 Mb
ePub File Size: 7.44 Mb
ISBN: 833-8-31213-820-1
Downloads: 22176
Price: Free* [*Free Regsitration Required]
Uploader: Voshicage

Add Page bookmark to an existing PDF using iTextSharp in C# – CodeProject

You may want to review earlier articles in this series, if you haven’t already done so. Results 1 to 25 of 25 Thread: Subsection1 is added to Section 2 and has been told to appear as a third-level entry in the tree. The resulting XML file looks like this: Update after you updated the question: May 20, The first paragraph contains the bookmaris “Click to go to Existng, and its reference is set to ” target”, just as with the HTML version.

The zoom factor will be adapted so that the complete horizontal width is visible look for FITH in table 7. You may have to register before you itexteharp post: How do you get the paragraph text to be on top of the original pdf.


The first thing you need is the root of the outline tree. Then the outline view for the tree is set as open for Chapter 1, but closed for Chapter 2. In this code sample, we concatenate bookmarks, but in listing 6.

Often when you open a PDF file, your PDF Viewer application displays a tree-view of the structure of the document, with each branch or leaf acting as a link to the corresponding chapter or section.

Adding bookmarks (iText 5)

The rest of the code that adds Chapters and Sections should be straightforward. Last post May 20, Dim para As New iTextSharp. Sections cannot be added alone, but must be added to Chapter objects, or parent Section objects:. All other key-value pairs are attributes of the Title tag.

One of the parameters in O was null. The top-level object is a Chapter, which will always begin boookmarks a new page. Add click ; doc.

Adding bookmarks is not an allowed operation, so you’ll have to remove all signature fields before applying the change. You first obtain a List of HashMap objects.


Add p4 ; doc. AddSubject “Whatever subject you want to give it”. If true, the bookmark is open, showing its kids.

Merge Pdf Files and Add Bookmarks to It (Using iTextSharp) – emanlee – 博客园

To start viewing messages, select the forum that you want to visit from the selection below. Update based on extra comment: The result was nice, but you can do better if you create the outline using PdfOutline objects. The result is that if you click on the “Click to go to the Target” text, the PDF will immediately reposition itself so that “This is the Target” will be at the top of whatever Exisitng viewer you are using. Add new Bookmwrks “Click “.

Take a look at figure 7. Just remember to add a reference to itextsharp. The Title tags are used for its children.

The time now is