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
| Name | Type | Access | Description |
|---|---|---|---|
document | Document | Read | Returns the bound document. |
Methods
| Signature | Description |
|---|---|
PdfAnnotationEditor() | Creates a new {@code PdfAnnotationEditor} instance. |
PdfAnnotationEditor(document: Document) | Creates a new {@code PdfAnnotationEditor} bound to the specified document. |
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. |
flattenAnnotations() → boolean | Flattens all annotations in the document. |
deleteAnnotations() → boolean | Deletes all annotations from all pages in the document. |
deleteAnnotations(annotationType: String) → boolean | Deletes annotations of the specified type from all pages. |
getAnnotationCount(pageNumber: int) → int | Returns 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) → boolean | Saves the bound document to a file. |
save(outputStream: OutputStream) → boolean | Saves 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() → Document | Returns the bound document. |
close() | Closes the editor and releases the bound document. |