Free Support Forum -

PDF with annotations cannot be converted (NPE)

PDF document with annotations cannot be converted to PDF/A (NullPointerException).
Affekted Version: 18/2.
PDF-Datei mit Anmerkungen und Grafikmarkierungen.pdf (43.2 KB)

at com.aspose.pdf.LineAnnotation.getStartingStyle(Unknown Source)
at com.aspose.pdf.LineAnnotation.lI(Unknown Source)
at com.aspose.pdf.LineAnnotation.ll(Unknown Source)
at com.aspose.pdf.Annotation.lif(Unknown Source)
at com.aspose.pdf.Annotation.updateAppearances(Unknown Source)
at com.aspose.pdf.InternalHelper.lif(Unknown Source)
at com.aspose.pdf.internal.l227.I0I.lif(Unknown Source)
at com.aspose.pdf.internal.l227.I0I.ll(Unknown Source)
at com.aspose.pdf.internal.l227.I01.l01(Unknown Source)
at com.aspose.pdf.internal.l227.I0I.lif(Unknown Source)
at com.aspose.pdf.ADocument.lif(Unknown Source)
at com.aspose.pdf.Document.lif(Unknown Source)
at com.aspose.pdf.ADocument.convertInternal(Unknown Source)
at com.aspose.pdf.Document.convertInternal(Unknown Source)
at com.aspose.pdf.ADocument.convert(Unknown Source)
at com.aspose.pdf.Document.convert(Unknown Source)


Thank you for contacting support.

We would like to share with you that the attached document includes incorrect annotations that are not compliant with PDF/A standard. Therefore, Adobe Preflight tool can not convert it to this format either. We have attached a screenshot for your kind reference Annotations.JPG. If you are able to convert it to a PDF/A document then please share the details along with generated PDF document so that we may investigate further to help you out.

b6b648e6-7e95-4603-9726-7382cf172e1e.pdf (69.2 KB)

The attached file is generated by our previous converter provider. It generates a valid PDF/A 2b format (veraPDF tested).
I think the Aspose PDF library should generate an error report, not NPE.

The missing fonts are embedded before the convert call is executed. Does Aspose include CMYK information? It is possible to include a standard icc profile?


We would like to request you to share the code snippet that you are using in your environment for conversion to specified PDF/A format. Moreover, Aspose.PDF API ensures that each requirement of a specific format is fulfilled, just like the steps followed by Adobe Preflight for such conversion. So, including CMYK or sRGB information are internal routines and a specific profile may not be included explicitly. You only need to specify the compliance version and the API takes care of other necessary steps for the conversion. Please share requested code snippet with us, so that we may proceed to help you out. (702 Bytes)

ZIP file contains java code for PDF/A creation.


Thank you for sharing requested data.

We have logged all details of the problem under ticket ID PDFJAVA-37675 in our issue management system, for further investigation and resolution. The issue ID has been linked with this thread so that you will receive notification as soon as the issue is resolved.

We are sorry for the inconvenience.

The issues you have found earlier (filed as PDFJAVA-37675) have been fixed in Aspose.PDF for Java 18.7.