Convert PDF to PDF/A in Java using Aspose.PDF - output file is not PDFA Compliant

Hello

we have a problem converting a PDF file to PDF/A if the source PDF was created using AsposePDF for Java and then we try to convert it to PDF/A also using AsposePDF for Java (last tested with version 20.11), then the document is not converted to PDF/A.

Interestingly, a PDF document created with GhostScript, for example, is converted to PDF/A in AsposePDF for Java just fine.

The error should already be reported under ID PDFJAVA-39804.

We would need a patch as soon as possible. When can we expect it?

Thank you very much.

@abudef

The ticket PDFJAVA-39804 has been logged recently in our issue tracking system and it will surely be resolved on first come first serve basis. However, it is logged with a specific PDF file. It would be appropriate if you could provide a sample PDF document as well so that a dedicated ticket can be logged for your case as well because sometimes issue is used to be related to a specific type of PDF document.

doc1-out.pdf (17.0 KB)
doc2-out.pdf (17.1 KB)
doc3-out.pdf (24.2 KB)

Sample docs attached which cannot be converted to PDF/A.

@abudef

We tried to convert your all provided documents into PDF/A_3A and did not notice any issue during conversion process. We used following code snippet with Aspose.PDF for Java 20.11. Output files are also attached.

Document doc = new Document(dataDir + "doc3-out.pdf");
doc.convert(dataDir + "log.xml", PdfFormat.PDF_A_3A, ConvertErrorAction.Delete);
doc.save(dataDir + "Converted3.pdf");

Converted3.pdf (24.9 KB)
Converted2.pdf (17.7 KB)
Converted1.pdf (17.7 KB)

Would you please share what type of error are you noticing at your side. Please also check attached outputs and let us know about your feedback against them.

Your output files were created with version 20.11.1. Can you please provide this version of the Aspose.PDF library for Java?

@abudef

We apologize for the confusion.

Yes, we tested using 20.11.1 which was a hotfix recently released and it included fix to several bugs. You can download it from the link below:

Thank you for link. We tested it and finally we identified an interested result. If we follow your code with ConvertErrorAction.Delete, then file is correctly converted to PDF/A-3A. When (and we have been used it before) we use ConvertErrorAction.None, then file is not converted into PDF/A-3A. What is difference between these two values? Why Delete convert it and None not?

@abudef

When using ConvertErrorAction.Delete, the API deletes/ignores all the errors which causes the conversion to be failed and in this case, the log file contains description of deleted errors which occurred during the conversion and were ignored/deleted by the API. ConvertErrorAction. None forces API to consider every conversion error and does not bypass them in order to make the conversion successful.