ImageSaveException: Image export failed on converting DWG to PDF (Java)

Exception in thread “main” class com.aspose.cad.cadexceptions.ImageSaveException: Image saving failed. —> class com.aspose.cad.cadexceptions.ImageSaveException: Image export failed. —> java.lang.NullPointerException
— End of inner exception stack trace —
com.aspose.cad.Image.a(Unknown Source)
com.aspose.cad.Image.saveInternal_internalized(Unknown Source)
com.aspose.cad.Image.save(Unknown Source)
com.drawing.topdf.Text.DWGFileToPDF(Text.java:33)
com.drawing.topdf.Text.main(Text.java:39)
— End of inner exception stack trace —
com.aspose.cad.Image.saveInternal_internalized(Unknown Source)
com.aspose.cad.Image.save(Unknown Source)
com.drawing.topdf.Text.DWGFileToPDF(Text.java:33)
com.drawing.topdf.Text.main(Text.java:39)
at com.aspose.cad.Image.saveInternal_internalized(Unknown Source)
at com.aspose.cad.Image.save(Unknown Source)
at com.drawing.topdf.Text.DWGFileToPDF(Text.java:33)
at com.drawing.topdf.Text.main(Text.java:39)
Caused by: class com.aspose.cad.cadexceptions.ImageSaveException: Image export failed. —> java.lang.NullPointerException
— End of inner exception stack trace —
com.aspose.cad.Image.a(Unknown Source)
com.aspose.cad.Image.saveInternal_internalized(Unknown Source)
com.aspose.cad.Image.save(Unknown Source)
com.drawing.topdf.Text.DWGFileToPDF(Text.java:33)
com.drawing.topdf.Text.main(Text.java:39)
at com.aspose.cad.Image.a(Unknown Source)
… 4 more
Caused by: java.lang.NullPointerException
at com.aspose.cad.internal.eY.h.a(Unknown Source)
at com.aspose.cad.internal.eY.h.a(Unknown Source)
at com.aspose.cad.internal.eS.d.a(Unknown Source)
at com.aspose.cad.internal.eS.d.a(Unknown Source)
at com.aspose.cad.internal.eS.d.a(Unknown Source)
at com.aspose.cad.internal.eQ.g.a(Unknown Source)
at com.aspose.cad.internal.eQ.g.a(Unknown Source)
at com.aspose.cad.internal.eQ.g.a(Unknown Source)
at com.aspose.cad.internal.fm.a.b(Unknown Source)
at com.aspose.cad.internal.fm.c.b(Unknown Source)
at com.aspose.cad.internal.eQ.a.a(Unknown Source)
at com.aspose.cad.internal.eQ.a.export(Unknown Source)
… 5 moreyichang.zip (292.2 KB)

@wupeng123,

I have observed the issue shared by you and request you to please first try using Aspose.CAD for Java 19.9 on your end. If the issue still persist then please share feedback with us along with Java and Operating System details.

CAD2018,WIN10
20191009084511.png (16.1 KB)

@wupeng123,

I have worked with the sample file shared and have been able to observe the issue. An issue with ID CADJAVA-560 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.