v25.12

新插件 PDF Form

  • Class PdfForm:包含插件的所有功能:FormFlattener、FormExporter。还支持删除和获取字段。
  • Class FormFlattener:很快将被删除,请使用 PdfForm
  • Class FormFlattenerOptions:已重命名为 Class FlattenFieldsOptions
  • Class GetFieldNamesOptions:允许设置获取字段名称的选项。
  • Class RemoveFieldsOptions:允许设置删除字段的选项。
  • See The New Plugin Architecture

示例用法:

The example demonstrates how to Flatten fields in PDF file.

// Create FlattenFieldsOptions object to set instructions
var options = new FlattenFieldsOptions();
// 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
PdfForm.Flatten(options);

示例用法:

The example demonstrates how to Get field Names from PDF file.

var fieldNames = PdfForm.GetNames(new GetFieldNamesOptions("path_to_your_pdf_file.pdf"));

示例用法:

The example demonstrates how to Export Form values to CSV file.

// Create ExtractFormDataToDsvOptions object to set instructions
var options = new ExtractFormDataToDsvOptions(',', true);
// 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_csv_file.csv"));
// Perform the process
PdfForm.Extract(options);

示例用法:

The example demonstrates how to Remove fields from PDF file.

// Create RemoveFieldsOptions object to set instructions
var options = new RemoveFieldsOptions();
// 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
PdfForm.Remove(options);

PDF 提取器的更改

  • Method ExtractText:已重命名为 Method Extract
  • Method ExtractImages:已重命名为 Method Extract
  • Method ExtractFormData:已重命名为 Method Extract

示例用法:

The example demonstrates how to extract text content of PDF document.

// Create ExtractTextOptions object to set instructions
var options = new ExtractTextOptions();
// Add input file path
options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
// Perform the process
var results = PdfExtractor.Extract(options);
// Get the extracted text from the ResultContainer object
var textExtracted = results.ResultCollection[0].ToString();

示例用法:

The example demonstrates how to extract images from PDF document.

// Create ExtractImagesOptions to set instructions
var options = new ExtractImagesOptions();
// Add input file path
options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
// Set output Directory path
options.AddOutput(new DirectoryDataSource("path_to_results_directory"));
// Perform the process
var results = PdfExtractor.Extract(options);
// Get path to image result
var imageExtracted = results.ResultCollection[0].ToFile();

示例用法:

The example demonstrates how to Export Form values to CSV file.

// Create ExtractFormDataToDsvOptions object to set instructions
var options = new ExtractFormDataToDsvOptions(',', true);
// 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_csv_file.csv"));
// Perform the process
PdfExtractor.Extract(options);

改进

  • Class PdfConverterOptions,PdfToXlsOptions - 使用 Class PluginBaseOptions
  • PDF/A-1b 转换
  • PDF/A-2b 转换

已修复的错误

  • 修复了 HTML 转 PDF 转换的格式问题
  • PDF 转 HTML 转换时丢失了一些链接
2026年1月19日
 中文