Strange PDF to PDF/A conversion

Hallo, we have a problem converting a pdf to pdf/a.

We are using Aspose-PDF-2410. The code to convert to pdf/a is:

doc.convert(pdf_out + “.log.xml”, PdfFormat.PDF_A_1B, ConvertErrorAction.Delete);
doc.save(pdf_out);

the input-file is:
testdokumentanno.pdf (76.3 KB)

the output-file is:
testdokumentanno.pdf.pdf (74.7 KB)

The problem is, that there is a big black-box in the output-file.

Please give us a solution,

Kind regards, Gerd

@GRein

It seems you are experiencing an issue with a black box appearing in the output file after converting a PDF to PDF/A format using Aspose.PDF. This can sometimes occur due to various reasons related to the content of the original PDF or the conversion settings.

Here are a few steps you can take to troubleshoot and potentially resolve the issue:

  1. Check for Transparency: If the original PDF contains transparent elements, they might not convert properly to PDF/A, leading to rendering issues like black boxes. You can try flattening the PDF before conversion to remove transparency.

  2. Validate the PDF: Before conversion, validate the original PDF to ensure it meets the requirements for PDF/A compliance. You can use the validate method to check for any issues:

    pdfDocument.Validate("validation-log.xml", PdfFormat.PDF_A_1B);
    
  3. Use Different PDF/A Versions: If you are using PDF/A-1B, consider trying PDF/A-3B or other versions to see if the issue persists. Different versions may handle certain content types better.

  4. Review Conversion Options: Ensure that the conversion options you are using are appropriate for your document. You might want to experiment with different ConvertErrorAction settings to see if they affect the output.

  5. Update Aspose.PDF: If you are using an older version of Aspose.PDF (like 2410), consider updating to the latest version, as many bugs and issues are often fixed in newer releases.

Here is a sample code snippet for converting a PDF to PDF/A with validation:

Document pdfDocument = new Document("input.pdf");
pdfDocument.Validate("validation-log.xml", PdfFormat.PDF_A_1B);
pdfDocument.Convert("conversion-log.xml", PdfFormat.PDF_A_1B, ConvertErrorAction.Delete);
pdfDocument.Save("output.pdf");

If the problem persists after trying these steps, please provide more details about the content of the original PDF or any specific error messages you encounter during the conversion process. This information can help in diagnosing the issue further.

Feel free to reach out if you need more assistance!

Sources:
[1]: Aspose.PDF for .NET API Reference

Thank you, the conversion to PDF/A2B was the solution.