Out of mem exception while converting CDR file to PDF using aspose imaging .net (ver 20.11) library

Hello,

I am trying to convert a CDR file to PDF using aspose imaging .net library(20.11). Getting out of memory exception while converting the file.

File link : test.cdr - Google Drive

Exception details:
Aspose.Imaging.CoreExceptions.ImageLoadException: Image loading failed. —> System.OutOfMemoryException: Exception of type ‘System.OutOfMemoryException’ was thrown.
at System.IO.MemoryStream.set_Capacity(Int32 value)
at System.IO.MemoryStream.EnsureCapacity(Int32 value)
at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at ?? .?? , Int32 , Boolean )
at ?? .?? , CdrObject , Int32[] )
at ?? .?? , CdrObjectContainer , Int32[] )
at ?? .?? , CdrObject , Int32[] )
at ?? .?? )
at ?? .()
at Aspose.Imaging.FileFormats.Cdr.CdrImage…ctor(Stream stream, LoadOptions loadOptions)
at  .Load(StreamContainer , LoadOptions )
at Aspose.Imaging.Image.(StreamContainer , LoadOptions )
— End of inner exception stack trace —
at Aspose.Imaging.Image.(StreamContainer , LoadOptions )
using (var img = Aspose.Imaging.Image.Load(filePath + “.cdr”))
{
CdrRasterizationOptions rasterizationOptions = new CdrRasterizationOptions();
rasterizationOptions.PageWidth = img.Width;
rasterizationOptions.PageHeight = img.Height;
// Save image to Pdf
PdfOptions exportOptions = new PdfOptions();
exportOptions.VectorRasterizationOptions = rasterizationOptions;
img.Save(filePath + “.pdf”, exportOptions);
return filePath + “.pdf”;
}

Am using the following code to convert file:

@vvorld

A ticket with ID IMAGINGNET-4262 has been created in our issue tracking system to investigate and resolved the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.

The issues you have found earlier (filed as IMAGINGNET-4262) have been fixed in this update. This message was posted using Bugs notification tool by mudassir.fayyaz

Issue is still not resolved. Still getting out of mem exception tried with 21.3 version with the file shared in link.

@vvorld

Can you pease try following sample code on your end. Also, earlier the ticket was added for dealing with ImageLoad exception on loading the CDR. Now, you are sharing that OutOfMemory Exception is thrown. Can you please share the source file with us.

string baseFolder = @"D:\";
string fileName = "test.cdr";
string inputFilePath = Path.Combine(baseFolder, fileName);
string outputFilePath = inputFilePath + ".png";
using (CdrImage image = (CdrImage)Image.Load(inputFilePath))
{
      image.Save(outputFilePath, new PngOptions());
}