Hi,
We are having an issue with Aspose Cells Version 5.2.2.1. We have a spreadsheet that we are trying to print to a bitmap image. The sheet has a header row where all headers are formatted as centered. When we print the sheet to an image using the code below, two of the headers are shifted to the left in the bitmap. We need an explanation as to why this is happening, and a fix for the problem. I have attached an example of the spreadsheet and an example of the jpg file.
Thanks,
Steve
Aspose.Slides.License lic = new Aspose.Slides.License();
lic.SetLicense("Aspose.Total.Lic");
Aspose.Cells.License cellLic = new Aspose.Cells.License();
cellLic.SetLicense("Aspose.Total.Lic");
Workbook book = new Workbook(@"c:\development\worksheet.xlsx");
Aspose.Cells.Worksheet sheet = book.Worksheets[0];
sheet.PageSetup.PrintArea = "A1:" + "S3";
sheet.PageSetup.Orientation = PageOrientationType.Landscape;
sheet.PageSetup.PaperSize = PaperSizeType.PaperLetter;
sheet.PageSetup.FitToPagesTall = 1;
sheet.PageSetup.FitToPagesWide = 1;
sheet.PageSetup.TopMarginInch = 0;
sheet.PageSetup.BottomMarginInch = 0;
sheet.PageSetup.RightMarginInch = 0;
sheet.PageSetup.LeftMarginInch = 0;
sheet.PageSetup.HeaderMarginInch = 0;
sheet.PageSetup.FooterMarginInch = 0;
sheet.PageSetup.CenterHorizontally = false;
sheet.PageSetup.CenterVertically = false;
sheet.PageSetup.PrintQuality = 300;
Aspose.Cells.Rendering.ImageOrPrintOptions imgOptions = new Aspose.Cells.Rendering.ImageOrPrintOptions();
imgOptions.ImageFormat = ImageFormat.Jpeg;
imgOptions.HorizontalResolution = 600;
imgOptions.VerticalResolution = 500;
imgOptions.OnePagePerSheet = true;
imgOptions.IsImageFitToPage = true;
Aspose.Cells.Rendering.SheetRender sheetRenderer = new Aspose.Cells.Rendering.SheetRender(sheet, imgOptions);
Bitmap bitmap = sheetRenderer.ToImage(0);
bitmap.Save("c:\\development\\ExcelImage.jpg");
bitmap.Dispose();
bitmap = null;