---
title: "Add link annotations to PDFs in C# | Nutrient .NET SDK"
canonical_url: "https://www.nutrient.io/guides/dotnet/csharp/editor/add-link-annotations-to-pdf/"
md_url: "https://www.nutrient.io/guides/dotnet/csharp/editor/add-link-annotations-to-pdf.md"
last_updated: "2026-10-08T00:00:00.000Z"
description: "How to add link annotations to a PDF using Nutrient .NET SDK."
---

# Adding link annotations to a PDF document

Adding link annotations to PDFs programmatically enables teams to automate document navigation, build interactive table of contents systems, and implement cross-referencing workflows. Whether you’re creating navigable documentation, building multipage reports with internal links, implementing automated bookmarking systems, or creating user guides with jump-to-section functionality, link annotations provide precise control over clickable areas and navigation targets. Link annotations can point to specific pages within a document at exact coordinates, enabling fine-grained navigation control for complex documents.

[Download sample](https://www.nutrient.io/downloads/samples/csharp/add-link-annotations-to-pdf.zip)

## How Nutrient helps you achieve this

Nutrient.NET SDK handles PDF link annotation structures and destination management. With the SDK, you don’t need to worry about:

- Parsing link annotation dictionaries and action structures

- Managing destination arrays and coordinate transformations

- Handling named destinations and action chains

- Complex annotation border styles and appearance properties

Instead, Nutrient provides an API that handles all the complexity behind the scenes, letting you focus on your business logic.

## Complete implementation

Below is a complete working example that demonstrates adding internal link annotations to a PDF. The following line sets up the C# application by importing the Nutrient namespace:

```csharp

using Nutrient;

```

The `Document.Open()` call opens the PDF document. The [using statement](https://learn.microsoft.com/dotnet/csharp/language-reference/statements/using) ensures the document and editor are automatically closed when you’re done, preventing resource leaks. The following code creates a PDF editor, accesses the page collection, ensures at least one page exists by adding a letter-size page (612×792 points) if the document is empty, and retrieves the annotation collection from the first page:

```csharp

try
{
    using Document document = Document.Open("input.pdf");
    using PdfEditor editor = PdfEditor.Edit(document);
    PdfPageCollection pages = editor.PageCollection;

    if (pages.Count == 0)
    {
        pages.Add(612.0f, 792.0f);
    }

    PdfPage page = pages.First?? throw new InvalidOperationException("The document has no pages.");
    PdfAnnotationCollection annotations = page.AnnotationCollection;

```

## Adding a link to another page

The following code adds a new page to the document and creates a link annotation at coordinates (50, 600) with dimensions of 200×20 points. The `AddLink()` method creates a clickable rectangular area on the first page. Link annotations define clickable regions and may be visually subtle or invisible unless you add visible cues such as nearby text, borders, or shapes. The `SetDestination()` method configures the link’s navigation target with three parameters: the destination page index in this SDK example (`2`), the x-coordinate on the destination page (0.0, left edge), and the y-coordinate (792.0, top of page in points). When users click the link area, their PDF viewer navigates to the configured destination. Verify click behavior in your target viewer.

```csharp

    pages.Add(612.0f, 792.0f);

    PdfLinkAnnotation pageLink = annotations.AddLink(
        50.0f, 600.0f, 200.0f, 20.0f // x, y, width, height
    );
    pageLink.SetDestination(2, 0.0f, 792.0f);

```

## Adding multiple navigation links

The following code demonstrates creating a table of contents navigation system with three clickable links. First, two additional pages are added to the document to provide navigation targets. Then three link annotations are created at vertically stacked positions (550, 520, 490 on the y-axis), each with dimensions 150×20 points. Each link is configured with `SetDestination()` to navigate to a different page (2, 3, and 4 respectively), all targeting the top-left corner (0, 792). The 30-point vertical spacing between links accommodates typical text line heights for labels like “Chapter 1,” “Chapter 2,” etc. This pattern is commonly used for interactive table of contents or navigation menus in multipage documents:

```csharp

    pages.Add(612.0f, 792.0f);
    pages.Add(612.0f, 792.0f);

    PdfLinkAnnotation link1 = annotations.AddLink(
        50.0f, 550.0f, 150.0f, 20.0f // x, y, width, height
    );
    link1.SetDestination(2, 0.0f, 792.0f);

    PdfLinkAnnotation link2 = annotations.AddLink(
        50.0f, 520.0f, 150.0f, 20.0f // x, y, width, height
    );
    link2.SetDestination(3, 0.0f, 792.0f);

    PdfLinkAnnotation link3 = annotations.AddLink(
        50.0f, 490.0f, 150.0f, 20.0f // x, y, width, height
    );
    link3.SetDestination(4, 0.0f, 792.0f);

```

## Modifying a link destination

Existing link annotations can be reconfigured by calling `SetDestination()` with new parameters. The following code demonstrates two modification patterns. The first call changes `link3` to navigate to page 2 at coordinates (100, 500), providing precise scroll positioning for fine-grained navigation control. The second call changes `link2` to navigate to page 4 while passing `null` for the x and y coordinates, which instructs the PDF viewer to use its default scroll behavior (typically fitting the page to the window). Using `null` coordinates is useful when the exact viewing position is less important than reaching the destination page:

```csharp

    // Change link3 to point to page 2 with specific coordinates
    link3.SetDestination(2, 100.0f, 500.0f);

    // Change link2 to point to page 4, letting the viewer choose scroll position
    link2.SetDestination(4, null, null);

```

The final code block saves the document with all link annotations. The try-catch block handles potential errors using `NutrientException`:

```csharp

    editor.SaveAs("output.pdf");
    Console.WriteLine("Successfully saved output.pdf");
}
catch (NutrientException e)
{
    Console.Error.WriteLine($"Error: {e.Message}");
    Environment.Exit(1);
}

```

## Error handling

Nutrient.NET SDK handles errors with exception handling. The methods presented in this guide throw a `NutrientException` if a failure occurs. The `using` statements release the editor and document handles even when a step fails.

## Conclusion

The link annotation workflow consists of several key operations:

1. Open the document and create an editor.

2. Access the page collection and ensure at least one page exists.

3. Retrieve the annotation collection for the target page.

4. Add pages to the document to create navigation targets.

5. Create link annotations with `AddLink()` specifying clickable rectangular areas (add visible cues such as text, borders, or shapes if needed).

6. Configure link destinations with `SetDestination()` specifying destination page index and coordinates, and verify behavior in your target viewer.

7. Create multiple links for table of contents navigation with vertically stacked positioning.

8. Modify existing link destinations by calling `SetDestination()` with new parameters.

9. Use `null` coordinates to let the PDF viewer determine scroll positioning automatically.

10. Save the document — the `using` statements release the native handles.

Nutrient handles link annotation dictionary structures, destination array formatting, and coordinate transformation calculations so you don’t need to understand PDF link annotation specifications or manage action chains manually. The link annotation system provides precise control over clickable areas and navigation targets, enabling interactive document navigation for reports, manuals, and multipage documentation.
---

## Related pages

- [Nutrient .NET SDK editor guides](/guides/dotnet/csharp/editor.md)
- [Adding annotations to a PDF document](/guides/dotnet/csharp/editor/add-annotations-to-pdf.md)
- [Adding a custom page to a PDF document](/guides/dotnet/csharp/editor/add-custom-page-to-pdf.md)
- [Adding interactive form fields to a PDF document](/guides/dotnet/csharp/editor/add-form-fields-to-pdf.md)
- [Adding free text annotations to a PDF document](/guides/dotnet/csharp/editor/add-freetext-annotations-to-pdf.md)
- [Adding invisible digital signatures to a PDF document](/guides/dotnet/csharp/editor/add-invisible-signature-to-pdf.md)
- [Adding redaction annotations to a PDF document](/guides/dotnet/csharp/editor/add-redaction-annotations-to-pdf.md)
- [Adding shape annotations to a PDF document](/guides/dotnet/csharp/editor/add-shape-annotations-to-pdf.md)
- [Adding stamp annotations to a PDF document](/guides/dotnet/csharp/editor/add-stamp-annotations-to-pdf.md)
- [Adding sticky note annotations to a PDF document](/guides/dotnet/csharp/editor/add-sticky-note-annotations-to-pdf.md)
- [Adding text markup annotations to a PDF document](/guides/dotnet/csharp/editor/add-text-markup-annotations-to-pdf.md)
- [Adding visible digital signatures to a PDF document](/guides/dotnet/csharp/editor/add-visible-signature-to-pdf.md)
- [Advanced digital signature workflows](/guides/dotnet/csharp/editor/advanced-digital-signatures.md)
- [Detecting and adding form fields to a PDF document](/guides/dotnet/csharp/editor/detect-and-add-form-fields.md)
- [Editing PDF form fields](/guides/dotnet/csharp/editor/editing-pdf-form-fields.md)
- [Editing PDF metadata with Nutrient .NET SDK](/guides/dotnet/csharp/editor/editing-pdf-metadata.md)
- [Filling PDF form fields](/guides/dotnet/csharp/editor/fill-pdf-form.md)
- [Managing PDF page order](/guides/dotnet/csharp/editor/manage-pdf-page-order.md)
- [Merging PDFs](/guides/dotnet/csharp/editor/merge-pdf-into-other-pdf.md)

