Class FormFlattener
信息
表示 Documentize.FormFlattener 插件。用于在 PDF 文档中扁平化字段。
[Obsolete("The class will be deleted soon. Please use PdfForm class.")]
public static class FormFlattener继承
继承成员
- object.GetType(),
- object.MemberwiseClone(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
示例
该示例演示如何在 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)参数
pathstring: PDF 文档的路径。
返回值
PDF 文档中字段名称的列表。
GetFieldNames(Stream)
获取 PDF 文档中的字段名称。
public static List<string> GetFieldNames(Stream stream)参数
streamStream: 包含 PDF 文档的流。
返回值
PDF 文档中字段名称的列表。
Process(FlattenFieldsOptions)
在 PDF 文档中扁平化表单字段。
public static ResultContainer Process(FlattenFieldsOptions options)参数
optionsFlattenFieldsOptions: 包含操作指令的选项对象。
返回值
ResultContainer : 包含操作结果的对象。
异常
如果未设置 options。
Namespace: Documentize Assembly: Documentize.dll