Free Support Forum - aspose.com

Aspose.CAD for java on Android Device

I converted dwg file to pdf file through Aspose.CAD for java on Android Device like this:

com.aspose.cad.Image objImage = com.aspose.cad.Image.load("/storage/emulated/0/cad/sample.dwg");
        CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions();
        rasterizationOptions.setBackgroundColor(Color.getWhite());
        rasterizationOptions.setPageWidth(1600);
        rasterizationOptions.setPageHeight(1600);
        PdfOptions pdfOptions = new PdfOptions();
        pdfOptions.setVectorRasterizationOptions(rasterizationOptions);
        objImage.save(dir + "/storage/emulated/0/cad/sample.pdf", pdfOptions);

but I got this Exception:

 class com.aspose.cad.cadexceptions.ImageLoadException: Image loading failed: Cannot process loading further due to incorrect file format structure, may be file is corrupted. ---> class com.aspose.cad.internal.Exceptions.Exception: Cannot process loading further due to incorrect file format structure, may be file is corrupted.
    com.aspose.cad.internal.fL.g.a(Unknown Source:323)
    com.aspose.cad.internal.fL.bl.a(Unknown Source:77)
    com.aspose.cad.internal.fL.bk.a(Unknown Source:46)
    com.aspose.cad.Image.a(Unknown Source:51)
    com.aspose.cad.Image.load(Unknown Source:6)

does this mean Aspose.CAD does not support running on Android Device? If not, Is there any way to convert DWG to PDF on Android devices?

@Run_Zeng

I have created a ticket with ID CADJAVA-975 in our issue tracking system to further investigate this on our end as at the moment Aspose.CAD for Java jar can’t be used in Android environment.

Thanks!Hope Aspose.CAD for java can be used on Android Device as early as possible.

@Run_Zeng

At the moment it is not supported and we will share with you as soon as it will be available.