Class PdfForm
Represents Documentize.PdfForm plugin. Used to Flatten, Extract Forms Data. Also allows you to Get Fields Names.
Represents Documentize.PdfForm plugin. Used to Flatten, Extract Forms Data. Also allows you to Get Fields Names.
public static class PdfFormInheritance
Inherited Members
- object.GetType(),
- object.MemberwiseClone(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
Methods
Extract(ExtractFormDataToDsvOptions)
Extract Form Data from PDF document.
public static ResultContainer Extract(ExtractFormDataToDsvOptions options)Parameters
optionsExtractFormDataToDsvOptions: An options object containing instructions for the operation.
Returns
ResultContainer : An object containing the result of the operation.
Examples
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 FileData("path_to_your_pdf_file.pdf"));
// Set output file path
options.AddOutput(new FileData("path_to_result_csv_file.csv"));
// Perform the process
PdfForm.Extract(options);The example demonstrates how to Export Form values to TSV file and set Properties.
// Create ExtractFormDataToDsvOptions object to set instructions
var options = new ExtractFormDataToDsvOptions();
//Set Delimiter
options.Delimiter = '\t';
//Add Field Names to result
options.AddFieldName = true;
// Add input file path
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
// Set output file path
options.AddOutput(new FileData("path_to_result_csv_file.tsv"));
// Perform the process
PdfForm.Extract(options);Exceptions
If options not set.
Flatten(FlattenFieldsOptions)
Flatten fields in PDF document.
public static ResultContainer Flatten(FlattenFieldsOptions options)Parameters
optionsFlattenFieldsOptions: An options object containing instructions for the operation.
Returns
ResultContainer : An object containing the result of the operation.
Examples
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 FileData("path_to_your_pdf_file.pdf"));
// Set output file path
options.AddOutput(new FileData("path_to_result_pdf_file.pdf"));
// Perform the process
PdfForm.Flatten(options);The example demonstrates how to Flatten fields in PDF file and skip first field.
// Get Fields Names
var fieldNames = PdfForm.GetNames(new GetFieldNamesOptions("path_to_your_pdf_file.pdf"));
// Create FlattenFieldsOptions object to set instructions
var options = new FlattenFieldsOptions();
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
options.AddOutput(new FileData("path_to_result_pdf_file.pdf"));
// Skip 1 field.
options.SkipFields.Add(fieldNames[0]);
// Perform the process
PdfForm.Flatten(options);Exceptions
If options not set.
GetNames(GetFieldNamesOptions)
Get field Names in PDF document.
public static List<string> GetNames(GetFieldNamesOptions options)Parameters
optionsGetFieldNamesOptions: An options object containing instructions for the operation.
Returns
List of names in PDF document.
Examples
The example demonstrates how to Get field Names from PDF file.
// Get Field Names
var fieldNames = PdfForm.GetNames(new GetFieldNamesOptions("path_to_your_pdf_file.pdf"));Remove(RemoveFieldsOptions) : Remove Fields from PDF document.
public static ResultContainer Remove(RemoveFieldsOptions options)Parameters
optionsRemoveFieldsOptions: An options object containing instructions for the operation.
Returns
ResultContainer : An object containing the result of the operation.
Examples
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 FileData("path_to_your_pdf_file.pdf"));
// Set output file path
options.AddOutput(new FileData("path_to_result_pdf_file.pdf"));
// Perform the process
PdfForm.Remove(options);Exceptions
If options not set.
Namespace: Documentize Assembly: Documentize.dll