Normally when verifying that a PDF is PDF/A compliant, the verification process will check that the document has the correct conformance and version tags saved in the XML metadata of the document.

We’ve been asked by customers to add an option in Qoppa PDF library jPDFPreflight to ignore these tags when verifying PDF/A documents. The verification process will perform all the standards tests and validation to make sure that the PDF is PDF/A compliant but will ignore the tags set in the XMP metadata within the PDF document.

This is the method that we’ve added to the jPDFPreflight API in v2016R1.07, available in all the PDF/A verification profiles: PDFA_1_B_Verification, PDFA_2_B_Verification, and PDFA_3_B_Verification:

// set option to accept any version and conformance tags 
// for this verification profile
pdfa_3_b_verification.setAcceptAnyVersionAndConformanceTags(true);

When this option is set to true, jPDFPreflight will not look at the PDF/A entries in the XMP metadata when using the PDF/A profile validation.

Here is a full sample code:

// create a PDFPreflight object
PDFPreflight pdfPreflight = new PDFPreflight("C:\\input.pdf", null);
// create a PDF A 3B Verification Profile
PDFA_3_B_Verification profile = new PDFA_3_B_Verification();
// set option to accept any version and conformance tags
profile.setAcceptAnyVersionAndConformanceTags(true);
// Validate the document
PreflightResults results = pdfPreflight.verifyDocument(profile, null);
// case where the document is PDF/A compliant
if (results.isSuccessful())
{
       System.out.println("PDF is compliant");
}
// case where the document is not PDF/A compliant
else
{
       System.out.println("PDF is not compliant");
       // Add annotations to the document
       results.addResultAnnotations();
       // Append report to the document
        results.appendPreflightReport(612, 792);
       // Save the PDF document with annotations and report
       pdfPreflight.saveDocument("C:\\validationreport.pdf"); 
}