Class FormFlattener

信息

表示 Documentize.FormFlattener 插件。用于扁平化 PDF 文档中的字段。

public static class FormFlattener

继承

objectFormFlattener

继承成员

示例

该示例演示了如何扁平化 PDF 文件中的字段。

// 创建 FormFlattenerOptions 对象以设置指令
var options = new FormFlattenerOptions();
// 添加输入文件路径
options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
// 设置输出文件路径
options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf"));
// 执行处理
FormFlattener.Process(options);

该示例演示如何扁平化 PDF 文件中的字段并跳过第一个字段。

// 获取字段名称
var fieldNames = FormFlattener.GetFieldNames("path_to_your_pdf_file.pdf");
// 创建 FormFlattenerOptions 对象以设置指令
var options = new FormFlattenerOptions();
options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf"));
// 跳过1个字段。
options.SkipFields.Add(fieldNames[0]);
// 执行处理
FormFlattener.Process(options);

该示例演示如何从 PDF 文件中获取字段名称。

// 获取字段名称
var fieldNames = FormFlattener.GetFieldNames("path_to_your_pdf_file.pdf");

方法

GetFieldNames(string)

获取 PDF 文档中的字段名称。

public static List<string> GetFieldNames(string path)

参数

  • path string: PDF 文档的路径。

返回

List<string>

PDF 文档中的名称列表。

GetFieldNames(Stream): 获取 PDF 文档中的字段名称。

public static List<string> GetFieldNames(Stream stream)

参数

  • stream Stream: 包含 PDF 文档的流。

返回

List<string>

PDF 文档中的名称列表。

Process(FormFlattenerOptions): 在 PDF 文档中扁平化表单字段。

public static ResultContainer Process(FormFlattenerOptions options)

参数

返回

ResultContainer: 一个包含操作结果的对象。

异常

ArgumentException

如果未设置选项。

命名空间: Documentize 程序集: Documentize.dll

 中文