.dxf to .svg conversion is failed

Hello Aspose Team,

We are faced the problem to convert .dxf to .svg. The code is simple:

var img = Image.Load(“ImputFile.dxf”)
CadRasterizationOptions cadRasterizationOptions = new CadRasterizationOptions();
SvgOptions opt = new SvgOptions();
opt.VectorRasterizationOptions = cadRasterizationOptions;
cadRasterizationOptions.DrawType = CadDrawTypeMode.UseObjectColor;
img.Save(“OutputFile.svg”, opt);

Stack trace looks like this:

at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at #=zRhpQEyYMbexiKEJ$B6n4z_BsYPEfkzW1Ay6xqhkoMx3msdFbcQW4AMR$o4Eazg4Z_aaRNdY=.#=zRQhKGox2fPgi(String #=zSiXUiQg=, String #=z_IsUa$U=, Single #=zZwoXhq4=)
at #=zRhpQEyYMbexiKEJ$B6n4z_BsYPEfkzW1Ay6xqhkoMx3msdFbcQW4AMR$o4Eazg4Z_aaRNdY=.#=zul8nXHWNZ9oj(#=zCRzktxSFQynJcYVgGQNh9WSoTbW6xm6Fmqi1OTdhob0zbIBbQ5dq$rHWpUWsuvOPfA== #=zMXsTE40=, String #=zSiXUiQg=)

Could you analyze the problem and suggest a solution? ImputFile.dxf file is attached to this ticket.

Thanks,
Serge
ImputFile.zip (13,2 КБ)

@krserg

It seems you’re encountering an issue while converting a .dxf file to .svg using Aspose.CAD. The stack trace indicates a problem with parsing a number, which could be related to the content of the .dxf file itself.

Here are a few steps you can take to troubleshoot and potentially resolve the issue:

  1. Check the .dxf File: Ensure that the .dxf file is not corrupted and is in a valid format. You can try opening it in a CAD application to verify its integrity.

  2. Update Aspose.CAD: Make sure you are using the latest version of the Aspose.CAD library, as updates often include bug fixes and improvements.

  3. Simplify the Options: Try using default options for the conversion to see if the issue persists. You can modify your code as follows:

    var img = Image.Load("InputFile.dxf");
    img.Save("OutputFile.svg", new SvgOptions());
    
  4. Inspect the Content: If the problem continues, consider inspecting the contents of the .dxf file for any unusual data that might be causing the parsing error.

  5. Contact Support: If none of the above steps resolve the issue, consider reaching out to Aspose support with the .dxf file for further assistance.

If you need more detailed guidance or examples, feel free to ask!

@krserg,
Hello,
thank you for the details, we are able to reproduce the issue, we have logged CADNET-10296 to resolve it.

Thank you @oleksii.gorokhovatskyi !

1 Like