Altered Picture changes

Hi,

I used following code to create images from Excel sheets:
xlsLic.SetLicense(“Aspose.Total.lic”);
CellsHelper.DPI = 96;
Workbook w3 = new Workbook(“Xl_V2.xlsx”);
w3.Settings.CultureInfo = new System.Globalization.CultureInfo(“es-ES”);
Worksheet excelWorksheet = w3.Worksheets[“Hoja1”];
Aspose.Cells.Range range = excelWorksheet.Workbook.Worksheets.GetRangeByName(“BIPLI_PRUEBA_CASCADA”);
string startCell = CellsHelper.CellIndexToName(range.FirstRow, range.FirstColumn);
string endCell = CellsHelper.CellIndexToName(range.FirstRow + range.RowCount - 1, range.FirstColumn + range.ColumnCount - 1);
string rangeAddress = string.Format("{0}:{1}", startCell, endCell);

        ImageOrPrintOptions options = new ImageOrPrintOptions();
        options.AllColumnsInOnePagePerSheet = true;
        options.ImageType = Aspose.Cells.Drawing.ImageType.Emf;
        //options.ImageFormat = ImageFormat.Emf;
        options.OnePagePerSheet = true;
        options.HorizontalResolution = 600;
        options.VerticalResolution = 600;
        options.OnlyArea = true;

        Aspose.Cells.PageSetup pageSetup = excelWorksheet.PageSetup;


        pageSetup.PrintArea = rangeAddress;
        using (MemoryStream imageStream = new MemoryStream())
        {
            SheetRender sr = new SheetRender(excelWorksheet, options);
            sr.ToImage(0, imageStream);
            Image.FromStream(imageStream).Save("PRUEBA_CASCADA.png", ImageFormat.Emf);

        };

With Apose Cells 21.5 it was fine but with 23.3, the image is shrinked and and the image has a very big white border. I have attached the workbook and images: files.zip (377.6 KB)

It is a bug or it is a new ‘feature’. How can I look like before.

Regards,
@Nachti

@Nachti,
Through testing, we were able to reproduce the issue and found that there were excessive white spaces during SheetRender rendering.
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSNET-53553

@John.He

is there any workaround to get a better result ?

@Nachti

We changed the logic to output margins when both options.OnePagePerSheet and options.OnlyArea are set to true.

Please use the following code to set margins to zero, the image dimension will be same as the one of v21.5.

...

Aspose.Cells.PageSetup pageSetup = excelWorksheet.PageSetup;


pageSetup.PrintArea = rangeAddress;

//set margins to zero.
pageSetup.LeftMargin = 0;
pageSetup.RightMargin = 0;
pageSetup.TopMargin = 0;
pageSetup.BottomMargin = 0;

...