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 Summary
Constructors -
Method Summary
Modifier 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
-
Bookmark
public 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 bookmarkpageIndex- 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 bookmarknextBookmarkText- 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
-
getDestinationType
Gets destination type. Type of destination represented by the bookmark.- Returns:
- the destination type
-
getNextBookmarkText
Gets 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
-
getPageIndex
public final int getPageIndex()Gets page index. The zero based page number that the bookmark links to.- Returns:
- the page index
-
getBookmarkManager
Gets bookmark manager.BookmarkManager- Returns:
- the bookmark manager
-
addNextBookmark
Add a new bookmark after this bookmark- Parameters:
text- the display text of the bookmarkpageIndex- the zero based page number that the bookmark links to.
-
getParentBookmarkText
Gets parent bookmark text. The text of parent bookmark which contains this bookmark. Null if it is root bookmark.- Returns:
- the parent bookmark text
-
getText
Gets text. The display text of the bookmark.- Returns:
- the text
-
setText
Sets text. The display text of the bookmark- Parameters:
value- the value
-
AddPreviousBookmark
Add a new bookmark before this bookmark- Parameters:
text- the display text of the bookmarkpageIndex- the zero based page number that the bookmark links to.
-
getPreviousBookmarkText
Gets previous bookmark text. Previous bookmark at the current level, if any. Null if it is first bookmark.- Returns:
- the previous bookmark text.
-
AddChildBookmark
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 of the bookmarkpageIndex- the zero based page number that the bookmark links to.- Returns:
- a new child bookmark
-