Hi,
Rendering part of excel file gives incorrect result for attached file. For print area “A1:D18”, the result image is cropped and has much left margin. When I set area “B1:D18” result image is empty (white).
My code is as follows :
Aspose.Cells.Workbook wb = new Aspose.Cells.Workbook(@“C:\TEMP\test4\t1.xls”);
Aspose.Cells.Rendering.ImageOrPrintOptions imgOptions = new Aspose.Cells.Rendering.ImageOrPrintOptions();
imgOptions.HorizontalResolution = 96;
imgOptions.VerticalResolution = 96;
imgOptions.ImageFormat = System.Drawing.Imaging.ImageFormat.Jpeg;
imgOptions.OnePagePerSheet = true;
imgOptions.AllColumnsInOnePagePerSheet = true;
Aspose.Cells.Worksheet sheet = wb.Worksheets[1];
sheet.PageSetup.PrintArea = “A1:D18”;
Aspose.Cells.Rendering.SheetRender sr = new Aspose.Cells.Rendering.SheetRender(sheet, imgOptions);
System.Drawing.Bitmap bitmap = sr.ToImage(0);
bitmap.Save(@“C:\TEMP\test4\sonuc6.png”, System.Drawing.Imaging.ImageFormat.Png);
Thank you,