Compress PDF: PDF/A compliance gets lost

Compress PDF: PDF/A compliance gets lost

Hello

I compress various types of pdf using this code:

com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document(input);
OptimizationOptions optimizationOptions = new OptimizationOptions();
optimizationOptions.setRemoveUnusedObjects(true);
optimizationOptions.setRemoveUnusedStreams(true);
optimizationOptions.setAllowReusePageContent(true);
pdfDocument.optimizeResources(optimizationOptions);

ByteArrayOutputStream output = new ByteArrayOutputStream();
pdfDocument.save(output);

In the attached file
input.pdf (303.4 KB), the PDF/A compliance gets lost after optimization:
output.pdf (300.7 KB)

I know I could convert it again to PDF/A, but this problem does not happen in most cases, so I would like to avoid an extra conversion.

Kind regards

@dvtdaten

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): PDFJAVA-44448

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.