Class PdfBookmark
Represents a bookmark in a PDF document, providing access to its title, hierarchical structure, and associated actions or destinations.
public sealed class PdfBookmark
- Inheritance
-
PdfBookmark
- Inherited Members
Remarks
A PdfBookmark allows navigation through the bookmark hierarchy of a PDF document. It provides methods to retrieve child bookmarks, sibling bookmarks, and associated actions or destinations. Bookmarks are typically used to represent a table of contents or navigation points within a PDF document.
Properties
Title
Gets the title of the bookmark represented by this instance.
public string Title { get; }
Property Value
Methods
GetAction()
Retrieves the action associated with the current PDF bookmark, if one exists.
public PdfAction? GetAction()
Returns
- PdfAction
A PdfAction object representing the action associated with the bookmark, or null if no action is associated.
Remarks
Use this method to obtain the action linked to a bookmark in a PDF document, such as navigating to a specific page or executing a script. If the bookmark does not have an associated action, the method returns null.
GetChildCount()
Gets the number of child bookmarks associated with the current bookmark.
public int GetChildCount()
Returns
- int
The number of child bookmarks. Returns 0 if the current bookmark has no children.
Remarks
Use this method to determine the number of child bookmarks for a given bookmark in a PDF document. This can be useful for navigating or processing hierarchical bookmark structures.
GetDestination()
Retrieves the destination associated with the current bookmark.
public PdfDestination? GetDestination()
Returns
- PdfDestination
A PdfDestination object representing the destination linked to the bookmark, or null if no destination is associated.
Remarks
The destination provides information about the location or view in the PDF document that the bookmark points to. If the bookmark does not have an associated destination, the method returns null.
GetFirstChild()
Retrieves the first child bookmark of the current bookmark.
public PdfBookmark? GetFirstChild()
Returns
- PdfBookmark
A PdfBookmark representing the first child bookmark, or null if the current bookmark has no children.
Remarks
Use this method to navigate the hierarchy of bookmarks in a PDF document. If the current bookmark has no child bookmarks, the method returns null.
GetNextSibling()
Retrieves the next sibling of the current bookmark in the document's bookmark hierarchy.
public PdfBookmark? GetNextSibling()
Returns
- PdfBookmark
A PdfBookmark object representing the next sibling of the current bookmark, or null if there is no next sibling.
Remarks
This method navigates the bookmark hierarchy of the PDF document. If the current bookmark is the last sibling in its level, the method returns null.