Browse our Products

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

KeySummaryCategory
CADJAVA-93Normalize drawing size to absolute metricsFeature
CADJAVA-94Add support for clipping of raster imagesFeature
CADJAVA-71Determine the external references for a dwg and their filepathsFeature
CADJAVA-96Support for DWG 2007(AC1021) FormatFeature
CADJAVA-97Implement right entity order for dwg formatEnhancement
CADJAVA-98Converting DWG to PDF format is producing incorrect PDF file of 1kb sizeEnhancement
CADJAVA-52Converting DWG to PDF file is throwing exceptionEnhancement
CADJAVA-53Converting DWG to PDF is not exporting external raster images linked with DWG fileEnhancement

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());

            }

        }