public class BookmarkManager extends Object
PdfDocument
outline.
Bookmarks are arranged and navigated in a parent/child node hierarchy, similar to an HTML DOM.
See: PdfDocument.getBookmark()
See: Bookmark
Constructor and Description |
---|
BookmarkManager(InternalPdfDocument internalPdfDocument)
Please get BookmarkManager by
PdfDocument.getBookmark() instead. |
Modifier and Type | Method and Description |
---|---|
void |
addBookMarkAtEnd(String text,
int pageIndex)
Add a new bookmark at the end of the bookmark collection
|
void |
addBookMarkAtStart(String text,
int pageIndex)
Add a new bookmark at the start of the document collection
|
Bookmark |
addChildBookmark(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 list
|
int |
getCount()
Total number of bookmarks, including all nested bookmarks
|
void |
insertBookmark(Bookmark bookmark)
Insert a new bookmark
|
void |
insertBookmark(String text,
int pageIndex,
String parentText,
String previousText)
Insert a new bookmark
|
public BookmarkManager(InternalPdfDocument internalPdfDocument)
PdfDocument.getBookmark()
instead.internalPdfDocument
- the internal pdf documentpublic final int getCount()
public final List<Bookmark> getBookmarks()
public final void addBookMarkAtEnd(String text, int pageIndex)
text
- The display text for the link.pageIndex
- The zero based page number to link to. E.g. Page 1 has a PageIndex of 0public final void addBookMarkAtStart(String text, int pageIndex)
text
- The display text for the link.pageIndex
- The zero based page number to link to. E.g. Page 1 has a PageIndex of 0public final void insertBookmark(String text, int pageIndex, String parentText, String previousText)
text
- The display text for the link.pageIndex
- The zero based page number to link to. E.g. Page 1 has a
PageIndex of 0parentText
- parent bookmark text. set to null for insert at the toppreviousText
- previous bookmark text. set to null for insert at first of its
siblingspublic final void insertBookmark(Bookmark bookmark)
bookmark
- a bookmark object.public final Bookmark addChildBookmark(String text, int pageIndex, String parentBookmarkText)
text
- The display text for the link.pageIndex
- The zero based page number to link to. E.g. Page 1 has a PageIndex of 0parentBookmarkText
- bookmark parent text, set empty if bookmark does not have parent.Copyright © 2022–2023 Iron Software. All rights reserved.