 |
PdfBookmark Class |
Represents a bookmark (outline entry) in a pdf document. Bookmarks appear in the
navigation pane of PDF readers and let users jump to specific locations in the document.
Inheritance HierarchySystemObject
SelectPdf.UniversalPdfBookmark
Namespace: SelectPdf.UniversalAssembly: SelectPdf.Universal (in SelectPdf.Universal.dll) Version: 26.4
SyntaxThe PdfBookmark type exposes the following members.
Properties| | Name | Description |
|---|
 | ChildNodes |
Gets the child bookmark collection, used to create a nested (hierarchical) outline.
|
 | Color |
Gets or sets the bookmark text color.
Some PDF readers do not honor this property.
|
 | Destination |
Gets or sets the bookmark destination. The destination describes which page to
jump to, the position within that page, and the optional fit/zoom mode.
|
 | Parent |
Gets the parent of the current bookmark or null if the bookmark has no parent
(i.e. it is at the top level of the document outline).
|
 | Style |
Gets or sets the bookmark text style (Normal, Italic, Bold, or Italic | Bold).
|
 | Text |
Gets or sets the bookmark text (the text shown in the PDF reader's outline pane).
|
 | X |
Gets the X coordinate (in points) of the on-page destination that this bookmark jumps to.
Shorthand for Destination.X. Returns 0 if no destination is set.
|
 | Y |
Gets the Y coordinate (in points) of the on-page destination that this bookmark jumps to.
Shorthand for Destination.Y. Returns 0 if no destination is set.
|
Top
Methods
Remarks
Bookmarks can be nested to form a hierarchy (e.g. chapter → section → subsection).
Child bookmarks are added via the
ChildNodes collection on this item.
ExamplePdfDocument document = new PdfDocument();
document.AddPage();
PdfBookmark chapter = document.Bookmarks.Add("Chapter 1", 0);
chapter.Style = PdfBookmarkStyle.Bold;
PdfBookmark section = chapter.ChildNodes.Add("Section 1.1", 0);
document.Save("out.pdf");
document.Close();Dim document As New PdfDocument()
document.AddPage()
Dim chapter As PdfBookmark = document.Bookmarks.Add("Chapter 1", 0)
chapter.Style = PdfBookmarkStyle.Bold
Dim section As PdfBookmark = chapter.ChildNodes.Add("Section 1.1", 0)
document.Save("out.pdf")
document.Close()
See Also