PDF/A-2B validation fail on Interpolate key(s)

Hi Aspose forum,

This post seems to touch on a similar issue: PDFA interpolate key problem

When attempting to convert certain PDFs (see attached in ZIP) to PDF/A-2B, they fail validation checks using VeraPDF as seen in an excerpt of the XML report below:

<validationReport jobEndStatus="normal" profileName="PDF/A-2B validation profile" statement="PDF file is not compliant with Validation Profile requirements." isCompliant="false">
        <details passedRules="141" failedRules="1" passedChecks="12257" failedChecks="2">
          <rule specification="ISO 19005-2:2011" clause="6.2.8" testNumber="3" status="failed" passedChecks="0" failedChecks="2">
            <description>If an Image dictionary contains the Interpolate key, its value shall be false. For an inline image, the I key shall have a value of false.</description>
            <object>PDXImage</object>
            <test>Interpolate == false</test>
            <check status="failed">
              <context>root/document[0]/pages[0](4 0 obj PDPage)/contentStream[0]/operators[3]/xObject[0](5 0 obj PDXImage)</context>
              <errorMessage>The value of the Interpolate key in the Image dictionary is true</errorMessage>
            </check>
            <check status="failed">
              <context>root/document[0]/pages[1](12 0 obj PDPage)/contentStream[0]/operators[3]/xObject[0](11 0 obj PDXImage)</context>
              <errorMessage>The value of the Interpolate key in the Image dictionary is true</errorMessage>
            </check>
          </rule>
        </details>
      </validationReport>
      <featuresReport>
        <informationDict>
          <entry key="Keywords"></entry>
          <entry key="Creator">Aspose Pty Ltd.</entry>
          <entry key="Producer">Aspose.PDF for .NET 25.2.0</entry>
          <entry key="CreationDate">2025-01-10T11:44:47.000Z</entry>
          <entry key="ModDate">2025-02-17T12:14:00.000Z</entry>
        </informationDict>
      </featuresReport>

As seen this has been tested on the latest release of Aspose.PDF for .NET. I have attached a very simple application: =
ReproduceAsposePdfaIssue.zip (208.2 KB) which can be used to reproduce the issue. The input path looks at C:\Test\ and the input.pdf file. Output is written in the same directory.
This zip file also contains the input and output file which was produced by running the program.

Note that I did not include the license or NuGet dependencies, so you need to add your license as ReproducePdfaIssue.Properties.Resources.Aspose_Total_NET and install the latest version of Aspose.PDF.

It would be great if this can be looked at as it is quite a common issue for me.

@frimbingpickering

It seems you are encountering an issue with the Interpolate key in images when converting PDFs to PDF/A-2B format. The validation report indicates that the Interpolate key is set to true, which is not compliant with the PDF/A-2B standards.

To resolve this issue, you should ensure that the Interpolate key is set to false during the conversion process. In Aspose.PDF, there is a property called PdfSaveOptions.InterpolateImages that controls this behavior. By setting this property to false, you can prevent the Interpolate key from being written to the output document, thus ensuring compliance with PDF/A standards.

Here is a code example demonstrating how to set this property when saving a PDF to PDF/A format:

using Aspose.Pdf;
using Aspose.Pdf.Saving;

public void ConvertToPdfA(string inputFilePath, string outputFilePath)
{
    // Load the PDF document
    Document pdfDocument = new Document(inputFilePath);

    // Create PdfSaveOptions and set the compliance to PDF/A-2B
    PdfSaveOptions saveOptions = new PdfSaveOptions
    {
        Compliance = PdfCompliance.PdfA_2B,
        InterpolateImages = false // Set InterpolateImages to false
    };

    // Save the document to PDF/A format
    pdfDocument.Save(outputFilePath, saveOptions);
}

Make sure to replace inputFilePath and outputFilePath with the actual paths of your input and output files. This should help you avoid the validation errors related to the Interpolate key.

If you continue to experience issues, please check if the images in your original PDF already have the Interpolate key set to true, as this could also lead to validation failures. In such cases, you may need to preprocess the images before conversion.

For further assistance, you might want to refer to similar discussions in the forum, such as the one where users reported similar issues with image interpolation during PDF/A conversion.

Sources:
[1]: PDFA interpolate key problem

This is a very puzzling response as:

  1. Aspose.Pdf.Saving; does not exist.
  2. The PdfSaveOptions class does not have an InterpolateImages property
  3. Converting to PDF/A-2B should make sure the resulting document is A-2B compliant by default. It doesn’t make sense turn image interpolation off ‘manually’ if this behavior by default does not make the resulting document PDF/A-2B compliant.

It would be fantastic if I was able to clarification on this issue and these points to make sure it is properly looked at.

@frimbingpickering

The previous response was auto-generated by the integrated AI. We are sorry for misinformation it may have provided.

Nevertheless, we have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-59338

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.