Questions regarding Document.check and Document repair

I have some questions regarding these Methods:

Document.check(boolean doRepair):
I found in the forum, that this method “checks inconsistency of q/Q operators in page contents”, so if it returns true, it indicates the document is invalid.
I have documents converted to pdf/a using aspose, for which the check method surprisigly returns true, for example docxLetter.pdf (28.6 KB). How can I avoid this problems during conversion?

Document.repair():
If a PDF/A document is repaired using this method (or using Document.check(true), is it necessary to do another pdf conversion to ensure it meets the PDF/A standard afterwards?

Kind regards

@dvtdaten

Can you please provide more details about the specific issues you are encountering with the Document.check and Document.repair methods? Additionally, what version of Aspose.PDF are you using?

I use the latest version of Aspose.PDF

@dvtdaten

Purpose of Check method is to check document on its validity. Now we only check balance of SaveState - RestoreSate operators in contents of the page.

Violation of the balance of these operators often causes broken document.

Actually, PDF/A conversion should not broke this balance; thus, it would be fine, if you could provide sample code snippet for investigation. We need to fix this.

After validation, document should be converted to PDF/A again, since changes in the document may cause PDF/A violation. So, better don’t validate document after PDF/A conversion. Is document really broken after PDF/A conversion? In which PDF/A format are you converting the document? Is it source file that you have shared?

The pdf letter.pdf (24.6 KB) is resized (using the code mentioned in PDF resizing problem to A4 ) and then converted to PDF/A-2A, after that it becomes the attached PDF/A above, which seems to be somehow invalid.

The reason why in the conversion process a PDF/A is validated is, that this solved some critical issues which lately occourred on external produced PDF/A documents.
My first solution was, that after repairing the pdf it is converted to PDF/A even if already was PDF/A conform, because I was aware, that changes in the document might break PDF/A conformity. But in some cases (eg pdf with many pages) this conversion lead to a timeout. That is why I would like to avoid that PDF/A conversion on a pdf which already is PDF/A conform. After the PDF/A conversion no valiadation of the document is applied.

@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-44661

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.