Free Support Forum - aspose.com

Conversion from DWG to PDF failed (mageSaveException)

Hi,

I get following exception why tried to convert DWG to PDF. I may not attach the file here, as it is confidential.

I use Aspose.CAD 20.1 version of jar. (Evaluation copy). Windows 10 OS. Can you help me to understand what was the problem. I could able convert other files though.

Caused by: class com.aspose.cad.cadexceptions.ImageSaveException: Image saving failed. —> class com.aspose.cad.cadexceptions.ImageSaveException: Image export failed. —> java.lang.NegativeArraySizeException: -2008067296
— 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.annomap.aspose.AsposeConverter.convertCADToPDF(AsposeConverter.java:193)
com.annomap.aspose.AsposeConverter.main(AsposeConverter.java:290)
— End of inner exception stack trace —
com.aspose.cad.Image.saveInternal_internalized(Unknown Source)
com.aspose.cad.Image.save(Unknown Source)
com.annomap.aspose.AsposeConverter.convertCADToPDF(AsposeConverter.java:193)
com.annomap.aspose.AsposeConverter.main(AsposeConverter.java:290)
at com.aspose.cad.Image.saveInternal_internalized(Unknown Source)
at com.aspose.cad.Image.save(Unknown Source)
at com.annomap.aspose.AsposeConverter.convertCADToPDF(AsposeConverter.java:193)
… 1 more
Caused by: class com.aspose.cad.cadexceptions.ImageSaveException: Image export failed. —> java.lang.NegativeArraySizeException: -2008067296
— 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.annomap.aspose.AsposeConverter.convertCADToPDF(AsposeConverter.java:193)
com.annomap.aspose.AsposeConverter.main(AsposeConverter.java:290)
at com.aspose.cad.Image.a(Unknown Source)
… 4 more
Caused by: java.lang.NegativeArraySizeException: -2008067296
at java.desktop/java.awt.image.DataBufferByte.(DataBufferByte.java:76)
at java.desktop/java.awt.image.Raster.createInterleavedRaster(Raster.java:266)
at java.desktop/java.awt.image.BufferedImage.(BufferedImage.java:391)
at com.aspose.cad.internal.bG.c.a(Unknown Source)
at com.aspose.cad.internal.bG.c.a(Unknown Source)
at com.aspose.cad.internal.M.b.a(Unknown Source)
at com.aspose.cad.internal.M.b.(Unknown Source)
at com.aspose.cad.internal.M.b.(Unknown Source)
at com.aspose.cad.internal.M.b.(Unknown Source)
at com.aspose.cad.internal.eT.i.a(Unknown Source)
at com.aspose.cad.internal.eR.f.a(Unknown Source)
at com.aspose.cad.internal.eS.q.a(Unknown Source)
at com.aspose.cad.internal.eR.f.a(Unknown Source)
at com.aspose.cad.internal.eR.f.a(Unknown Source)
at com.aspose.cad.internal.fu.a.a(Unknown Source)
at com.aspose.cad.internal.fu.a.a(Unknown Source)
at com.aspose.cad.internal.fr.a.b(Unknown Source)
at com.aspose.cad.internal.fr.c.b(Unknown Source)
at com.aspose.cad.internal.eR.a.a(Unknown Source)
at com.aspose.cad.internal.eR.a.export(Unknown Source)
… 5 more

@harishalwala,

I have observed the stack trace shared by you and suggest you to please try using latest Aspose.CAD for .NET 20.4 on your end. In case there is still an issue then there is no other option then to share the source file and working sample code for investigation and resolution on our end.

I could see the issue fixed with new version (java), but setting 10 GB as heap size…

@harishalwala,

It’s good to know that latest version have resolve the issue on your end. The heap size is some thing that is dependent on file that you are trying to manage and operations you are performing on that.