Browse our Products

Aspose.CAD for .NET 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
CADNET-179Normalize drawing size to absolute metricsFeature
CADNET-201Add support for clipping of raster imagesFeature
CADNET-110Determine the external references for a dwg and their filepathsFeature
CADNET-15Support for DWG 2007(AC1021) FormatFeature
CADNET-255Implement right entity order for dwg formatEnhancement
CADNET-198Converting DWG to PDF format is producing incorrect PDF file of 1kb sizeEnhancement
CADNET-184Converting DWG to PDF file is throwing exceptionEnhancement
CADNET-183Converting 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");

            using (Aspose.CAD.Image image = Aspose.CAD.Image.Load(fileName))

            {

                BmpOptions pdfOptions = new BmpOptions();

                CadRasterizationOptions cadRasterizationOptions = new CadRasterizationOptions();

                pdfOptions.VectorRasterizationOptions = cadRasterizationOptions;

                cadRasterizationOptions.CenterDrawing = true;

                cadRasterizationOptions.PageHeight = 500;

                cadRasterizationOptions.PageWidth = 500;

                cadRasterizationOptions.Layouts = 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");

            using (Aspose.CAD.Image image = Aspose.CAD.Image.Load(fileName))

            {

                BmpOptions pdfOptions = new BmpOptions();

                CadRasterizationOptions cadRasterizationOptions = new CadRasterizationOptions();

                pdfOptions.VectorRasterizationOptions = cadRasterizationOptions;

                cadRasterizationOptions.CenterDrawing = true;

                cadRasterizationOptions.Layouts = 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");

            using (Aspose.CAD.Image image = Aspose.CAD.Image.Load(fileName))

            {

                BmpOptions pdfOptions = new BmpOptions();

                CadRasterizationOptions cadRasterizationOptions = new CadRasterizationOptions();

                pdfOptions.VectorRasterizationOptions = cadRasterizationOptions;

                cadRasterizationOptions.CenterDrawing = true;

                cadRasterizationOptions.UnitType = UnitType.Centimenter;

                cadRasterizationOptions.Layouts = 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";

            using (CadImage cadImage = (CadImage)Image.Load(GetPath(fileName)))

            {

                foreach (CadBaseObject obj in cadImage.Objects)

                    if (obj.TypeName == CadObjectTypeName.IMAGEDEF)

                    {

                        CadRasterImageDef imageDef = obj as CadRasterImageDef;

                        Assert.IsTrue(imageDef.ImageSizeU >= 0, "Invalid size of image");

                        Assert.IsTrue(imageDef.ImageSizeV >= 0, "Invalid size of image");

                        Assert.IsTrue(imageDef.DefaultSize1PixelU >= 0, "Invalid pixel size of image");

                        Assert.IsTrue(imageDef.DefaultSize1PixelV >= 0, "Invalid pixel size of image");

                        Assert.IsTrue(!string.IsNullOrEmpty(imageDef.FileName), "Invalid image file name");

                    }

            }