Convert PDF to PDF/A
How to Convert PDF to PDF/A Documents
Use Adobe PDF Library to convert PDF files to PDF/A for archiving and long-term storage, ensuring all metadata, graphics and text file formatting stays intact. PDF/A supports embedded digital signatures to safeguard file integrity. Adobe PDF Library creates PDF/A documents that conform to ZUGFeRD document standards.
Get Free Trial
C++
C#
Java
C++
DURING
APDFLDoc inAPDoc(csInputFileName.c_str(), true); // Open the input document, repairing it if necessary.
destFilePath =
ASFileSysCreatePathName(NULL, ASAtomFromString("Cstring"), csOutputFileName.c_str(), NULL);
gPDFProcessorHFT = InitPDFProcessorHFT;
if (PDFProcessorInitialize()) {
ASInt32 res = false;
//Initialize the Conversion Parameters:
PDFProcessorPDFAConvertParamsRec userParams;
memset(&userParams, 0x0, sizeof(PDFProcessorPDFAConvertParamsRec));
userParams.size = sizeof(PDFProcessorPDFAConvertParamsRec);
userParams.noValidationErrors = true;
res = PDFProcessorConvertAndSaveToPDFA(inAPDoc.getPDDoc(), destFilePath,
ASGetDefaultFileSys(), kPDFProcessorConvertToPDFA3uRGB, &userParams);
}
HANDLER
errCode = ERRORCODE;
lib.displayError(errCode);
END_HANDLER
// Terminate PDFProcessor plugin
PDFProcessorTerminate();
C#
using (var doc = new Document(sInput))
{
// Make a conversion parameters object
PDFAConvertParams pdfaParams = new PDFAConvertParams()
{
ValidateImplementationLimitsOfDocument = true,
};
// Create a PDF/A compliant version of the document
PDFAConvertResult pdfaResult = doc.CloneAsPDFADocument(PDFAConvertType.RGB3u, pdfaParams);
// The conversion may have failed: we must check if the result has a valid Document
if (pdfaResult.PDFADocument != null)
{
//Save the result.
pdfaResult.PDFADocument.Save(pdfaResult.PDFASaveFlags, sOutput);
}
}
Java
Document doc = new Document(sInput);
// Make a conversion parameters object
PDFAConvertParams pdfaParams = new PDFAConvertParams()
{{
setValidateImplementationLimitsOfDocument(true);
}};
// Create a PDF/A compliant version of the document
PDFAConvertResult pdfaResult = doc.cloneAsPDFADocument(PDFAConvertType.RGB_3U, pdfaParams);
// The conversion may have failed: we must check if the result has a valid Document
if (pdfaResult.getPDFADocument() != null)
//Save the result.
pdfaResult.getPDFADocument().save(pdfaResult.getPDFASaveFlags(), sOutput);
}
doc.delete();