We are pleased to announce that Aspose.CAD for Java 17.02 has been released. The major development in this release is the support for DWG 2007(AC1021) Format. This release supports determining the DWG external references and their file paths. The support for adjusting CAD drawing size has also been incorporated in this release.
Adjust CAD Drawing Size using Java
Aspose.CAD for Java provides the setUnitType property to adjust the size of drawing during conversion of the CAD format. There are two ways to adjust the drawing size.
- Automatic adjust size.
- Adjust size using UnitType enumeration
UnitType enumeration gives the ability to adjust scaling when Width & Height properties are not set. Below provided code snippet demonstrate how to use UnitType.
// Path to source file
String sourceFilePath = "sample.dwg";
// Load a CAD drawing in an instance of Image
com.aspose.cad.Image objImage = com.aspose.cad.Image.load("sourceFilePath");
// Create an instance of BmpOptions class
com.aspose.cad.imageoptions.BmpOptions bmpOptions = new com.aspose.cad.imageoptions.BmpOptions();
// Create an instance of CadRasterizationOptions and set its various properties
com.aspose.cad.imageoptions.CadRasterizationOptions cadRasterizationOptions =
new com.aspose.cad.imageoptions.CadRasterizationOptions();
bmpOptions.setVectorRasterizationOptions(cadRasterizationOptions);
cadRasterizationOptions.setCenterDrawing(true);
// Set the UnitType property
cadRasterizationOptions.setUnitType(com.aspose.cad.imageoptions.UnitType.Centimenter);
// Set the layouts property
cadRasterizationOptions.setLayouts( new String[] { "Model" } );
// Export layout to BMP format
String outPath = sourceFilePath + ".bmp";
objImage.save(outPath, bmpOptions);
Enhancements
Following enhancements have been introduced in this release.
- Processing of entity order for DWG format has been improved.
- Processing of converting DWG to PDF format has been improved.
- Process of exporting external raster images linked with DWG file has been improved.
To view a complete list of new features and to download the latest release, please visit Aspose.CAD for Java 17.02 page in downloads section.
Aspose.CAD for Java Resources
The resources, you may need to accomplish your tasks:
- Homepage for Aspose.CAD for Java API
- Download Aspose.CAD for Java
- Aspose.CAD for Java Docs – Help documentation
- Aspose.CAD Product Family Forum – Post your technical questions and queries, or any other problem you faced while running Aspose.CAD APIs.
- Enable Email Subscription – Don’t limit yourself, you can keep yourself updated with the latest news on Aspose.CAD APIs and new features, fixes, plus other API related topics by subscribing to Aspose.CAD blog.
- Aspose.CAD for Java Examples – We have published our code examples on the social coding website GitHub.com. Anyone can explore the code examples for learning purposes.