Image.Save() Generates corrupt file

I am using Aspose.CAD V 23.12.0 as part of a .NET 8.0 Windows form - C#

Sadly, whenever I try to save an .dwg file using Image.Save() the file is unable to be opened by the viewer application (prior to saving it could open it).

I created a simple test function to achieve this where I make no alteration to the file itself, like this:

        void SaveFile()
        {
            using (var image = Aspose.CAD.Image.Load(selectFile.FileName))
            {
                image.Save();
                //image.Save(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "output.dwg"));
            }
        }

You can see in the above code that I commented out the line where I save it as a new file instead of just saving it; Both attempts ended in the same result - The file cannot be opened by the viewer.

Is there a known issue saving .dwg files?

@Wahida_Massan,
unfortunately, some issues may appear during saving to DWG and we work on the improvements and fixes for this. Sometimes it is possible to open files after recovering in viewer, sometimes not. It would be helpful if you can attach your initial DWG here so we can analyze the reasons of such cases and plan proper fixes.

Thank you very much for the quick reply, very much appreciated.
Sadly I cannot publically post the example files - But could send one privately?

@Wahida_Massan,
please send it here:

1 Like

@Wahida_Massan
I can confirm the issue, we have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CADNET-9610
1 Like

Thank you very much!

1 Like