从 PDF 到 XFDF 的扁平化注释

Contents
[ ]

扁平化过程意味着当注释从文档中移除时,其视觉表现保持不变。扁平化的注释仍然可见,但不再可由您的用户或您的应用编辑。这可以用于,例如,永久性地将注释应用于您的文档,或使注释对无法显示注释的查看者可见。如果未指定,导出将保持所有注释原样。

选择此选项时,您的注释将作为 PDF 标准注释包含在导出的 PDF 中。

查看下一个代码片段中使用的 flatteningAnnotations 方法。

// For complete examples and data files, visit https://github.com/aspose-pdf/Aspose.PDF-for-.NET
private static void FlattenAnnotationFromPdf()
{
    // The path to the documents directory
    var dataDir = RunExamples.GetDataDir_AsposePdfFacades_Annotations();

    // Create PdfAnnotationEditor
    using (var annotationEditor = new Aspose.Pdf.Facades.PdfAnnotationEditor())
    {
        // Bind PDF document
        annotationEditor.BindPdf(dataDir + "AnnotationsInput.pdf");
        // Create FlattenSettings
        var flattenSettings = new Aspose.Pdf.Forms.Form.FlattenSettings
        {
            ApplyRedactions = true,
            CallEvents = false,
            HideButtons = true,
            UpdateAppearances = true
        };
        annotationEditor.FlatteningAnnotations(flattenSettings);
        // Save PDF document
        annotationEditor.Save(dataDir + "FlattenAnnotation_out.pdf");
    }
}