Aspose.CAD for Java 17.02.0 - Release notes
Aspose.CAD for .Net has been updated to version 17.02.0 and we are pleased to announce it. The following is a list of changes in this version of Aspose.Imaging.
Features and Improvements
Key | Summary | Category |
---|---|---|
CADJAVA-93 | Normalize drawing size to absolute metrics | Feature |
CADJAVA-94 | Add support for clipping of raster images | Feature |
CADJAVA-71 | Determine the external references for a dwg and their filepaths | Feature |
CADJAVA-96 | Support for DWG 2007(AC1021) Format | Feature |
CADJAVA-97 | Implement right entity order for dwg format | Enhancement |
CADJAVA-98 | Converting DWG to PDF format is producing incorrect PDF file of 1kb size | Enhancement |
CADJAVA-52 | Converting DWG to PDF file is throwing exception | Enhancement |
CADJAVA-53 | Converting DWG to PDF is not exporting external raster images linked with DWG file | Enhancement |
Usage examples
CADNET-179 Normalize drawing size to absolute metrics Automatic shrink (Aspose.CAD.FileFormats.Cad.ScaleType enum has been removed)
String fileName = getFileFromDesktop("APFH Floor Plan (DWG).dwg");
com.aspose.cad.Image image = com.aspose.cad.Image.load(fileName);
{
BmpOptions pdfOptions = new BmpOptions();
CadRasterizationOptions cadRasterizationOptions = new CadRasterizationOptions();
pdfOptions.setVectorRasterizationOptions(cadRasterizationOptions);
cadRasterizationOptions.setCenterDrawing(true);
cadRasterizationOptions.setPageHeight(500);
cadRasterizationOptions.setPageWidth(500);
cadRasterizationOptions.setLayouts(new String[] { "Model" });
// export
String outPath = fileName + ".bmp";
image.save(outPath, pdfOptions);
}
CADNET-179 Normalize drawing size to absolute metrics Automatic sizing (Width and Height properties of CadRasterizationOptions/DgnRasterizationOptions could be not set)
String fileName = getFileFromDesktop("APFH Floor Plan (DWG).dwg");
com.aspose.cad.Image image = com.aspose.cad.Image.load(fileName);
{
BmpOptions pdfOptions = new BmpOptions();
CadRasterizationOptions cadRasterizationOptions = new CadRasterizationOptions();
pdfOptions.setVectorRasterizationOptions(cadRasterizationOptions);
cadRasterizationOptions.setCenterDrawing(true);
cadRasterizationOptions.setLayouts(new String[] { "Model" });
// export
String outPath = fileName + ".bmp";
image.save(outPath, pdfOptions);
}
CADNET-179 Normalize drawing size to absolute metrics UnitType property gives the ability to adjust automatic scaling when Width and Height are not set (Assume source drawing has size as 1 meter to 1 meter and UnitType is specified as Centimeter then resulted image will be 1000x1000 pixels if Width and Height were not set)
String fileName = getFileFromDesktop("APFH Floor Plan (DWG).dwg");
com.aspose.cad.Image image = com.aspose.cad.Image.load(fileName);
{
BmpOptions pdfOptions = new BmpOptions();
CadRasterizationOptions cadRasterizationOptions = new CadRasterizationOptions();
pdfOptions.setVectorRasterizationOptions(cadRasterizationOptions);
cadRasterizationOptions.setCenterDrawing(true);
cadRasterizationOptions.setUnitType(UnitType.Centimenter);
cadRasterizationOptions.setLayouts(new String[] { "Model" });
// export
String outPath = fileName + ".bmp";
image.save(outPath, pdfOptions);
}
CADNET-183 Converting DWG to PDF is not exporting external raster images linked with DWG file
String fileName = "test-a-802.dwg";
CadImage cadImage = (CadImage)Image.load(fileName);
{
for (CadBaseObject obj : cadImage.getObjects())
if (obj.getTypeName() == CadObjectTypeName.IMAGEDEF)
{
CadRasterImageDef imageDef = (CadRasterImageDef)obj;
System.out.println(imageDef.getImageSizeU());
System.out.println(imageDef.getImageSizeV());
System.out.println(imageDef.getDefaultSize1PixelU());
System.out.println(imageDef.getDefaultSize1PixelV());
System.out.println(imageDef.getFileName());
}
}