Aspose.CAD .NET 6 C# Saved DXF comes out as corrupt

So I am simply trying to save a DXF to DXF no modifications.

I was able to convert it to PDF just fine and modify the DXF as needed, but I also need to be able to save it as DXF again.

From all the examples I can see it should be as easy as

using (CadImage cadImage = (CadImage)Aspose.CAD.FileFormats.Cad.CadImage.Load("oldFilePath.dxf")) {

 cadImage.Save("new.dxf");              

}

I have tryied to add in the DxfOptions object, but the file is still corrupted and ~50% larger.

DxfOptions dfxOptions = new Aspose.CAD.ImageOptions.DxfOptions();
cadImage.Save("new_4.dxf", dfxOptions);

Could you please show me how to save an existing DXF to a DXF.

@idra,
Hi.
Could you please attach the initial DXF here so we can test it on our side?

here is the problematic file _DXFs.zip (360.0 KB)

I also included a working file, “test.dxf” that I got working by switching to a file stream

                DxfOptions dfxOptions = new Aspose.CAD.ImageOptions.DxfOptions();

                // //dfxOptions.VectorRasterizationOptions = rasterizationOptions;

                using(FileStream outputFileStream = new FileStream(@"path\new_7.dxf", FileMode.CreateNew)) {  

                    cadImage.Save(outputFileStream, dfxOptions);

                }

I am using v23.4.0 eval

@idra

I can confirm this 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-9136

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Could you please confirm if this would be fixed via HOTFIX or normal bugfix que.

@idra,
this will be fixed according to Free Support Policies and queue of tasks we have now. We will be happy to deliver it as soon as we can but for now we don’t know yet the complexity of the fix.

1 Like