Hello,
I need to generate images from a DXF. I use the following code to generate the images:
The Layouts is a string array: “L1A3”, “L2A3”
var menoryStreams = new List<MemoryStream>();
customPlanStream.Position = 0;
using (var cadImage = (CadImage) Aspose.CAD.Image.Load(customPlanStream))
{
foreach (var layout in layouts)
{
var rasterOptions = new CadRasterizationOptions
{
PageWidth = 2600F * 3, //cadImage.Width
PageHeight = 2100F * 3, //cadImage.Height
AutomaticLayoutsScaling = true,
ExportAllLayoutContent = true,
DrawType = CadDrawTypeMode.UseObjectColor,
Margins = new Margins() { Top = 0, Bottom = 0 },
Quality = new RasterizationQuality
{
Arc = RasterizationQualityValue.High,
Hatch = RasterizationQualityValue.High,
Text = RasterizationQualityValue.High,
TextThicknessNormalization = true
},
Layouts = new string[] { layout }
};
var imageOptions = new JpegOptions
{
VectorRasterizationOptions = rasterOptions,
ColorType = JpegCompressionColorMode.Grayscale,
};
var output = new MemoryStream();
cadImage.Save(output, imageOptions);
output.Position = 0;
menoryStreams.Add(output);
}
customPlanStream.Position = 0;
return menoryStreams;
}
And give me the following error:
“Image export failed. Parameter is not valid”
error.png (63.6 KB)
The plan is:
plan.zip (1.6 MB)
Thanks for your help!