I get the following error with the attached dwg file. I can view the file with no problem using several viewers including the OpenDesign viewer but using Aspose CAD it bails out at the saving/exporting stage.
2017/05/25 17:10:14.822 EXCEPTN [29] Services.DataService.CAD.CADDocRenderer Render - System.NullReferenceException from Aspose.CAD
2017/05/25 17:10:14.823 EXCEPTN [29] Services.DataService.CAD.CADDocRenderer Render - Object reference not set to an instance of an object.
2017/05/25 17:10:14.824 EXCEPTN [29] Services.DataService.CAD.CADDocRenderer Render - at ? .(CadMLeader , ? , Single , ApsCanvas , List1 , )
at ? .( , , ImageOptionsBase )
at ? .? ? (ImageOptionsBase , Int32 )
at .[T](Image , ? , ICollection`1 , Stream , ImageOptionsBase , Rectangle )
at ? .Export(Image , Stream , ImageOptionsBase , Rectangle )
at Aspose.CAD.Image.jd3e6ze6d4bq8slwvmklfafdjn7dzqla? (Stream , ImageOptionsBase , Rectangle )
2017/05/25 17:10:14.825 EXCEPTN [29] Services.DataService.CAD.CADDocRenderer Render - Aspose.CAD.CadExceptions.ImageSaveException from Aspose.CAD
2017/05/25 17:10:14.826 EXCEPTN [29] Services.DataService.CAD.CADDocRenderer Render - Image export failed.
2017/05/25 17:10:14.827 EXCEPTN [29] Services.DataService.CAD.CADDocRenderer Render - at Aspose.CAD.Image.jd3e6ze6d4bq8slwvmklfafdjn7dzqla? (Stream , ImageOptionsBase , Rectangle )
at Aspose.CAD.Image.Save(Stream stream, ImageOptionsBase optionsBase, Rectangle boundsRectangle)
at Aspose.CAD.Image.jd3e6ze6d4bq8slwvmklfafdjn7dzqla? (String , ImageOptionsBase , Rectangle )
2017/05/25 17:10:14.828 EXCEPTN [29] Services.DataService.CAD.CADDocRenderer Render - Aspose.CAD.CadExceptions.ImageSaveException from Aspose.CAD
2017/05/25 17:10:14.829 EXCEPTN [29] Services.DataService.CAD.CADDocRenderer Render - Image saving failed.
2017/05/25 17:10:14.829 EXCEPTN [29] Services.DataService.CAD.CADDocRenderer Render - at Aspose.CAD.Image.jd3e6ze6d4bq8slwvmklfafdjn7dzqla? (String , ImageOptionsBase , Rectangle )
at Aspose.CAD.Image.Save(String filePath, ImageOptionsBase options, Rectangle boundsRectangle)
at Aspose.CAD.Image.Save(String filePath, ImageOptionsBase options)
at Services.DataService.CAD.CADDocRenderer.Render() in C:\Workspace\6.2Patch\Source\Services\REST\DataService\Viewer Other Renderers Support\CADRenderer.cs:line 69
Iām specifying only the model, no layouts.
Here is the code used:
using (Aspose.CAD.Image image = Aspose.CAD.Image.Load(inputDrawing))
{
Aspose.CAD.ImageOptions.CadRasterizationOptions rasterizationOptions = new Aspose.CAD.ImageOptions.CadRasterizationOptions();
rasterizationOptions.PageWidth = 800;
rasterizationOptions.PageHeight = 1100;
rasterizationOptions.BackgroundColor = Aspose.CAD.Color.White;
rasterizationOptions.DrawType = Aspose.CAD.FileFormats.Cad.CadDrawTypeMode.UseObjectColor;
rasterizationOptions.Layouts = null;
//var imageOptions = new Aspose.CAD.ImageOptions.TiffOptions(Aspose.CAD.FileFormats.Tiff.Enums.TiffExpectedFormat.TiffNoCompressionRgb);
var imageOptions = new Aspose.CAD.ImageOptions.JpegOptions();
imageOptions.VectorRasterizationOptions = rasterizationOptions;
image.Save(tempFile, imageOptions);
}
Any ideas what in the file is causing this behavior?
Thanks,
Felix Lopez-Phillips
Senior Software Engineer
DOCUPHASE
+1.727.441.8228
āhttp://www.docuphase.comā