Hi, team.
I simply converting dwg to svg.
There’s an error in the code below.
and why can access under Windows/Temp?
Aspose.CAD version: 23.8,
dotnet sdk: .net7
public static byte[] ConvertToSimpleSVG(Stream dwgFileStream)
{
using MemoryStream svgFileStream = new MemoryStream();
using CadImage image = (CadImage) Image.Load(dwgFileStream);
CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions()
{
PageWidth = image.Width,
PageHeight = image.Height,
ExportAllLayoutContent = true,
AutomaticLayoutsScaling = false,
};
image.Save(svgFileStream, new SvgOptions()
{
VectorRasterizationOptions = rasterizationOptions
});
return svgFileStream.ToArray();
}
System.AggregateException: One or more errors occurred. (Image export failed. The type initializer for ‘#=zjxpYVJbkJYYPXmlTUArhCwNr1jeJ’ threw an exception.)
—> Aspose.CAD.CadExceptions.ImageSaveException: Image export failed. The type initializer for ‘#=zjxpYVJbkJYYPXmlTUArhCwNr1jeJ’ threw an exception.
—> System.TypeInitializationException: The type initializer for ‘#=zjxpYVJbkJYYPXmlTUArhCwNr1jeJ’ threw an exception.
—> System.IO.IOException: Access to the path ‘\?\C:\WINDOWS\TEMP\TempFonts\0f7f1e79-9b61-4a9b-a0aa-4ac9e6a4f5dd’ is denied.
There was definitely an “image export failed” yesterday, but today it’s all working fine with testApp, my services, and debugging environments. However, the same pause as the linked problem is occurring in some files.
Customers are pointing out the problem of a rapid increase in memory and cpu when this phenomenon occurs. The files should be delivered directly by the customer company as they were last time. Should I send it to the same email address?
Thanks. I’ve asked my client to provide the file to Aspose.
There was an opinion from the customer’s side that the cpu share soared to 90%, and later, it continued to occupy the 20% range, but the problem was not confirmed by me.
However, the problem of excessive memory increase for the problematic drawing has been identified, so I would appreciate it if you could check it together.
The image below identifies a memory surge before and after calling the “Image.Load” function and over time. (test file size 300kb)
@Heewoong_Lee,
Hello.
Wanted to note that we have found the same export error for one other issue and the reason was access rights to that folder that is used to work with fonts. You also mentioned about some memory/cpu usage problem but I didn’t see that drawing file from you, is that issue relevant?
I also couldn’t see the cpu problem even in the local environment.
However, the customer’s window server consistently confirmed that the memory usage in the range of 20-90%.
we have identified a problem with memory usage while “Image.load” has not been completed since the start of the “Image.load” as attached to the link above.
Can’t check the memory problem?
@Heewoong_Lee,
Hello.
Thank you for kind words.
I have received pair of files yesterday and we checked them. We don’t see any CPU or memory issues now with them, we have tested for macOS too. Now we guess the issue may arise because previous versions of library are used (likely) or because of environment difference. We test all using the latest version Aspose.CAD 23.9. Could you please take a look whether the problem persists for it? Difference in test code sample may affect too. Could you please create some empty project with the conversion code so we can just add test files there, run it and observe the issue?