I’m working on a project with Aspose.CAD for .NET 3.0 and have been having some trouble generating images from the resultant dxf. Things are working properly for the pdf conversion, and the desired output in that format is attached. However, the image is being cropped as seen in test normal. I assumed it might be a resolution issue, but it has to do with the relative proportions: the low res image has the same cropping, whereas increasing one dimension can show the entire image along that direction, though any increase in the other direction will reduce that result.
While I’ve tried originally and most commonly with PNG, other image formats have the same issue.
Is there any way to make the entire DXF as rendered in the pdf appear in the images?
Aspose.CAD.ImageOptions.CadRasterizationOptions rasterizationOptions = new Aspose.CAD.ImageOptions.CadRasterizationOptions();
rasterizationOptions.PageWidth = 1700;
rasterizationOptions.PageHeight = 1100;
// Add desired layers
rasterizationOptions.Layers = Layers.ToArray();
// This one allows the drawing to be in COLOR
rasterizationOptions.DrawType = Aspose.CAD.FileFormats.Cad.CadDrawTypeMode.UseObjectColor;
// Create an instance of PdfOptions
Aspose.CAD.ImageOptions.PdfOptions pdfOptions = new Aspose.CAD.ImageOptions.PdfOptions();
// Set the VectorRasterizationOptions property
pdfOptions.VectorRasterizationOptions = rasterizationOptions;
//Export the DXF to PDF
image.Save(MyDir, pdfOptions);
Aspose.CAD.ImageOptions.PngOptions pngOptions = new Aspose.CAD.ImageOptions.PngOptions();
pngOptions.VectorRasterizationOptions = rasterizationOptions;
image.Save(“test.png”, pngOptions);
test normal.png (7.6 KB)
test vertical stretch.png (37.9 KB)
test.pdf (550.8 KB)
test horizontal stretch.png (36.8 KB)
test low res.png (673 Bytes)