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