Hello,
I’m using Aspose.CAD (.NET) to covert a DXF file to JPG (output image size 1000 x 1000).
I want that the rasterized drawing to scale to fit the 1000 x 1000 area while keeping its ratio and
with many DXF file this operation works as expected however with a few DXF files the output drawing only fill around 1/4 of the space.
I verified this unexpected behaviour with both version 20.7.0 and 20.9.1 of Aspose.CAD.
Can you give me some feedback?
Here the code I use and an attachment with a DXF file that gives issues:
using (Aspose.CAD.FileFormats.Cad.CadImage cadImage = (Aspose.CAD.FileFormats.Cad.CadImage)Aspose.CAD.Image.Load(filename))
{
Aspose.CAD.Rectangle rect = cadImage.Bounds;
var options = new Aspose.CAD.ImageOptions.JpegOptions();
Aspose.CAD.ImageOptions.CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions()
{
BackgroundColor = Aspose.CAD.Color.White,
PageHeight = 1000,
PageWidth = 1000,
DrawType = Aspose.CAD.FileFormats.Cad.CadDrawTypeMode.UseObjectColor
};
options.VectorRasterizationOptions = rasterizationOptions;
// save DXF as a JPEG
cadImage.Save(Path.GetDirectoryName(filename) + "\\" + Path.GetFileNameWithoutExtension(filename) + ".jpg", options);
}
0700410_01_B-1.dxf.zip (108.8 KB)