๐ 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);
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