PdfAnnotationEditor

PdfAnnotationEditor

Overview

PdfAnnotationEditor is a class in Aspose.Pdf FOSS for Java.

Provides methods for managing annotations in a PDF document: flattening, deleting, and counting annotations.

Properties

NameTypeAccessDescription
documentDocumentReadReturns the bound document.

Methods

SignatureDescription
PdfAnnotationEditor()Creates a new {@code PdfAnnotationEditor} instance.
PdfAnnotationEditor(document: Document)Creates a new {@code PdfAnnotationEditor} bound to the specified document.
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.
flattenAnnotations()booleanFlattens all annotations in the document.
deleteAnnotations()booleanDeletes all annotations from all pages in the document.
deleteAnnotations(annotationType: String)booleanDeletes annotations of the specified type from all pages.
getAnnotationCount(pageNumber: int)intReturns the number of annotations on the specified page.
modifyAnnotationsAuthor(startPage: int, endPage: int, oldAuthor: String, newAuthor: String)Renames the author (the annotation’s /T entry) on every markup
annotation in the inclusive page range [startPage, endPage] whose
current author equals {@code oldAuthor}.
save(outputFile: String)booleanSaves the bound document to a file.
save(outputStream: OutputStream)booleanSaves the bound document to an output stream.
exportAnnotationsXfdf(stream: OutputStream, startPage: int, endPage: int, annotTypes: AnnotationType[])Exports annotations to XFDF format, optionally filtering by page range and type.
importAnnotationFromXfdf(stream: InputStream, annotTypes: AnnotationType[])Imports annotations from an XFDF input stream.
importAnnotationFromXfdf(stream: InputStream)Imports annotations from an XFDF input stream (all types).
importAnnotationFromXfdf(filePath: String)Imports annotations from an XFDF file (all types).
importAnnotationsFromXfdf(filePath: String)Imports annotations from an XFDF file (all types).
importAnnotationsFromXfdf(stream: InputStream)Imports annotations from an XFDF input stream (all types).
importAnnotationsFromXfdf(stream: InputStream, annotTypes: AnnotationType[])Imports annotations from an XFDF input stream with type filtering.
getDocument()DocumentReturns the bound document.
close()Closes the editor and releases the bound document.

See Also