Object Reference error converting from DWG to Tif/jpg/bmp or PDF

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 ? .(CadBaseEntity[] , List1 , , String , CadEntityTypeName[] )
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ā€

Hi Felix,

I have observed the sample code and information shared by you. Can you please verify, if you have shared the source file as I am unable to find that. Please share the requested information so that we may proceed further on our end. Please also try using Aspose.CAD for .NET 17.4 on your end as well if you are using some other version.

Many Thanks,

Ooops..Just attached it.

Thx

Hi Felix,

I have worked with DWG file shared by you and have been able to observe the issue specified. An issue with ID CADNET-352 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be automatically notified once the issue will be fixed.

We are sorry for your inconvenience,

The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for JasperReports 18.3 update.