PdfAnnotationEditor
Overview
PdfAnnotationEditor is a class in Aspose.PDF FOSS for .NET.
Inherits from: IDisposable.
Facade for annotation manipulation: import/export XFDF, delete, flatten, redact.
This class provides 39 methods for working with PdfAnnotationEditor objects in .NET programs.
Available methods include: BindPdf, Close, DeleteAnnotation, DeleteAnnotations, Dispose, ExportAnnotationsToXfdf, ExportAnnotationsXfdf, ExtractAnnotations, FlatteningAnnotations, ImportAnnotationFromXfdf, ImportAnnotations, ImportAnnotationsFromFdf, and 6 additional methods.
All public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package.
Properties: Document.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
Document | Document | Read | The bound document. |
Methods
| Signature | Description |
|---|---|
PdfAnnotationEditor() | Create an unbound PdfAnnotationEditor. |
PdfAnnotationEditor(document: Document) | Create a PdfAnnotationEditor bound to a Document. |
BindPdf(path: string) | Bind PDF from a file path. |
BindPdf(input: byte[]) | Bind PDF from a byte array. |
BindPdf(input: Stream) | Bind PDF from a stream. |
BindPdf(document: Document) | Bind an existing Document instance. |
ExtractAnnotations(start: int, end: int, annotTypes: Aspose.Pdf.Annotations.AnnotationType[]) | Returns annotations on pages startPage through endPage (1-based, inclusive) whose type appears in annotTypes. |
ExtractAnnotations(start: int, end: int, annotTypes: string[]) | Extract annotations across a page range filtered by Subtype name strings. |
DeleteAnnotations() | Delete all annotations from all pages (excluding Widget/form field annotations). |
DeleteAnnotations(annotType: string) | Delete annotations of a specific subtype name from all pages. |
DeleteAnnotation(annotName: string) | Delete annotation by name (NM entry) across all pages. |
FlatteningAnnotations() | Flatten all annotations — removes them from the annotation list. |
RedactArea(pageIndex: int, rect: Rectangle, color: double[]) | Redact an area on a page: adds a redaction annotation with the given fill color, then flattens the redaction (removes the annotation). |
RedactArea(pageIndex: int, rect: Rectangle, r: int, g: int, b: int) | Redact an area on a page with a System.Drawing.Color-compatible (R, G, B) color. |
RedactArea(pageIndex: int, rect: Rectangle, color: System.Drawing.Color) | Redact an area on a page with the given fill color. |
ImportAnnotationsFromXfdf(xfdfStream: Stream) | Import annotations from an XFDF stream into the bound document. |
ImportAnnotationsFromXfdf(xfdfFile: string) | Import annotations from an XFDF file path. |
ImportAnnotationFromXfdf(xfdfStream: Stream, annotType: AnnotationType[]) | Import annotations from XFDF with type filter. |
ImportAnnotationFromXfdf(xfdfFile: string, annotType: AnnotationType[]) | Import annotations from an XFDF file path with type filter. |
ExportAnnotationsXfdf(xmlOutputStream: Stream, start: int, end: int, annotTypes: AnnotationType[]) | Export annotations to an XFDF stream. |
ImportAnnotations(annotFileStream: Stream[]) | Import annotations from other PDF streams into the bound document. |
Save() | Save the document to a byte array. |
Save(path: string) | Save the document to a file path. |
Save(output: Stream) | Save the document to a stream. |
Close() | Close the editor and release the document. |
Dispose() | Dispose — same as Close. |
ExportAnnotationsToXfdf(xmlOutputStream: Stream) | Export every annotation in the bound document to an XFDF stream. |
ExportAnnotationsXfdf(xmlOutputStream: Stream, start: int, end: int, annotTypes: string[]) | Export annotations filtered by Subtype name strings. |
FlatteningAnnotations(flattenSettings: Aspose.Pdf.Forms.Form.FlattenSettings) | Flatten every annotation using the supplied form-flatten settings. |
FlatteningAnnotations(start: int, end: int, annotType: AnnotationType[]) | Flatten annotations across a page range filtered by type. |
ImportAnnotationFromXfdf(xfdfStream: Stream) | Import annotations from an XFDF stream (every annotation type). |
ImportAnnotationFromXfdf(xfdfFile: string) | Import annotations from an XFDF file (every annotation type). |
ImportAnnotations(annotFileStream: Stream[], annotType: AnnotationType[]) | Import annotations from PDF streams filtered by type. |
ImportAnnotations(annotFile: string[]) | Import annotations from PDF files at the given paths. |
ImportAnnotations(annotFile: string[], annotType: AnnotationType[]) | Import annotations from PDF files filtered by type. |
ImportAnnotationsFromFdf(fdfFile: string) | Import annotations from an FDF file. |
ModifyAnnotations(start: int, end: int, annotation: Aspose.Pdf.Annotations.Annotation) | Modify annotations across a page range to look like annotation. |
ModifyAnnotations(start: int, end: int, annotType: System.Enum, annotation: Aspose.Pdf.Annotations.Annotation) | Modify annotations of the supplied type across a page range. |
ModifyAnnotationsAuthor(start: int, end: int, srcAuthor: string, desAuthor: string) | Rewrite the author of every annotation matching srcAuthor across the page range. |