I have a speadsheet that when converted to an image displays boxes in an area that should contain empty rows and columns. The upper part contains text and displays correctly, but then random areas on the lower part contains just boxes. I have attached the dummy spreadsheet showing the problem, a PDF produces by printing from Excel, and a PDF printed from my application that shows the image produced. The setting that I am using are:
msExcelImageOrPrintOptions = new ImageOrPrintOptions();
msExcelImageOrPrintOptions.ImageFormat = ImageFormat.Bmp;
msExcelImageOrPrintOptions.PrintingPage = PrintingPageType.IgnoreBlank;
msExcelImageOrPrintOptions.HorizontalResolution = 300;
msExcelImageOrPrintOptions.VerticalResolution = 300;
and the code to produce the images is:
msExcelWorkbook.Worksheets[i].PageSetup.PaperSize = PaperSizeType.Paper9x11;
msExcelWorkbook.Worksheets[i].PageSetup.PrintGridlines = true;
SheetRender sheetRender = new SheetRender(msExcelWorkbook.Worksheets[pageEntry.WorkSheetIndex], msExcelImageOrPrintOptions);
Bitmap bitmap = sheetRender.ToImage(pageEntry.WorkSheetPageIndex);
The attached zip file contains the PDF and XLS file.
I have tried a number of different settings, but the results stay the same.
Thank you,
Jeff