PdfAnnotationEditor
概述
PdfAnnotationEditor 是 Aspose.PDF FOSS 中用于 .NET 的一个类。继承自:IDisposable。
用于注释操作的外观:导入/导出 XFDF、删除、扁平化、遮蔽。
此类提供 39 个方法,用于在 .NET 程序中处理 PdfAnnotationEditor 对象。可用的方法包括:BindPdf、Close、DeleteAnnotation、DeleteAnnotations、Dispose、ExportAnnotationsToXfdf、ExportAnnotationsXfdf、ExtractAnnotations、FlatteningAnnotations、ImportAnnotationFromXfdf、ImportAnnotations、ImportAnnotationsFromFdf,以及另外 6 个方法。安装 Aspose.PDF FOSS for .NET 包后,所有公共成员对任何 .NET 应用程序均可访问。属性:Document。
属性
| 名称 | 类型 | 访问 | 描述 |
|---|---|---|---|
Document | Document | 读取 | 已绑定的文档。 |
方法
| 签名 | 描述 |
|---|---|
PdfAnnotationEditor() | 创建一个未绑定的 PdfAnnotationEditor。 |
PdfAnnotationEditor(document: Document) | 创建一个绑定到文档的 PdfAnnotationEditor。 |
BindPdf(path: string) | 从文件路径绑定 PDF。 |
BindPdf(input: byte[]) | 从字节数组绑定 PDF。 |
BindPdf(input: Stream) | 从流绑定 PDF。 |
BindPdf(document: Document) | 绑定现有的 Document 实例。 |
ExtractAnnotations(start: int, end: int, annotTypes: Aspose.Pdf.Annotations.AnnotationType[]) | 返回在页面 startPage 到 endPage(基于 1,包含)的注释,其类型出现在 annotTypes 中。 |
ExtractAnnotations(start: int, end: int, annotTypes: string[]) | 提取跨页面范围的注释,按 Subtype 名称字符串进行过滤。 |
DeleteAnnotations() | 删除所有页面中的所有注释(不包括 Widget/form field 注释)。 |
DeleteAnnotations(annotType: string) | 删除所有页面中特定 subtype 名称的注释。 |
DeleteAnnotation(annotName: string) | 删除所有页面中按名称(NM 条目)的批注。 |
FlatteningAnnotations() | 展平所有批注 — 将其从批注列表中移除。 |
RedactArea(pageIndex: int, rect: Rectangle, color: double[]) | 在页面上遮蔽一个区域:使用给定的填充颜色添加遮蔽批注,然后展平该遮蔽(移除批注)。 |
RedactArea(pageIndex: int, rect: Rectangle, r: int, g: int, b: int) | 使用与 System.Drawing.Color 兼容的 (R, G, B) 颜色在页面上遮蔽一个区域。 |
RedactArea(pageIndex: int, rect: Rectangle, color: System.Drawing.Color) | 使用给定的填充颜色对页面上的区域进行编辑遮蔽。 |
ImportAnnotationsFromXfdf(xfdfStream: Stream) | 从 XFDF 流导入批注到绑定文档中。 |
ImportAnnotationsFromXfdf(xfdfFile: string) | 从 XFDF 文件路径导入批注。 |
ImportAnnotationFromXfdf(xfdfStream: Stream, annotType: AnnotationType[]) | 使用类型过滤器从 XFDF 导入批注。 |
ImportAnnotationFromXfdf(xfdfFile: string, annotType: AnnotationType[]) | 从 XFDF 文件路径导入带类型过滤的批注。 |
ExportAnnotationsXfdf(xmlOutputStream: Stream, start: int, end: int, annotTypes: AnnotationType[]) | 将批注导出为 XFDF 流。 |
ImportAnnotations(annotFileStream: Stream[]) | 将其他 PDF 流中的批注导入到已绑定的文档。 |
Save() | 将文档保存为字节数组。 |
Save(path: string) | 将文档保存到文件路径。 |
Save(output: Stream) | 将文档保存到流中。 |
Close() | 关闭编辑器并释放文档。 |
Dispose() | Dispose — 与 Close 相同。 |
ExportAnnotationsToXfdf(xmlOutputStream: Stream) | 将绑定文档中的每个注释导出为 XFDF 流。 |
ExportAnnotationsXfdf(xmlOutputStream: Stream, start: int, end: int, annotTypes: string[]) | 导出按 Subtype 名称字符串过滤的注释。 |
FlatteningAnnotations(flattenSettings: Aspose.Pdf.Forms.Form.FlattenSettings) | 使用提供的 form-flatten 设置将所有注释扁平化。 |
FlatteningAnnotations(start: int, end: int, annotType: AnnotationType[]) | 在按类型过滤的页面范围内扁平化注释。 |
ImportAnnotationFromXfdf(xfdfStream: Stream) | 从 XFDF 流导入注释(所有注释类型)。 |
ImportAnnotationFromXfdf(xfdfFile: string) | 从 XFDF 文件导入注释(每种注释类型)。 |
ImportAnnotations(annotFileStream: Stream[], annotType: AnnotationType[]) | 从按类型过滤的 PDF 流中导入注释。 |
ImportAnnotations(annotFile: string[]) | 从给定路径的 PDF 文件中导入注释。 |
ImportAnnotations(annotFile: string[], annotType: AnnotationType[]) | 从按类型过滤的 PDF 文件中导入注释。 |
ImportAnnotationsFromFdf(fdfFile: string) | 从 FDF 文件导入批注。 |
ModifyAnnotations(start: int, end: int, annotation: Aspose.Pdf.Annotations.Annotation) | 修改跨页范围的批注,使其看起来像 annotation。 |
ModifyAnnotations(start: int, end: int, annotType: System.Enum, annotation: Aspose.Pdf.Annotations.Annotation) | 跨页范围内修改提供的类型的批注。 |
ModifyAnnotationsAuthor(start: int, end: int, srcAuthor: string, desAuthor: string) | 在跨页范围内,将所有匹配 srcAuthor 的批注的作者重写。 |