We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Image loading failed: Can not read an image.The structure of the file is unexpected

We have problems when we try to open a DXF file with the following code:

using (var dxfFile = (CadImage) Image.Load(dxfFileStream))

You can see the exception in the attached image in this topic.

We’re using Aspose.CAD for NET v20.6.0. We want to get a license for Aspose.CAD, but we need this problem to be solved.

I saw a similiar issue in this thread:


exception.PNG (37.8 KB)


Please provide the source DXF file that you are trying to load and which is failing so that we may investigate that further to help you out.

Hello @mudassir.fayyaz
I send you the DXF File.


cantopen (304.0 KB)


A ticket with ID CADNET-1172 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 notified once the issue will be fixed.

Any news with this issue?



Can you please try using latest Aspose.CAD for .NET 20.7 on your end as no issue has been observed using that.

image.png (13.7 KB)

Hi, @mudassir.fayyaz

I just updated Aspose.CAD for .NET 20.7. It works!

Thank you very much for your time.


It’s good to know that suggested option worked.

The issues you have found earlier (filed as CADNET-1172) have been fixed in this update.