PDF to PDF/A Conversion Error Handling in Java

We try to convert PDF files to valid PDF/A files. For us it is important that the conversion is working correctly and without loss in visual fidelity or content and if something could not be “correctly” converted, we need an error notification so that we can prevent archiving of “badly” converted files.

We use the following line of code for conversion:

document.convert(outputLogStream, com.aspose.pdf.PdfFormat.PDF_A_1B, com.aspose.pdf.ConvertErrorAction.Delete)

The option com.aspose.pdf.ConvertErrorAction.Delete seems to eliminate elements it cannot convert and altering the converted document, i.e. possible changing how it looks or even loss of information? Is this correct?

So for our purpose it seems that we should use the other option com.aspose.pdf.ConvertErrorAction.None

However, it looks like, even with com.aspose.pdf.ConvertErrorAction.None there seems to be no error thrown and an output PDF is still generated even if during conversion, it encounters things it cannot convert.

Is the correct approach to parse the outputLogStream and check if there are any problems?

Thanks for your help in advance!

A post was split to a new topic: Data seems better in the XMP but the validator DO NOT recognize them

@procentric

To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input PDF.
  • Please attach the output that shows the undesired behavior.
  • Please attach the expected output that shows the desired behavior.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.

Hi, maybe it was unclear. So far we only have questions and are not yet sure if there is an undesired behavior or issue. Once we know how it is supposed to work, we can check on our end if we still face issues and then we are happy to provide sample code and sample files.

So far our questions are:

  1. When trying to converting a file from PDF to PDF/A using following code:

document.convert(outputLogStream, com.aspose.pdf.PdfFormat.PDF_A_1B, com.aspose.pdf.ConvertErrorAction.None)

  • Is it correct that no exception is thrown if conversion fails?
  • If there are problems during conversion is the only way to find out about it to parse the XML in the output log?
  • Is it documented somewhere what the lines and tags in the output log mean?

@procentric

If there is an issue while PDF to PDF/A conversion, the exception may occur.

All problem of conversion does not log in the XML.

Unfortunately, there is no documentation available for these tags.

Please share the complete detail of your issue that you are facing along with requested resources. We will then provide you more information about your query.