We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

How to create nested bookmarks by Essential PDF

I am trying to add bookmarks on different levels to pdf document.But no idea how to do it?

I want to add bookmarks like:

-Chapter 1
--Section 1
----Page 1
----Page 2
------Paragraph 3
----Page 3
-Chapter 2
-Index

Thanks.

Another question is what the difference between Essential PDF ASP.NET and Essential PDF Windows is? Can't I use Essential PDF in both web app and windows app?

1 Reply

SR Sundaram R Syncfusion Team June 4, 2010 11:22 AM UTC

Hi Jason,

Thanks for using Syncfusion products.

Please find below the answer for your queries

I. PDF Nested Bookmarks

Please go through the following steps to add nested bookmarks to a PDF document.

1. Create a PDF document object either by loading a PDF file.

PdfLoadedDocument docMain = new PdfLoadedDocument(filePath);

2. Set Bookmark panel visible and create root book mark.

//To have the Bookmark panel visible by default.
docMain.ViewerPreferences.PageMode = PdfPageMode.UseOutlines;

//To initiate the Root Bookmark, so that bookmarks can be added henceforth.
docMain.CreateBookmarkRoot();

3. Add book mark to the PDF document and assign to a PdfBookMark object.

//Assigning display name for the bookmark
PdfBookmark pdfBookMark = docMain.Bookmarks.Add("Top Book Mark");

4. Assign the page to be navigated when clicking this Book mark.

//Setting the target page to be displayed after clicking the bookmark link.
pdfBookMark.Destination = new PdfDestination(docMain.Pages[0]);

5. Add Level 2 Sub Book mark for the root book mark and its destination page.

PdfBookmark pageBookMark1 = pdfBookMark.Add("Page 1");

pdfBookMark[0].Destination = new PdfDestination(docMain.Pages[0]);

6. Add Level 3 Sub Book mark for the Level 2 Book mark and its destination pages.

pageBookMark1.Add("Quarter 1");

pageBookMark1[0].Destination = new PdfDestination(docMain.Pages[0], new PointF(10, 200));

pageBookMark1.Add("Quarter 2");

pageBookMark1[1].Destination = new PdfDestination(docMain.Pages[0], new PointF(10, 400));

pageBookMark1.Add("Quarter 3");

pageBookMark1[2].Destination = new PdfDestination(docMain.Pages[0], new PointF(10, 600));

NOTE: N number of hierarchy level Bookmarks can be set.


II. Essential PDF - ASP.NET Vs Windows

The Asp.NET version of Essential PDF (Syncfusion.Pdf.Web.dll) can be used with the web application which is hosted under medium-trusted environment. Please refer to the below documentation link for more information.

http://help.syncfusion.com/ug_82/Reporting_PDF/WebApplicationDeployment.html

If you have any further queries, please contact us.

Thanks,
Sundaram R.

Loader.
Live Chat Icon For mobile
Up arrow icon