Class BookmarkManager
- java.lang.Object
- 
- com.ironsoftware.ironpdf.bookmark.BookmarkManager
 
- 
 public class BookmarkManager extends Object Class used to add , edit and remove bookmarks from aPdfDocumentoutline.Bookmarks are arranged and navigated in a parent/child node hierarchy, similar to an HTML DOM. See: PdfDocument.getBookmark()See: Bookmark
- 
- 
Constructor SummaryConstructors Constructor Description BookmarkManager(InternalPdfDocument internalPdfDocument)Please get BookmarkManager byPdfDocument.getBookmark()instead.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBookMarkAtEnd(String text, int pageIndex)Add a new bookmark at the end of the bookmark collectionvoidaddBookMarkAtStart(String text, int pageIndex)Add a new bookmark at the start of the document collectionBookmarkaddChildBookmark(String text, int pageIndex, String parentBookmarkText)Add a new bookmark as a first child of this bookmark.List<Bookmark>getBookmarks()Retrieve all bookmarks within this PDF, recursively retrieve all children of bookmarks within this collection, and return as a flat listintgetCount()Total number of bookmarks, including all nested bookmarksvoidinsertBookmark(Bookmark bookmark)Insert a new bookmarkvoidinsertBookmark(String text, int pageIndex, String parentText, String previousText)Insert a new bookmark
 
- 
- 
- 
Constructor Detail- 
BookmarkManagerpublic BookmarkManager(InternalPdfDocument internalPdfDocument) Please get BookmarkManager byPdfDocument.getBookmark()instead.- Parameters:
- internalPdfDocument- the internal pdf document
 
 
- 
 - 
Method Detail- 
getCountpublic final int getCount() Total number of bookmarks, including all nested bookmarks- Returns:
- Bookmarks count
 
 - 
getBookmarkspublic final List<Bookmark> getBookmarks() Retrieve all bookmarks within this PDF, recursively retrieve all children of bookmarks within this collection, and return as a flat list- Returns:
- A flattened list of all bookmark ojects in this collection and all of their children
 
 - 
addBookMarkAtEndpublic final void addBookMarkAtEnd(String text, int pageIndex) Add a new bookmark at the end of the bookmark collection- Parameters:
- text- The display text for the link.
- pageIndex- The zero based page number to link to. E.g. Page 1 has a PageIndex of 0
 
 - 
addBookMarkAtStartpublic final void addBookMarkAtStart(String text, int pageIndex) Add a new bookmark at the start of the document collection- Parameters:
- text- The display text for the link.
- pageIndex- The zero based page number to link to. E.g. Page 1 has a PageIndex of 0
 
 - 
insertBookmarkpublic final void insertBookmark(String text, int pageIndex, String parentText, String previousText) Insert a new bookmark- Parameters:
- text- The display text for the link.
- pageIndex- The zero based page number to link to. E.g. Page 1 has a PageIndex of 0
- parentText- parent bookmark text. set to null for insert at the top
- previousText- previous bookmark text. set to null for insert at first of its siblings
 
 - 
insertBookmarkpublic final void insertBookmark(Bookmark bookmark) Insert a new bookmark- Parameters:
- bookmark- a bookmark object.
 
 - 
addChildBookmarkpublic final Bookmark addChildBookmark(String text, int pageIndex, String parentBookmarkText) Add a new bookmark as a first child of this bookmark. To add a bookmark as a second child, please navigate to the childBookmark object and call AddNextBookmark.- Parameters:
- text- The display text for the link.
- pageIndex- The zero based page number to link to. E.g. Page 1 has a PageIndex of 0
- parentBookmarkText- bookmark parent text, set empty if bookmark does not have parent.
- Returns:
- a new child bookmark
 
 
- 
 
-