Aspose creates massive Emf file

Hi,

Running the following code:

        var book = new Workbook("test.xlsx");
        Worksheet sheet = book.Worksheets[1];
        var options = new ImageOrPrintOptions
        {
            ImageFormat = ImageFormat.Emf,
            OnePagePerSheet = true,
            
        };
        new SheetRender(sheet, options).ToImage(0, "apose.emf");

Produces an Emf file that is 46MB!
Doing the same using Excel (copy as Picture) creates a 1MB file.

This is an exaggerated example but I have noticed similar size differences on more reasonable sheets.

Test.zip (146.4 KB)

@ServerSide527,

Thanks for the template file and sample code.

After an initial test, I observed the issue as you mentioned by using your sample code with your template file. I found that Aspose.Cells creates big EMF file when rendering Sheet to image file. The output EMF file’s size is 46MB which more than expected. I guess the size might be due to “OnePagePerSheet” attribute which sets the big sheet (having 27 pages) into one in your code.

I have logged a ticket with an id “CELLSNET-45512” for your issue. We will look into it soon.

Once we have an update on it, we will let you know here.

Thank you.

@ServerSide527,

Please try our latest fix/version: Aspose.Cells for .NET v17.7.2:

The generated EMF file size is reduced from over 40M to 8M or so in this fix.

Let us know your feedback.

Thank you.

The issues you have found earlier (filed as CELLSNET-45512) have been fixed in latest version of Aspose.Cells for .NET (Download | NuGet).