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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to create nested bookmarks in PDF?

Platform: WinForms |
Control: PDF
Tags: pdf, bookmarks

You can create nested bookmarks easily in PDF. Refer to the following code examples.


            //Initialize the PDF document
            PdfDocument doc = new PdfDocument();
            //Set page mode
            doc.ViewerPreferences.PageMode = PdfPageMode.UseOutlines;
            //Add top level bookmark
            PdfBookmark pdfBookMark = doc.Bookmarks.Add("Top Book Mark");
            //Add a new page to PDF document
            PdfPage page = doc.Pages.Add();
            //Assign the destination
            pdfBookMark.Destination = new PdfDestination(page);
            //Add new bookmarks and destination
            PdfBookmark pageBookMark1 = pdfBookMark.Add("Page 1");
            pdfBookMark[0].Destination = new PdfDestination(page);
            pageBookMark1.Add("Quarter 1");
            pageBookMark1[0].Destination = new PdfDestination(page, new PointF(10, 200));
            pageBookMark1.Add("Quarter 2");
            pageBookMark1[1].Destination = new PdfDestination(page, new PointF(10, 400));
            pageBookMark1.Add("Quarter 3");
            pageBookMark1[2].Destination = new PdfDestination(page, new PointF(10, 600));
            // Save and close the document.



        'Initialize the PDF document
        Dim doc As New PdfDocument()
        'Set page mode
        doc.ViewerPreferences.PageMode = PdfPageMode.UseOutlines
        'Add top level bookmark
        Dim pdfBookMark As PdfBookmark = doc.Bookmarks.Add("Top Book Mark")
        'Add a new page to PDF document
        Dim page As PdfPage = doc.Pages.Add()
        'Assign the destination
        pdfBookMark.Destination = New PdfDestination(page)
        'Add new bookmarks and destination
        Dim pageBookMark1 As PdfBookmark = pdfBookMark.Add("Page 1")
        pdfBookMark(0).Destination = New PdfDestination(page)
        pageBookMark1.Add("Quarter 1")
        pageBookMark1(0).Destination = New PdfDestination(page, New PointF(10, 200))
        pageBookMark1.Add("Quarter 2")
        pageBookMark1(1).Destination = New PdfDestination(page, New PointF(10, 400))
        pageBookMark1.Add("Quarter 3")
        pageBookMark1(2).Destination = New PdfDestination(page, New PointF(10, 600))
        ' Save and close the document.


Refer to the following sample link for creating the nested Bookmark.


2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile