Hi,
Following is our code sample that throws ArgumentException (Parameter is not valid.):
ImageOrPrintOptions imgOptions = new ImageOrPrintOptions();
imgOptions.ImageFormat = ImageFormat.Tiff;
imgOptions.HorizontalResolution = 200;
imgOptions.VerticalResolution = 200;
imgOptions.TiffCompression = TiffCompression.CompressionCCITT4;
imgOptions.PrintingPage = PrintingPageType.IgnoreBlank;
Workbook book = new Workbook();
book.Open("excel.xls");
for (int i = 0; i < book.Worksheets.Count; i++)
{
Worksheet sheet = book.Worksheets[i];
SheetRender sr = new SheetRender(sheet, imgOptions);
int sheetPageCount = sheet.GetPageCount(imgOptions.PrintingPage);
for (int j = 0; j < sheetPageCount; j++)
{
sr.ToImage(j, "image" + j.ToString() + ".tif");
}
}
We changed above code to use emf format instead (following your code):
ImageOrPrintOptions imgOptions = new ImageOrPrintOptions();
imgOptions.ImageFormat = ImageFormat.Emf; // changed to emf
imgOptions.HorizontalResolution = 200;
imgOptions.VerticalResolution = 200;
imgOptions.TiffCompression = TiffCompression.CompressionCCITT4;
imgOptions.PrintingPage = PrintingPageType.IgnoreBlank;
Workbook book = new Workbook();
book.Open("excel.xls");
for (int i = 0; i < book.Worksheets.Count; i++)
{
Worksheet sheet = book.Worksheets[i];
SheetRender sr = new SheetRender(sheet, imgOptions);
int sheetPageCount = sheet.GetPageCount(imgOptions.PrintingPage);
for (int j = 0; j < sheetPageCount; j++)
{
sr.ToImage(j, "image" + j.ToString() + ".emf"); // changed to emf
}
}
Attached resulting emf images shows:
1) Horizontal Resolution = 81 dpi (should be 200 dpi)
2) Vertical Resolution = 81 dpi (should be 200 dpi)
3) Bit Depth = 32 (should be 1 since CCITT4)
4) Image is shrunk to left upper corner
5) Page 3 (merge_image2.emf), 1st Cell shows 'Customs Release 3461' with 'C' cutoff (Should word wrap '3461' to next line)
6) Page 4 (merge_image3.emf) is blank with SheetRender.ToImage() with SheetToImageByPage() it was only omitting merged cells
7) HangingFile.xls doesn't hang with SheetRender.ToImage() but still hangs with SheetToImageByPage()
We DO NOT want to waste time debugging and testing your new SheetRender class.
We need tif images (not emf) with 200 dpi black&white (CCITT4).
Please FIX SheetToImageByPage() function instead to save our time.
Need this fix asap.
Thank You!
Attached files:
merge_image0.emf, merge_image1.emf, merge_image2.emf, merge_image3.emf from MergedCells.xls
hang_image0.emf from HangingFile.xls
*.xls previously attached to post 225103 (1st in this thread)