Image cadImage = Image.load(inputStream);
CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions();
rasterizationOptions.setPageWidth(400);
rasterizationOptions.setPageHeight(300);
rasterizationOptions.setAutomaticLayoutsScaling(true);
rasterizationOptions.setNoScaling(false);
rasterizationOptions.setContentAsBitmap(true);
rasterizationOptions.setLayouts(new String[]{"Model"});
rasterizationOptions.setDrawType(1);
rasterizationOptions.setBackgroundColor(Color.getBlack());
SvgOptions svgOptions = new SvgOptions();
svgOptions.setVectorRasterizationOptions(rasterizationOptions);
// Set Graphics options
rasterizationOptions.getGraphicsOptions().setSmoothingMode(SmoothingMode.HighQuality);
rasterizationOptions.getGraphicsOptions().setTextRenderingHint(TextRenderingHint.AntiAliasGridFit);
rasterizationOptions.getGraphicsOptions().setInterpolationMode(InterpolationMode.HighQualityBicubic);
cadImage.save(targetPath, svgOptions);
image.jpg (179.7 KB)