v25.12
New plugin PDF Form
- Class PdfForm: contains all functions of plugins: FormFlattener, FormExporter. Also allows you to delete and get fields.
- Class FormFlattener: will be deleted soon, use PdfForm.
- Class FormFlattenerOptions: renamed to Class FlattenFieldsOptions.
- Class GetFieldNamesOptions: allows to set options for getting field names.
- Class RemoveFieldsOptions: allows to set options for remove fields.
- See The New Plugin Architecture.
Example Usage:
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);Example Usage:
The example demonstrates how to Get field Names from PDF file.
var fieldNames = PdfForm.GetNames(new GetFieldNamesOptions("path_to_your_pdf_file.pdf"));Example Usage:
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);Example Usage:
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);Changes in PDF Extractor
- Method ExtractText: renamed to Method Extract.
- Method ExtractImages: renamed to Method Extract.
- Method ExtractFormData: renamed to Method Extract.
Example Usage:
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();Example Usage:
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();Example Usage:
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);Enhancements
- Class PdfConverterOptions, PdfToXlsOptions - use Class PluginBaseOptions
- PDF/A-1b conversion
- PDF/A-2b conversion
Fixed Bugs
- Fixed HTML to PDF Conversion formatting issues
- PDF to HTML conversion lost some links