Class FormFlattener

信息

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

[Obsolete("The class will be deleted soon. Please use PdfForm class.")]
public static class FormFlattener

继承

objectFormFlattener

继承成员

示例

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

// Create FormFlattenerOptions object to set instructions
var options = new FormFlattenerOptions();
// Add input file path
options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
// Set output file path
options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf"));
// Perform the process
FormFlattener.Process(options);

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

// Get Fields Names
var fieldNames = FormFlattener.GetFieldNames("path_to_your_pdf_file.pdf");
// Create FormFlattenerOptions object to set instructions
var options = new FormFlattenerOptions();
options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf"));
// Skip 1 field.
options.SkipFields.Add(fieldNames[0]);
// Perform the process
FormFlattener.Process(options);

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

// Get Fields Names
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(FlattenFieldsOptions)

在 PDF 文档中扁平化表单字段。

public static ResultContainer Process(FlattenFieldsOptions options)

参数

返回值

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

异常

ArgumentException

如果未设置 options。

Namespace: Documentize Assembly: Documentize.dll

 中文