CAD file will be converted to the image format, and found that some of the documents will be converted into a blank picture, there are some direct conversion process failure, what is the reason, thank you
Here’s my code:
using (Aspose.CAD.Image image = Aspose.CAD.Image.Load(filePath))
{
Aspose.CAD.ImageOptions.CadRasterizationOptions
rasterOpts = new Aspose.CAD.ImageOptions.CadRasterizationOptions();
var scaleType = Aspose.CAD.FileFormats.Cad.ScaleType.None;
var PageWidth = (float)image.Width;
var PageHeight = (float)image.Height;
if (image.Width > 50000 || image.Height > 50000)
{
if (image.Width > image.Height)
{
PageWidth = 50000;
PageHeight = (float)image.Height / (float)image.Width * 50000;
}
else
{
PageHeight = 50000;
PageWidth = (float)image.Width / (float)image.Height * 50000;
}
scaleType = Aspose.CAD.FileFormats.Cad.ScaleType.ShrinkToFit;
}
rasterOpts.PageHeight = PageHeight;
rasterOpts.PageWidth = PageWidth;
rasterOpts.ScaleMethod = scaleType;
rasterOpts.BackgroundColor = Aspose.CAD.Color.White;
rasterOpts.AutomaticLayoutsScaling = true;
rasterOpts.CenterDrawing = true;
rasterOpts.DrawType = Aspose.CAD.FileFormats.Cad.CadDrawTypeMode.UseObjectColor;
rasterOpts.TypeOfEntities = Aspose.CAD.ImageOptions.TypeOfEntities.Entities2D;
Aspose.CAD.ImageOptionsBase opts = new Aspose.CAD.ImageOptions.BmpOptions();
opts.VectorRasterizationOptions = rasterOpts;
image.Save(outputPath, opts);
}
I uploaded 3 files, including demo.dwg files converted to blank images, the other two failed in the conversion process, please help to deal with, thank you.
The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for JasperReports 18.3 update.