Convert DWG to PDF problem

Hi,

I’m trying to convert DWG file to PDFwith the code blow,

com.aspose.cad.Image image = com.aspose.cad.Image.load(srcFile.getAbsolutePath());

com.aspose.cad.imageoptions.CadRasterizationOptions rasterizationOptions = new com.aspose.cad.imageoptions.CadRasterizationOptions();
rasterizationOptions.setBackgroundColor(com.aspose.cad.Color.getWhite());
rasterizationOptions.setPageWidth(1600);
rasterizationOptions.setPageHeight(1600);

com.aspose.cad.imageoptions.PdfOptions options = new com.aspose.cad.imageoptions.PdfOptions();
options.setVectorRasterizationOptions(rasterizationOptions);
image.save(dstFile.getAbsolutePath(), options);

but I get exception below:

java.lang.AssertionError: Cannot read a name from the name table in a font.

	at com.aspose.cad.internal.X.a.a(Unknown Source)
	at com.aspose.cad.internal.H.A.b(Unknown Source)
	at com.aspose.cad.internal.H.A.f(Unknown Source)
	at com.aspose.cad.internal.H.A.a(Unknown Source)
	at com.aspose.cad.internal.H.j.a(Unknown Source)
	at com.aspose.cad.internal.H.j.<init>(Unknown Source)
	at com.aspose.cad.internal.H.g.g(Unknown Source)
	at com.aspose.cad.internal.H.g.f(Unknown Source)
	at com.aspose.cad.internal.H.g.a(Unknown Source)
	at com.aspose.cad.internal.H.i.a(Unknown Source)
	at com.aspose.cad.internal.H.i.a(Unknown Source)
	at com.aspose.cad.internal.H.i.a(Unknown Source)
	at com.aspose.cad.internal.dL.a.a(Unknown Source)
	at com.aspose.cad.internal.dy.g.a(Unknown Source)
	at com.aspose.cad.internal.dy.g.a(Unknown Source)
	at com.aspose.cad.internal.dy.g.a(Unknown Source)
	at com.aspose.cad.internal.dJ.a.b(Unknown Source)
	at com.aspose.cad.internal.dJ.c.b(Unknown Source)
	at com.aspose.cad.internal.dy.a.a(Unknown Source)
	at com.aspose.cad.internal.dy.b.a(Unknown Source)
	at com.aspose.cad.internal.dn.b.a(Unknown Source)
	at com.aspose.cad.internal.dn.c.a(Unknown Source)
	at com.aspose.cad.internal.dy.a.export(Unknown Source)
	at com.aspose.cad.Image.b(Unknown Source)
	at com.aspose.cad.fileformats.cad.CadImage.b(Unknown Source)
	at com.aspose.cad.Image.a(Unknown Source)
	at com.aspose.cad.Image.saveInternal_internalized(Unknown Source)
	at com.aspose.cad.Image.save(Unknown Source)
	at com.aspose.cad.Image.save(Unknown Source)

I use Aspose.CAD for Java 17.9 , and convert the attachment file (dwg) to pdfdwg.zip (1.1 MB)

@lvbingwu123,

I have worked with source files and sample code shared by you using Aspose.CAD for Java 17.9 and unable to observe any issue. I have also shared my generated result with you for your kind reference. Can you please share your environment details so that we may further investigate to help you out.dwg.pdf (21.2 KB)

I run my code on Ubuntu 14.04 with openjdk64-1.7.0.151

@lvbingwu123,

I have worked with file shared by you using Aspose.Cad for JAVA 17.9 and have been able to observe the issue. A ticket with ID CADJAVA-196 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with issue so that you may be automatically notified once issue will be fixed.

@Adnan.Ahmad Which version of Aspose.Cad for JAVA I could use to avoid this exception?

@lvbingwu123,

I regret to share that at present there is no product version available that I may suggest you as issue is logged in our issue tracking system. We will share the good news with you as soon as the issue will fixed along with suggested product version.

The issues you have found earlier (filed as CADJAVA-196) have been fixed in this update.