Class Bookmark
java.lang.Object
com.ironsoftware.ironpdf.bookmark.Bookmark
Represents a PDF bookmark as seen in the sidebar of PDF reader software to help users navigate.
 
Bookmarks are arranged and navigated in a parent/child node hierarchy, similar to an HTML DOM.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionfinal BookmarkAddChildBookmark(String text, int pageIndex) Add a new bookmark as a first child of this bookmark.final voidaddNextBookmark(String text, int pageIndex) Add a new bookmark after this bookmarkfinal voidAddPreviousBookmark(String text, int pageIndex) Add a new bookmark before this bookmarkfinal BookmarkManagerGets bookmark manager.final BookmarkDestinationsGets destination type.final StringGets next bookmark text.final intGets page index.final StringGets parent bookmark text.final StringGets previous bookmark text.final StringgetText()Gets text.final voidSets text.
- 
Constructor Details- 
Bookmarkpublic Bookmark(@Nonnull String text, int pageIndex, @Nullable String parentBookmarkText, BookmarkDestinations destinationType, @Nullable String nextBookmarkText, @Nullable String previousBookmarkText) Instantiates a new Bookmark.- Parameters:
- text- the display text of the bookmark
- pageIndex- the zero based page number that the bookmark links to.
- parentBookmarkText- the text of parent bookmark which contains this bookmark. Null if it is root bookmark.
- destinationType- the type of destination represented by the bookmark
- nextBookmarkText- the text of next bookmark at the current level, if any. Null if it is last bookmark.
- previousBookmarkText- the previous bookmark at the current level, if any. Null if it is first bookmark.
 
 
- 
- 
Method Details- 
getDestinationTypeGets destination type. Type of destination represented by the bookmark.- Returns:
- the destination type
 
- 
getNextBookmarkTextGets next bookmark text. The text of next bookmark at the current level, if any. Null if it is last bookmark.- Returns:
- the next bookmark text
 
- 
getPageIndexpublic final int getPageIndex()Gets page index. The zero based page number that the bookmark links to.- Returns:
- the page index
 
- 
getBookmarkManagerGets bookmark manager.BookmarkManager- Returns:
- the bookmark manager
 
- 
addNextBookmarkAdd a new bookmark after this bookmark- Parameters:
- text- the display text of the bookmark
- pageIndex- the zero based page number that the bookmark links to.
 
- 
getParentBookmarkTextGets parent bookmark text. The text of parent bookmark which contains this bookmark. Null if it is root bookmark.- Returns:
- the parent bookmark text
 
- 
getTextGets text. The display text of the bookmark.- Returns:
- the text
 
- 
setTextSets text. The display text of the bookmark- Parameters:
- value- the value
 
- 
AddPreviousBookmarkAdd a new bookmark before this bookmark- Parameters:
- text- the display text of the bookmark
- pageIndex- the zero based page number that the bookmark links to.
 
- 
getPreviousBookmarkTextGets previous bookmark text. Previous bookmark at the current level, if any. Null if it is first bookmark.- Returns:
- the previous bookmark text.
 
- 
AddChildBookmarkAdd 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 of the bookmark
- pageIndex- the zero based page number that the bookmark links to.
- Returns:
- a new child bookmark
 
 
-