The following code fails:
try {
CadImage image = (CadImage) Image.load(filePath);
// Create an instance of CadRasterizationOptions class
CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions();
// Most CAD are in landscape, so use 4x standard landscape size
rasterizationOptions.setPageHeight(DefaultPageWidth * 2);
rasterizationOptions.setPageWidth(DefaultPageHeight * 2);
rasterizationOptions.setAutomaticLayoutsScaling(true);
rasterizationOptions.setNoScaling(false);
rasterizationOptions.setContentAsBitmap(true);
// Set Layouts
rasterizationOptions.setLayouts(new String[]{"Model"});
// Set Graphics options
rasterizationOptions.getGraphicsOptions().setSmoothingMode(SmoothingMode.HighQuality);
rasterizationOptions.getGraphicsOptions().setTextRenderingHint(TextRenderingHint.AntiAliasGridFit);
rasterizationOptions.getGraphicsOptions().setInterpolationMode(InterpolationMode.HighQualityBicubic);
// Create an instance of CadRasterizationOptions and set its various properties
rasterizationOptions.setBackgroundColor(com.aspose.cad.Color.getWhite());
// Create an instance of PDF options class
PdfOptions pdfOptions = new PdfOptions();
pdfOptions.setVectorRasterizationOptions(rasterizationOptions);
image.save(filePath + ".pdf", pdfOptions);
} catch (Exception e){
System.out.println("Exception:\n"+ e.toString());
}
Using any of the seven files included in this ZIP file:
https://www.dropbox.com/s/ihqb3wwp8vr7txl/tmp_cad.zip?dl=0
I am using Aspose CAD 19.7
The conversion never terminates for this file:
https://www.dropbox.com/s/2lxrrcsq33ud3yr/simple.dwg?dl=0
which used to work on a previous version of Aspose CAD