Search Results for

    Show / Hide Table of Contents

    Class 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");

    Inheritance
    System.Object
    PdfBookMark
    Namespace: IronPdf.Bookmarks
    Assembly: IronPdf.dll
    Syntax
    public class PdfBookMark : Object, IPdfBookmark
    Remarks

    Key Properties:

    Standards:

    Properties

    Bottom

    Declaration
    public int Bottom { get; }
    Property Value
    Type Description
    System.Int32

    Children

    Gets the collection of child bookmarks nested under this bookmark. Use to create hierarchical navigation structures (chapters → sections → subsections).

    Example:

    var chapter = pdf.Bookmarks.AddBookMarkAtEnd("Chapter 1", 0);
    chapter.Children.AddBookMarkAtEnd("Section 1.1", 1);
    chapter.Children.AddBookMarkAtEnd("Section 1.2", 3);

    Declaration
    public IPdfBookMarkCollection Children { get; }
    Property Value
    Type Description
    IPdfBookMarkCollection

    Collection of nested bookmarks. Empty if no children exist.

    DestinationType

    Gets the type of navigation destination for this bookmark. Default is Page (navigate to page).

    Declaration
    public virtual BookmarkDestinations DestinationType { get; }
    Property Value
    Type Description
    BookmarkDestinations

    The bookmark destination type.

    ItemId

    Declaration
    public string ItemId { get; set; }
    Property Value
    Type Description
    System.String

    Left

    Declaration
    public int Left { get; }
    Property Value
    Type Description
    System.Int32

    NextBookmark

    Gets the next sibling bookmark at the same hierarchical level. Returns null if this is the last bookmark at this level.

    Declaration
    public IPdfBookmark NextBookmark { get; }
    Property Value
    Type Description
    IronPdf.Bookmarks.IPdfBookmark

    Next sibling bookmark, or null.

    PageIndex

    Gets or sets the zero-based page index that this bookmark navigates to. Page 1 = index 0, Page 2 = index 1, etc.

    Example:

    // Navigate to page 5 (index 4):
    bookmark.PageIndex = 4;

    Declaration
    public int PageIndex { get; set; }
    Property Value
    Type Description
    System.Int32

    Zero-based page index (default: 0).

    Parent

    Bookmark which contains this bookmark

    Declaration
    public IPdfBookmark Parent { get; }
    Property Value
    Type Description
    IronPdf.Bookmarks.IPdfBookmark

    ParentText

    Parent bookmark text

    Declaration
    public string ParentText { get; set; }
    Property Value
    Type Description
    System.String

    PreviousBookmark

    Gets the previous sibling bookmark at the same hierarchical level. Returns null if this is the first bookmark at this level.

    Declaration
    public IPdfBookmark PreviousBookmark { get; }
    Property Value
    Type Description
    IronPdf.Bookmarks.IPdfBookmark

    Previous sibling bookmark, or null.

    PreviousText

    Previous bookmark text

    Declaration
    public string PreviousText { get; set; }
    Property Value
    Type Description
    System.String

    Right

    Declaration
    public int Right { get; }
    Property Value
    Type Description
    System.Int32

    Siblings

    Gets the collection of sibling bookmarks at the same hierarchical level. Includes all bookmarks sharing the same parent, including this bookmark.

    Declaration
    public IPdfBookMarkCollection Siblings { get; }
    Property Value
    Type Description
    IPdfBookMarkCollection

    Collection of sibling bookmarks.

    Text

    Gets or sets the display text shown in the PDF reader's bookmark panel. Use descriptive text like chapter titles, section names, or page descriptions.

    Example:

    bookmark.Text = "Chapter 3: Advanced Topics";

    Declaration
    public string Text { get; set; }
    Property Value
    Type Description
    System.String

    The bookmark display text.

    Top

    Declaration
    public int Top { get; }
    Property Value
    Type Description
    System.Int32

    Zoom

    Declaration
    public int Zoom { get; }
    Property Value
    Type Description
    System.Int32

    Methods

    InsertBookMarkAfter(String, Int32)

    Insert a new bookmark after the specified bookmark

    Declaration
    public IPdfBookmark InsertBookMarkAfter(string text, int pageIndex)
    Parameters
    Type Name Description
    System.String text

    The display text for the link.

    System.Int32 pageIndex

    The zero based page number to link to. E.g. Page 1 has a PageIndex of 0

    Returns
    Type Description
    IronPdf.Bookmarks.IPdfBookmark

    InsertBookMarkBefore(String, Int32)

    Insert a new bookmark after the specified bookmark

    Declaration
    public IPdfBookmark InsertBookMarkBefore(string text, int pageIndex)
    Parameters
    Type Name Description
    System.String text

    The display text for the link.

    System.Int32 pageIndex

    The zero based page number to link to. E.g. Page 1 has a PageIndex of 0

    Returns
    Type Description
    IronPdf.Bookmarks.IPdfBookmark

    See Also

    PdfBookMarkCollection
    Bookmarks
    ☀
    ☾
    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