DXF to PDF Conversion Error

Hello,
When updating Aspose CAD-NET from 21.12.0 to the latest version, 22.9.0, I’m receiving a conversion error.

What’s strange is that when I create a new console project in VisualStudio and try to convert the same Dxf file with the same version of Aspose CAD-NET, it works fine.

Attached, you’ll find a screenshot of the error message, the sample dxf file that fails in one project, but works in another project and a sample code snippet of the conversion we’re doing. This is the same snippet used in both projects. One is WPF .NET Framework based (not working) and the other is a simple .NET Framework Console App (working).

Unfortunately, I can’t provide full source of the failing project due to the size of the project and the proprietary nature of it.

HelpTicketFiles.zip (28.5 KB)

Please advise,
Thank You
Kevin

@kgrems,
Hello. We will try to reproduce and fix this on our side in scope of CADNET-8853.

1 Like

Thanks. Just so it’s said, the conversion worked fine with the previous version of CAD-NET that we’d been using (21.12.0). It’s only after updating that it’s failing for some reason.

1 Like

@kgrems,
probably, you can create just some “Hello, World” application that fails with this file and example on your side?

Unfortunately, I’ve tried and can’t get it to fail using the same Dxf in a “Hello World” example. That’s why I’m so confused.

@kgrems,
got it, let us try to reproduce.

1 Like

@kgrems,
Hello. Unfortunately, we can not reproduce this yet. Probably, you could localize it better, so we can reproduce? Do you have reference to System.Text.Encoding.CodePages? Could you try previous versions, not only latest? Can you cut off parft of the project with the error? Can you reproduce this issue for all files or only for just some of them? We do not see problems with this file at the moment.

As I mentioned above, it worked fine in our app on an older version (21.12.0). The only thing that changed was updating the NuGet package to the latest version (22.9.0) and we get the error message attached above.

I can’t isolate much more because the same code is used in our “main” app (that doesn’t work) and a test app (that does work). I haven’t tried your sample project yet though and will give that a shot soon.

It looks like your sample app successfully converted the dxf file. Where should I go from here?

I did notice that in our app, it’s failing on the “Aspose.CAD.Image.Load(path)” part and not the “image. Save();” part

I believe I’ve found the issue. When upgrading from 21.12.0 to the latest version, the dependency you mentioned (System.Text.Encoding.CodePages) doesn’t get brought in automatically.

I removed the Aspose package from your sample app, then reinstalled the older version we’re using. I then upgraded to the latest version and get an error due to the CodePages library not getting installed automatically. I manually added CodePages and it works fine in your sample app and in the “real” app I’m working on.

Thanks for the assistance.

1 Like

@kgrems,
glad to hear the problem is resolved.