Browse our Products

Aspose.CAD for Java 1.0.0 Release Notes

We are pleased to announce the first release of Aspose.CAD for Java. It allows you to convert AutoCAD DWG and DXF files to PDF and Raster images. It is a native API and does not require AutoCAD or any other software to be installed.

You can also convert the selected layers and layouts from the AutoCAD files. The conversion to PDF and Raster images is of very high quality. At the moment we support the following Cad image types for loading (please refer to the https://autodesk.blogs.com/between_the_lines/autocad-release-history.html DWG file history): o CadR11 o CadR13 o CadR14 o CadR2000 o CadR2004 o CadR2010 o CadR2013

Features and Improvements

KeySummaryCategory
CADJAVA-23Add support for removing entitiesNew Feature
CADJAVA-22Support CAD file formats for FileFormat enumeration and properly update Image.GetFileFormat methodNew Feature
CADJAVA-21Support DXF 2007 formatNew Feature
CADJAVA-20Add support for leaders entity for DWG formatNew Feature
CADJAVA-19Add support for solid entity for DWGNew Feature
CADJAVA-18Add support for solid entity for DXFNew Feature
CADJAVA-17Converting DWG to PDF is producing PDF of zero sizeEnhancement
CADJAVA-16Exceptions namespace should be removed or renamed since it conflicts with Microsoft guidelinesEnhancement
CADJAVA-15Fix reading DimensionStyle entity for 2004 DWG formatEnhancement
CADJAVA-14Improve dashed polylines drawingEnhancement
CADJAVA-12Render only part of an image during CAD to PDF exportEnhancement

Public API and Backward Incompatible Changes

Please note that Aspose.CAD API was split from Aspose.Imaging API, hence its public API is almost the same so you can easily migrate to Aspose.CAD by renaming the packages to com.aspose.cad instead of com.aspose.imaging. Following is an example to convert CAD documents to PDF using Aspose.Imaging and Aspose.CAD respectively. You can notice that just com.aspose.imaging package has been replaced with com.aspose.cad.

Aspose.Imaging Code
 String sourceFilePath = myDir + "sample.dxf";

//Load a CAD drawing

com.aspose.imaging.Image image = com.aspose.imaging.Image.load(sourceFilePath);

//Create an instance of CadRasterizationOptions and set its various properties

com.aspose.imaging.imageoptions.CadRasterizationOptions rasterizationOptions = new com.aspose.imaging.imageoptions.CadRasterizationOptions();

rasterizationOptions.setPageWidth(1600);

rasterizationOptions.setPageHeight(1600);

//Create an instance of PdfOptions

com.aspose.imaging.imageoptions.PdfOptions pdfOptions = new com.aspose.imaging.imageoptions.PdfOptions();

//Set the VectorRasterizationOptions property

pdfOptions.setVectorRasterizationOptions(rasterizationOptions);

//Export the DXF to PDF

image.save(myDir + "result.pdf", pdfOptions);
Aspose.CAD Code
  // The path to the resource directory.

 String dataDir = Utils.getDataDir(ExportDXFDrawingToPDF.class) + "DXFDrawings/";

 String srcFile = dataDir + "conic_pyramid.dxf";

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

 // Create an instance of CadRasterizationOptions and set its various properties

 com.aspose.cad.imageoptions.CadRasterizationOptions rasterizationOptions = new com.aspose.cad.imageoptions.CadRasterizationOptions();

 rasterizationOptions.setBackgroundColor(Color.getWhite());

 rasterizationOptions.setPageWidth(1600);

 rasterizationOptions.setPageHeight(1600);

 // Create an instance of PdfOptions

 com.aspose.cad.imageoptions.PdfOptions pdfOptions = new com.aspose.cad.imageoptions.PdfOptions();

 // Set the VectorRasterizationOptions property

 pdfOptions.setVectorRasterizationOptions(rasterizationOptions);

 // Export the DXF to PDF

 image.save(dataDir + "conic_pyramid_out_.pdf", pdfOptions);