PdfBookmarkEditor

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

NameTypeAccessDescription
documentDocumentReadReturns the bound document, or {@code null}.

Methods

SignatureDescription
PdfBookmarkEditor()Creates a new {@code PdfBookmarkEditor} instance.
PdfBookmarkEditor(document: Document)Creates a new editor bound to {@code document}.
getDocument()DocumentReturns the bound document, or {@code null}.
bindPdf(inputFile: String)booleanBinds a PDF file to this editor.
bindPdf(inputStream: InputStream)booleanBinds a PDF from an input stream.
bindPdf(document: Document)booleanBinds an existing {@link Document} to this editor.
save(outputFile: String)booleanSaves the bound document to a file.
save(outputStream: OutputStream)booleanSaves 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()BookmarksExtracts 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)BookmarksExtracts bookmarks matching the specified title from the bound document.
createBookmarkOfPage(title: String, pageNumber: int)booleanCreates a bookmark pointing to the specified page and adds it to the document outlines.
deleteBookmarks()booleanDeletes all bookmarks from the document.
deleteBookmarks(title: String)booleanDeletes bookmarks with the specified title.
close()Closes the editor and releases the bound document.

See Also