Class PdfAConverter
Info
Represents a plugin for handling the conversion of PDF documents in a PDF/A format and for validation of the PDF/A conformance.
public static class PdfAConverter
Inheritance
Inherited Members
- object.GetType(),
- object.MemberwiseClone(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
Examples
The example demonstrates how to convert the PDF document in a PDF/A format (PDF/A-3b in this case):
// Create the options class to set up the conversion process
var options = new PdfAConvertOptions
{
PdfAVersion = PdfAStandardVersion.PDF_A_3B
};
// Add the source file
options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf")); // replace with your actual file path
// Add the path to save the converted file
options.AddOutput(new FileDataSource("path_to_the_converted_file.pdf"));
// Run the conversion
PdfAConverter.Process(options);
The example demonstrates how to validate the PDF document conformance to PDF/A format (PDF/A-1a in this case):
// Create the options class to set up the validation process
var options = new PdfAValidateOptions
{
PdfAVersion = PdfAStandardVersion.PDF_A_1A
};
// Add one or more files to be validated
options.AddInput(new FileDataSource("path_to_your_first_pdf_file.pdf")); // replace with your actual file path
options.AddInput(new FileDataSource("path_to_your_second_pdf_file.pdf"));
// add more files as needed
// Run the validation and get results
var resultContainer = PdfAConverter.Process(options);
// Check the resultContainer.ResultCollection property for validation results for each file:
for (var i = 0; i < resultContainer.ResultCollection.Count; i++)
{
var result = resultContainer.ResultCollection[i];
var validationResult = (PdfAValidationResult) result.Data;
var isValid = validationResult.IsValid; // Validation result for the i-th document
}
Methods
Process(PdfAConvertOptions)
Converts PDF document into PDF/A format.
public static ResultContainer Process(PdfAConvertOptions options)
Parameters
options
PdfAConvertOptions: An options object containing instructions for the operation.
Returns
ResultContainer : An object containing the result of the operation.
Exceptions
If options not set.
Process(PdfAValidateOptions)
Check PDF document for compliance with specified format PDF/A.
public static ResultContainer Process(PdfAValidateOptions options)
Parameters
options
PdfAValidateOptions: An options object containing instructions for the operation.
Returns
ResultContainer : An object containing the result of the operation.
Exceptions
If options not set.
Namespace: Documentize Assembly: Documentize.dll