 |
PdfBookmarksCollection Class |
Represents the collection of bookmarks in a pdf document (accessed via
Bookmarks) or the children of a parent bookmark
(accessed via
ChildNodes).
Inheritance HierarchySystemObject
SelectPdf.UniversalPdfBookmarksCollection
Namespace: SelectPdf.UniversalAssembly: SelectPdf.HtmlToPdf.Universal (in SelectPdf.HtmlToPdf.Universal.dll) Version: 26.4
Syntaxpublic class PdfBookmarksCollection : IEnumerable<PdfBookmark>,
IEnumerable
Public Class PdfBookmarksCollection
Implements IEnumerable(Of PdfBookmark), IEnumerable
The PdfBookmarksCollection type exposes the following members.
Properties| | Name | Description |
|---|
 | Count | Number of bookmarks directly in this collection (children not counted). |
 | Document |
The parent pdf document of the bookmarks collection. Returns null when this is
a child collection of another bookmark.
|
 | Item |
Gets the bookmark at the specified zero based index in the bookmarks collection.
|
Top
Methods| | Name | Description |
|---|
  | Add(String, PdfDestination) |
Adds a new bookmark to the bookmarks collection.
|
 | Add(String, Int32) |
Convenience overload — adds a new bookmark that targets the specified page at its top-left corner.
|
 | Add(String, Int32, Single, Single) |
Convenience overload — adds a new bookmark that targets a specific position on a specific page.
|
 | Clear | Removes all bookmarks from this collection. |
 | GetEnumerator | Returns an enumerator that iterates over the top-level bookmarks in this collection. |
  | Insert(Int32, String, PdfDestination) |
Creates a new bookmark and inserts it at the specified zero based index in the bookmarks collection.
|
 | Insert(Int32, String, Int32) |
Convenience overload — inserts a new bookmark at the specified index targeting the specified
page at its top-left corner.
|
 | Insert(Int32, String, Int32, Single, Single) |
Convenience overload — inserts a new bookmark at the specified index targeting a specific
position on a specific page.
|
 | Remove(PdfBookmark) | Removes the specified pdf bookmark. |
 | Remove(String) | Removes the first bookmark in this collection whose text matches the given string. |
 | RemoveAt | Removes the pdf bookmark at the specified index in the bookmarks collection. |
Top
ExamplePdfDocument document = new PdfDocument();
document.AddPage();
document.Bookmarks.Add("Chapter 1", 0);
document.Bookmarks.Add("Chapter 2", 0);
document.Save("out.pdf");
document.Close();Dim document As New PdfDocument()
document.AddPage()
document.Bookmarks.Add("Chapter 1", 0)
document.Bookmarks.Add("Chapter 2", 0)
document.Save("out.pdf")
document.Close()
See Also