Search Results for

    Show / Hide Table of Contents

    Namespace IronPdf.Annotations

    Classes

    LinkAnnotation

    Creates a clickable link annotation that navigates to a specific page within the same PDF document. Useful for building custom tables of contents, cross-references, and in-document navigation.

    // Add a link on page 0 that navigates to page 5:
    var link = new LinkAnnotation(pageIndex: 0, destinationPageIndex: 5)
    {
        X = 50, Y = 700,
        Width = 200, Height = 20
    };
    pdf.Annotations.Add(link);
    
    // Custom TOC link with color:
    var tocLink = new LinkAnnotation(0, 3)
    {
        X = 72, Y = 600,
        Width = 300, Height = 16,
        Contents = "Chapter 1 - Introduction"
    };
    pdf.Annotations.Add(tocLink);

    The link annotation creates an invisible clickable region on the page.

    See: https://ironpdf.com/how-to/annotations/

    Coordinate note: The Y property sets the bottom edge

    of the clickable area using PDF coordinates (origin at bottom-left of page). When positioning

    links over existing text using PdfPage.TextChunks, use BoundingBox.Bottom for Y and Math.Abs(BoundingBox.Top - BoundingBox.Bottom) for Height.

    PdfAnnotation

    Base PDF annotation

    PdfAnnotationCollection

    Manages the collection of annotations (sticky notes, comments) in a PDF document. Supports adding, removing, and iterating through annotations across all pages.

    Access via Annotations property. Changes to the collection are automatically synchronized with the PDF document.

    Example - Work with annotations:

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

    // Add annotation to first page: var note = new TextAnnotation(0) { Title = "Review Note", Contents = "Please verify this section", X = 100, Y = 700 }; pdf.Annotations.Add(note);

    // List all annotations: foreach (var annotation in pdf.Annotations) Console.WriteLine($"Page {annotation.PageIndex}: {annotation.Contents}");

    // Remove annotations from page 2: pdf.Annotations.RemoveAllAnnotationsForPage(1);

    // Clear all annotations: pdf.Annotations.Clear();

    pdf.SaveAs("annotated.pdf");

    PdfAnnotationType

    PdfFreeTextAnnotation

    PDF free annotation

    PdfLinkAnnotation

    PDF link annotation

    PdfTextAnnotation

    PDF text annotation

    TextAnnotation

    Creates interactive sticky-note annotations for PDF documents - like Post-it® notes for digital documents. Perfect for comments, review feedback, and collaborative document workflows.

    // Add simple comment:
    var comment = new TextAnnotation(0, "Review", "Please check figures") {
        X = 100, Y = 100,
        Color = Color.Yellow
    };
    pdf.Annotations.Add(comment);
    
    // Review annotation with metadata:
    var review = new TextAnnotation(pageIndex: 0) {
        Title = "John Smith",
        Subject = "Technical Review",
        Contents = "Algorithm needs optimization",
        X = 300, Y = 500,
        Color = Color.Red,
        OpenByDefault = true
    };
    pdf.Annotations.Add(review);
    
    // Hidden annotation for metadata:
    var metadata = new TextAnnotation(0, "Version", "v2.1.0") {
        Hidden = true,
        Printable = false
    };
    pdf.Annotations.Add(metadata);

    Annotations appear as icons that expand to show full text

    Some PDF viewers may not respect all properties

    See: https://ironpdf.com/how-to/annotations/

    TextAnnotation.AnnotationIcon

    Icons used to interact with (open/close) the annotation with the PDF page.

    Interfaces

    IAnnotation

    PDF document annotation

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