๐Ÿ”— Links & Bookmarks

Accessible tagged hyperlinks and document outline for sidebar navigation.

C# โ€” Links & Bookmarks
// Accessible tagged link (recommended)
var p1 = root.AddChild(StructureType.P);
var linkSE = p1.AddChild(StructureType.Link);
page.AddTaggedLink(linkSE,
    "https://github.com/alanfrans/PDFPrime",
    "Visit ObviousPDF on GitHub",
    72, 700, 160, 14,
    new PdfTextOptions {
        Color = new PdfColor(0, 0.2, 0.8),
        FontSize = 12
    });

// Document bookmarks (outline panel)
var ch1 = doc.AddOutline("Chapter 1: Links", 0);
ch1.AddChild("Hyperlinks", 0);
ch1.AddChild("Tagged Links", 0);
doc.AddOutline("Chapter 2: Details", 1);
Screenshot of the Links and Bookmarks PDF showing a clickable blue hyperlink text and the PDF viewer's bookmark panel showing Chapter 1 with nested Section entries and Chapter 2

You should see two pages. Page 1 has a bold "Navigation Examples" heading and a blue underlined link reading "Visit ObviousPDF on GitHub". Page 2 has a bold "Chapter 2: Details" heading and body text. Open the Bookmarks panel to see "Chapter 1: Links" (with children Hyperlinks and Tagged Links) and "Chapter 2: Details".
File: 07_links_bookmarks.pdf

โ™ฟ Accessibility Tip

Always use AddTaggedLink() for accessible links. This creates a proper /Link structure element with an OBJR (object reference) to the annotation, ensuring screen readers announce the link text and destination correctly.