Free Support Forum -

Some DXF files trigger the exception: "Image loading failed: Invalid group code" (.NET ASPOSE.CAD 20.6.0, 20.7.0, 20.9.1)

Issue description:
For some DXF files the library .NET ASPOSE.CAD (version 20.6.0-20.9.1) throws the following exception:
Image loading failed: Invalid group code

Versions which present this issue:
.NET ASPOSE.CAD 20.6.0 - 20.9.1

Code snippet for testing:
using (Aspose.CAD.FileFormats.Cad.CadImage cadImage = (Aspose.CAD.FileFormats.Cad.CadImage)Aspose.CAD.Image.Load(filename))
Aspose.CAD.Rectangle rect = cadImage.Bounds;
var options = new Aspose.CAD.ImageOptions.JpegOptions();
Aspose.CAD.ImageOptions.CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions()
BackgroundColor = Aspose.CAD.Color.White,
PageHeight = 1000,
PageWidth = 1000,
DrawType = Aspose.CAD.FileFormats.Cad.CadDrawTypeMode.UseObjectColor
options.VectorRasterizationOptions = rasterizationOptions;

// save DXF as a JPEG 
cadImage.Save(Path.GetDirectoryName(filename) + "\\" + Path.GetFileNameWithoutExtension(filename) + ".jpg", options);


File DXF for testing: see attachment (59.1 KB)


I have opened a ticket with ID CADNET-1221 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 notified once the issue will be fixed.

Any news about this issue?


The issue has been marked for review in upcoming Aspose.CAD for .NE 20.12. We request for your patience and will share the good news with you as soon as the issue will be addressed.