Convert PDF to PDF/A in Java using Aspose.PDF - an Error has occurred

Hi, we are using Aspose 11.8. When converting a pdf to pdf/a, i am getting the following error. Just not knowing exactly the reason why this is failing. Please let me know what the actual issue is

-

1.0

Copyright © 2001-2016 Aspose Pty Ltd. All Rights Reserved.

6/18/2020 8:01:46 PM

-

-

-

ExtGState ‘ca’ value shall be 1.0

Object is compressed

Object is compressed

Object is compressed

Object is compressed

Object is compressed

Object is compressed

Object is compressed

Object is compressed

Object is compressed

Object is compressed

Object is compressed

Object is compressed

Object is compressed

Object is compressed

Object is compressed

Object is compressed

The xref stream is prohibited

-

Font ‘Helvetica-Bold’ is not embedded

Font ‘Helvetica’ is not embedded

Width information for glyphs is inconsistent in embedded font ‘ABGVAA+AbriBar128s’

-

The instanceID field shall not be specified

Document information entry ‘ModDate’ not synchronized with metadata property ‘xmp:ModifyDate’

Required property ‘pdfaid:part’ for schema ‘pdfaid’ missing

Required property ‘pdfaid:conformance’ for schema ‘pdfaid’ missing

@kiran.satti

Would you kindly try to use Aspose.PDF for .NET 20.6 for conversion as it is always recommended to use latest version. In case you still face any issue, please share your sample PDF document along with sample code snippet. We will test the scenario in our environment and address it accordingly.

Hi, i tried with Aspose PDF 20.6 jar for JAVA.

For One PDF, at the time of exectuion itself i got this error

class com.aspose.pdf.internal.l57v.lf: Cannot parse file. —> class com.aspose.pdf.internal.l57v.lb: Not enough data in stream.
com.aspose.pdf.internal.l60j.lf.lj(Unknown Source)
com.aspose.pdf.internal.l60j.lf.lf(Unknown Source)
com.aspose.pdf.internal.l60j.lf.lI(Unknown Source)
com.aspose.pdf.internal.l60k.lf.lI(Unknown Source)
com.aspose.pdf.internal.l60k.lf.getNumImages(Unknown Source)


For other pdf, got error in xml.

<?xml version="1.0"?>

-

1.0

Copyright © 2001-2019 Aspose Pty Ltd. All Rights Reserved.

6/24/2020 4:44:34 PM

-

The transparency is prohibited (‘Group’ key)

The transparency is prohibited (‘Group’ key)

-

Font ‘Helvetica’ is not embedded

CIDSet is missing or incomplete for font ‘DODFBK+ArialMT’

CIDSet is missing or incomplete for font ‘CVFPGE+CourierNewPSMT’

@kiran.satti

Would you please share the sample PDF document with us. Also. please share in which PDF/A format you are converting it so that we can test the scenario in our environment and address it accordingly.

Testpdf.pdf (436.4 KB)

Trying to convert to PDF_A_1B. This is kind of urgent. If you could let me know what the issue is, taht would really help.

@kiran.satti

We have tested the scenario in our environment with Aspose.PDF for Java 20.6 and were unable to notice any exception. It seems like the issue is causing due to missing fonts in your system. Would you please make sure to install all essential fonts in your system e.g. Arial, Helvetica, AbriBar128s. For your kind reference, please check the following output PDF generated at our side:

Please also note that we did notice the output size was many times bigger than the input file size and we have logged an issue as PDFJAVA-39528 in our issue tracking system for it. We will investigate the ticket from the perspective of size increase and keep you posted with the status of ticket resolution. Please be patient and spare us some time.

We are sorry for the inconvenience.

Could you please provide the code that is used to generate this? Also when you say fonts should be installed in the system, how can the fonts be installed?

Asking about fonts because I am getting the following error and not sure if it is related to fonts.

Exception in thread “main” class com.aspose.pdf.internal.l57v.lf: Cannot parse file. —> class com.aspose.pdf.internal.l57v.lb: Not enough data in stream.
com.aspose.pdf.internal.l60j.lf.lj(Unknown Source)

@kiran.satti

We used following code snippet:

Document doc = new Document(dataDir + "Testpdf.pdf");
doc.convert(dataDir + "log.xml", PdfFormat.PDF_A_1B, ConvertErrorAction.Delete);
doc.save(dataDir + "Converted.pdf");

You may download suggested fonts from any website and install them to your system. If you are working in a Non-Windows Environment, please share your environment details with us. We will share our feedback with you accordingly.

Any update on this error?

Yes the fonts needs to be installed in linux server. But the same file we are able to do normal pdf conversion. Only when we try to do PDF/A we are getting the error. Is this still related to the fonts?

@kiran.satti

Some PDF/A standards require full font embedding in order to pass the compliance. That is why we suggested you to install the fonts at your end. In the case of Linux, you can use following command to install the fonts:

sudo apt-get install ttf-mscorefonts-installer

Please let us know are you facing this error using a similar code snippet with similar PDF document that you have already shared with us?

Yes the same PDF file - the same code and the jar being used is 20.6 version pdf jar.

com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document(datadir + “Testpdf.pdf”);
pdfDocument.convert(datadir + “pdfa.xml”, PdfFormat.PDF_A_1B, ConvertErrorAction.Delete);
pdfDocument.save(datadir + “TestpdfNew.pdf”);

Still i am getting this error

Exception in thread “main” class com.aspose.pdf.internal.l57v.lf: Cannot parse file. —> class com.aspose.pdf.internal.l57v.lb: Not enough data in stream.
com.aspose.pdf.internal.l60j.lf.lj(Unknown Source)
com.aspose.pdf.internal.l60j.lf.lf(Unknown Source)

@kiran.satti

We have tested the scenario in Ubuntu 15.04 x64 environment and were still unable to notice any exception. Please note that all fonts were installed in the system where we tested the scenario. Would you please share if you have all fonts installed? Also, please share complete OS name and version details with us so that we can further proceed to investigate the scenario.

Any update PDFJAVA-39528 when this bug will be resolved and ready?

@kiran.satti

The issue has recently been logged in our issue management system and is pending for analysis. It will be investigated and resolved on first come first serve basis. We will surely let you know as soon as we have some updates regarding availability of its fix. Please spare us some time.

Unfortunately this is stopping us to move ahead with sale as PDF/A is primary component for us. Please let me know if this can be completed in 15 days.

@kiran.satti

We are afraid we cannot share any ETA or make any promises regarding resolution time of the issue before it is fully investigated. Please note that resolution time of the issue depends upon it nature of complexity and number of API components need to investigated. You can however please check our priority support option in order to escalate the issue investigation if it is a blocker for you. We will inform you as soon as we have some updates regarding ETA or issue analysis.

We are sorry for the inconvenience.

Is there any update on this issue? We have a high priority on this and We need to have a resolution soon.

@kiran.satti

We surely understand your concerns and severity of the issue for you. However, as shared earlier, the issue will be resolved on first come first serve basis according to the policy of normal support which we believe is the fairest policy for everyone.

We really apologize for the delay and inconvenience you have been facing due to this issue. We have recorded your concerns and will surely consider them during the investigation of earlier logged ticket. You will certainly be notified as soon as definite updates are available regarding ticket resolution. Please spare us some time.

We are sorry for the inconvenience.