Class PdfBookMarkCollection
Represents a PDF bookmark as seen in the sidebar of PDF reader software to help user's navigate.
Namespace: IronPdf.Bookmarks
Assembly: IronPdf.dll
Syntax
public class PdfBookMarkCollection : PdfClientAccessor
Properties
Count
Total number of bookmarks, including all nested bookmarks
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
FirstBookmark
First bookmark within the bookmark collection at the current level
Declaration
public IPdfBookMark FirstBookmark { get; }
Property Value
Type | Description |
---|---|
IPdfBookMark |
LastBookmark
Last bookmark within the bookmark collection at the current level
Declaration
public IPdfBookMark LastBookmark { get; }
Property Value
Type | Description |
---|---|
IPdfBookMark |
Parent
Bookmark which contains this bookmark collection
Declaration
public IPdfBookMark Parent { get; }
Property Value
Type | Description |
---|---|
IPdfBookMark |
Methods
AddBookMarkAtEnd(String, Int32)
Add a new bookmark at the end of this bookmark collection
Declaration
public IPdfBookMark AddBookMarkAtEnd(string Text, int PageIndex)
Parameters
Type | Name | Description |
---|---|---|
System.String | Text | The display text for the link. |
System.Int32 | PageIndex | The zero based page number to link to. E.g. Page 1 has a PageIndex of 0 |
Returns
Type | Description |
---|---|
IPdfBookMark | Newly added bookmark |
AddBookMarkAtStart(String, Int32)
Add a new bookmark at the start of this bookmark collection
Declaration
public IPdfBookMark AddBookMarkAtStart(string Text, int PageIndex)
Parameters
Type | Name | Description |
---|---|---|
System.String | Text | The display text for the link. |
System.Int32 | PageIndex | The zero based page number to link to. E.g. Page 1 has a PageIndex of 0 |
Returns
Type | Description |
---|---|
IPdfBookMark | Newly added bookmark |
GetAllBookmarks()
Retrieve all bookmarks within this collection, recursively retrieve all children of bookmarks within this collection, and return a flat list
Declaration
public List<IPdfBookMark> GetAllBookmarks()
Returns
Type | Description |
---|---|
System.Collections.Generic.List<IPdfBookMark> | A flattened list of all bookmarks in this collection and all of their children |
GetBookmarkAfter(IPdfBookMark)
Retrieve the next bookmark after the specified bookmark at the current level
Declaration
public IPdfBookMark GetBookmarkAfter(IPdfBookMark PreviousBookmark)
Parameters
Type | Name | Description |
---|---|---|
IPdfBookMark | PreviousBookmark | Previous bookmark |
Returns
Type | Description |
---|---|
IPdfBookMark | Next bookmark at the current level |
GetBookmarkBefore(IPdfBookMark)
Retrieve the previous bookmark before the specified bookmark at the current level
Declaration
public IPdfBookMark GetBookmarkBefore(IPdfBookMark NextBookmark)
Parameters
Type | Name | Description |
---|---|---|
IPdfBookMark | NextBookmark | Next bookmark |
Returns
Type | Description |
---|---|
IPdfBookMark | Previous bookmark at the current level |
GetEnumerator()
Declaration
public IEnumerator<IPdfBookMark> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<IPdfBookMark> |
InsertBookMarkAfter(String, Int32, IPdfBookMark)
Insert a new bookmark after the specified bookmark
Declaration
public IPdfBookMark InsertBookMarkAfter(string Text, int PageIndex, IPdfBookMark PreviousBookmark)
Parameters
Type | Name | Description |
---|---|---|
System.String | Text | The display text for the link. |
System.Int32 | PageIndex | The zero based page number to link to. E.g. Page 1 has a PageIndex of 0 |
IPdfBookMark | PreviousBookmark | Bookmark after which to insert a new bookmark |
Returns
Type | Description |
---|---|
IPdfBookMark |
InsertBookMarkBefore(String, Int32, IPdfBookMark)
Insert a new bookmark before the specified bookmark
Declaration
public IPdfBookMark InsertBookMarkBefore(string Text, int PageIndex, IPdfBookMark NextBookmark)
Parameters
Type | Name | Description |
---|---|---|
System.String | Text | The display text for the link. |
System.Int32 | PageIndex | The zero based page number to link to. E.g. Page 1 has a PageIndex of 0 |
IPdfBookMark | NextBookmark | Bookmark before which to insert a new bookmark |
Returns
Type | Description |
---|---|
IPdfBookMark |
RemoveBookMark(IPdfBookMark)
Removes the specified bookmark from this bookmark collection
Declaration
public void RemoveBookMark(IPdfBookMark bookmark)
Parameters
Type | Name | Description |
---|---|---|
IPdfBookMark | bookmark | The bookmark object to remove. |
RemoveBookMarkAt(Int32)
Removes a bookmark at the specified index from this bookmark collection or any of its children
Declaration
public void RemoveBookMarkAt(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index of the bookmark to remove. |