Free Support Forum - aspose.com

SheetToImageByPage() Bug!

Hi,

We are using Aspose.Cells.dll (4.8.2.1) and currently having 2 issues.

1) SheetToImageByPage() is omitting some rows with merged columns in excel sheet.
Attached Sample "MergedCells.xls" and resulting "image3.tif" showing missing data:
A:97, A:103-107

2) SheetToImageByPage() hangs with some excel sheet.
Attached Sample "HangingFile.xls"

Above 2 issues were reproducible with following code we use:


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];

int sheetPageCount = sheet.GetPageCount(imgOptions.PrintingPage);
for (int j = 0; j < sheetPageCount; j++)
{
sheet.SheetToImageByPage(j, "image" + j.ToString() + ".tif", imgOptions);
}
}


This code is used in production environment and we need fix asap.

Please let us know what you find.

Thank You!

Hi,

Thank you for sharing the template files.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

We have found your mentioned issues after an initial test. We will look into them and get back to you soon. Your issue has been registered in our internal issue tracking system with issue id CELLSNET-14848.

Thank You & Best Regards,

I need to get some ETA for when this issue is expected to be addressed. These two problems are being raised by a major client of ours and we need to get the problem resolved in their production system. Is there anything we can do to make sure this issue is addressed by the next build of aspose.cells and a confirmation that it will be addressed?

Thank you,

Robert<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Hi,

We are re-factoring the Sheet to Image module, we will provide a fix for your issues in the next week.

Thanks for your understanding!

That is great news. We are looking forward to the update. Thank you.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Hi,

Do you have a fix for us yet?

It is almost a week since your previous post.

Thanks.

Hi,

To update you, we are still working on Sheet -to- Image module. The task is not completed yet, hopefully, we can complete it in the next week or so.

Thanks for your understanding!

Hello,

Do you have any update?

Thank You.

Hi,

Your issue is not resolved yet, we are working on it. We will inform you here, when it is sorted out.

Sorry for any inconvenience caused.


Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Please try the attached latest version of Aspose.Cells. Please see the following sample code in this regard:

Workbook workbook = new Workbook();

workbook.Open("C:\\book1.xls");

foreach (Worksheet ws in workbook.Worksheets)

{

ImageOrPrintOptions imageoption = new ImageOrPrintOptions();

imageoption.ImageFormat = System.Drawing.Imaging.ImageFormat.Emf;

SheetRender sr = new SheetRender(ws, imageoption);

for (int i = 0; i < sr.PageCount; i++)

{

sr.ToImage(i, "C:\\image" + i + ".emf");

}

}

Also, you should set font of cells which contain Traditional Chinese as corresponding font (such as MingLiu not Arial), otherwise the Chinese will be shown as blocks.

Thank You & Best Regards,

Hello Aslam,

Thank you for the update. I noticed that your example uses the EMF format. I wasn't sure if that was just as an example or a new requirement. Is EMF a new requirement or will this update still work with TIFF output format as well?

Thanks,

Robert

Hi,

Thank you for the feedback.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

We have found an issue in generating tiff image after an initial test. We will look into it and get back to you soon. Your issue CELLSNET-14848 has been reopened.

Thank You & Best Regards,

Hi,

We DO NOT want to use new SheetRender class since it contains MORE bugs!

(Image result is terrible with 81 dpi for emf format)

PLEASE FIX SheetToImageByPage() function instead.

Thank You!

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Hi,

Thank you for the feedback.

Please share the output files and sample code to show the issues. This will help us figure out the issues soon.

Thank You & Best Regards,

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)

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for the feedback.

We will look into you issues and get back to you soon.

Thank You & Best Regards,

Hello,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

I know you just received the sample code today, but can you provide us a date for when this issue will be resolved? Our customer is getting very restless.

Thank you,

Robert

Hello,

I reported issues with SheetToImageByPage() on 3/3/2010 and it is now end of the month. Our customer is getting antsy and asking for an ETA for a fix to reported issues.

I DO NOT care if SheetRender.ToImage() doesn't work as reported in post 230078.

I NEED a fix ASAP for SheetToImageByPage() as reported initially in post 225103.

Please fix the original problems reported in SheetToImageByPage() FIRST since debugging newly created SheetRender Class will take longer.

Please provide us an ETA so that we can tell our customer.

Thank You!

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Please try the attached latest version of Aspose.Cells. We have fixed the issue regarding SheetToImageByPage().

Thank You & Best Regards,

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Please try the attached latest version of Aspose.Cells for .NET. We have also fixed the reported SheetRender Issues.

Thank You & Best Regards,