Search Results for

    Show / Hide Table of Contents

    Namespace IronPdf.Bookmarks

    Classes

    BookmarkDestinations

    Bookmark destinations

    PdfBookMark

    Represents a single PDF bookmark (outline entry) for document navigation. Bookmarks appear in the sidebar of PDF readers, enabling quick jumps to specific pages.

    Bookmarks form a hierarchical tree structure with parent-child relationships, allowing organized document navigation (e.g., chapters with sections).

    Example - Create document outline:

    var pdf = new ChromePdfRenderer().RenderHtmlAsPdf(htmlContent);
    

    // Add top-level bookmarks: var chapter1 = pdf.Bookmarks.AddBookMarkAtEnd("Chapter 1: Introduction", 0); var chapter2 = pdf.Bookmarks.AddBookMarkAtEnd("Chapter 2: Getting Started", 5);

    // Add nested bookmarks (sections): chapter1.Children.AddBookMarkAtEnd("1.1 Overview", 0); chapter1.Children.AddBookMarkAtEnd("1.2 Requirements", 2);

    // Insert bookmark between existing ones: chapter1.InsertBookMarkAfter("1.1a Quick Start", 1);

    pdf.SaveAs("documented.pdf");

    PdfBookMarkCollection

    Manages a collection of PDF bookmarks (document outline) for navigation. Supports adding, removing, and traversing bookmarks in a hierarchical structure.

    Access the root collection via Bookmarks. Each bookmark can have its own Children collection for nested entries.

    Example - Build complete document outline:

    var pdf = PdfDocument.FromFile("manual.pdf");
    

    // Create root-level chapters: var intro = pdf.Bookmarks.AddBookMarkAtEnd("Introduction", 0); var basics = pdf.Bookmarks.AddBookMarkAtEnd("Basic Concepts", 5); var advanced = pdf.Bookmarks.AddBookMarkAtEnd("Advanced Topics", 20);

    // Add nested sections: intro.Children.AddBookMarkAtEnd("Welcome", 0); intro.Children.AddBookMarkAtEnd("Getting Started", 2);

    basics.Children.AddBookMarkAtEnd("Core Features", 5); basics.Children.AddBookMarkAtEnd("Configuration", 10);

    // List all bookmarks: foreach (var bm in pdf.Bookmarks.GetAllBookmarks()) Console.WriteLine($"{bm.Text} → Page {bm.PageIndex + 1}");

    pdf.SaveAs("manual_with_outline.pdf");

    Interfaces

    IPdfBookMarkCollection

    ☀
    ☾
    Downloads
    • Download with Nuget
    • Start for Free
    In This Article
    Back to top
    Install with Nuget
    IronPDF_for_dotnet_log2o
    Blue key in circleGet started for FREE
    No credit card required
    Test in a live environment

    Test in production without watermarks.
    Works wherever you need it to.

    Fully-functional product

    Get 30 days of fully functional product.
    Have it up and running in minutes.

    24/5 technical support

    Full access to our support engineering team during your product trial

    Grey key in circleGet started for FREE
    The trial form was submitted successfully.
    Calendar in circleBook Free Live Demo
    No contact, no card details, no commitments Book a 30-minute, personal demo.
    Here's what to expect:

    A live demo of our product and its key features

    Get project specific feature recommendations

    All your questions are answered to make sure you have all the information you need. (No commitment whatsoever.)

    Grey key in circleBook Free Live Demo
    Your booking has been completed Check your e-mail for confirmation
    Support Team Member 6 related to The C# PDF Library Support Team Member 14 related to The C# PDF Library Support Team Member 4 related to The C# PDF Library Support Team Member 2 related to The C# PDF Library
    Online 24/5
    Need help? Our sales team would be glad to help you.
    Try the Enterprise Trial
    ironpdf_for_dotnet_log2o
    Key in blue circle
    Get your free 30-day Trial Key instantly.
    bullet_checkedNo credit card or account creation required
    Key in blue circle
    Get your free 30-day Trial Key instantly.
    Blue key in circleNo credit card or account creation required
    Green Check in orange circle
    The trial form was submitted successfully.
    badge_greencheck_in_yellowcircle
    Thank you for starting a trial

    Please check your email for the trial license key.

    If you don’t receive an email, please start a live chat or email support@ironsoftware.com

    Install with NuGet
    View Licensing
    • Logo Aetna
    • Logo NASA
    • Logo GE
    • Logo Porsche
    • Logo USDA
    • Logo Qatar
    Join Millions of Engineers who’ve tried IronPDF