PdfBookmarkEditor
Overview
PdfBookmarkEditor is a class in Aspose.Pdf FOSS for Java.
Inherits from: AutoCloseable.
Provides methods for creating, extracting, and deleting bookmarks (outlines) in a PDF document.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
document | Document | Read | Returns the bound document, or {@code null}. |
Methods
| Signature | Description |
|---|---|
PdfBookmarkEditor() | Creates a new {@code PdfBookmarkEditor} instance. |
PdfBookmarkEditor(document: Document) | Creates a new editor bound to {@code document}. |
getDocument() → Document | Returns the bound document, or {@code null}. |
bindPdf(inputFile: String) → boolean | Binds a PDF file to this editor. |
bindPdf(inputStream: InputStream) → boolean | Binds a PDF from an input stream. |
bindPdf(document: Document) → boolean | Binds an existing {@link Document} to this editor. |
save(outputFile: String) → boolean | Saves the bound document to a file. |
save(outputStream: OutputStream) → boolean | Saves the bound document to an output stream. |
exportBookmarksToXML(xmlFile: String) | Exports the document’s bookmark tree to an XML file. |
importBookmarksWithXML(xmlFile: String) | Imports a bookmark tree previously written by |
| {@link #exportBookmarksToXML(String)} and adds it to the bound document’s | |
| outline. | |
extractBookmarks() → Bookmarks | Extracts bookmarks matching the specified title from the bound document. |
createBookmarks() | Creates bookmarks for all pages in the document. |
createBookmarks(color: Color, bold: boolean, italic: boolean) | Creates bookmarks for all pages with specified visual properties. |
extractBookmarks(title: String) → Bookmarks | Extracts bookmarks matching the specified title from the bound document. |
createBookmarkOfPage(title: String, pageNumber: int) → boolean | Creates a bookmark pointing to the specified page and adds it to the document outlines. |
deleteBookmarks() → boolean | Deletes all bookmarks from the document. |
deleteBookmarks(title: String) → boolean | Deletes bookmarks with the specified title. |
close() | Closes the editor and releases the bound document. |