PDF 转 PDF/A
The Documentize PDF Converter for .NET is a powerful tool designed to convert PDF documents into the PDF/A format, ensuring that your content remains compliant with long-term archiving standards. This component also supports validating existing PDF documents for PDF/A compliance, offering both conversion and validation features in a single solution.
如何将 PDF 转换为 PDF/A
To convert a PDF document into PDF/A format, follow these steps:
- Create an instance of
PdfToPdfAOptionsto configure the conversion. - Specify the desired PDF/A version (e.g., PDF/A-3B).
- Add the input PDF file using the
AddInputmethod. - Add the output file for the resulting PDF/A using the
AddOutputmethod. - Call the
Convertmethod to execute the conversion.
1// Create the options class to set up the conversion process
2var options = new PdfToPdfAOptions
3{
4 PdfAVersion = PdfAStandardVersion.PDF_A_3B
5};
6
7// Add the source file
8options.AddInput(new FileData("path_to_your_pdf_file.pdf")); // replace with your actual file path
9
10// Add the path to save the converted file
11options.AddOutput(new FileData("path_to_the_converted_file.pdf"));
12
13// Run the conversion
14PdfConverter.Convert(options);验证 PDF/A 合规性
You can validate existing PDF files for PDF/A compliance using the PdfAValidateOptions class.
1// Create the options class to set up the validation process
2var options = new PdfAValidateOptions
3{
4 PdfAVersion = PdfAStandardVersion.PDF_A_1A
5};
6
7// Add one or more files to be validated
8options.AddInput(new FileData("path_to_your_first_pdf_file.pdf")); // replace with your actual file path
9options.AddInput(new FileData("path_to_your_second_pdf_file.pdf"));
10// add more files as needed
11
12// Run the validation and get results
13var resultContainer = PdfConverter.Validate(options);
14
15// Check the resultContainer.ResultCollection property for validation results for each file:
16foreach (var result in resultContainer.ResultCollection)
17{
18 var validationResult = (PdfAValidationResult) result.Data;
19 var isValid = validationResult.IsValid; // Validation result for document
20}关键特性:
- Convert to PDF/A: Seamlessly transform PDF files into the PDF/A format (such as PDF/A-1a, PDF/A-2b, PDF/A-3b) to ensure compliance with archiving standards.
- Validate PDF/A Compliance: Check existing PDF documents for conformance with PDF/A standards and identify issues if they do not comply.
- Efficient Workflow: Minimize time and effort with fast and reliable conversion processes.