SheetToImageByPage() Bug: Output Image is shrunk. Not readable

Hello,

We are using Aspose.Cells to convert xls to tiff and it's been working fine.

We ran into this issue recently where attached xls file converted to attached tif file; image is not readable.

Following is set before SheetToImageByPage() call:

ImageOrPrintOptions imgOptions = new ImageOrPrintOptions();

imgOptions.ImageFormat = ImageFormat.Tiff;

imgOptions.HorizontalResolution = 200;

imgOptions.VerticalResolution = 200;

imgOptions.TiffCompression = TiffCompression.CompressionCCITT4;

imgOptions.PrintingPage = PrintingPageType.IgnoreBlank;

Then following code is used to generate images:

int sheetPageCount = sheet.GetPageCount(imgOptions.PrintingPage);

for (int j = 0; j < sheetPageCount; j++)

sheet.SheetToImageByPage(j, "Image" + j + ".tif", imgOptions);

This issue was initially found with Aspose.Cells.dll (v 4.8.0.5) and was reproduced in latest Aspose.Cells.dll (v 4.8.1.0).

It looks like setting in 'Page Setup' causes this issue:

1) Fit to: 1 page(s) wide by 1 tall

2) Print area: A:K

Please review attached files & provide us a fix ASAP. Urgent customer request!

Thank You.

Hi,

Thank you for considering Aspose.

I tried your code and template file with the attached latest version and it works fine. Please see the attached output file. Please try the attached latest version and let us know if it works fine for you.

Workbook wb = new Workbook();

wb.Open("C:\\Sample.xls");

Worksheet sheet = wb.Worksheets[0];

ImageOrPrintOptions imgOptions = new ImageOrPrintOptions();

imgOptions.ImageFormat =System.Drawing.Imaging.ImageFormat.Tiff;

imgOptions.HorizontalResolution = 200;

imgOptions.VerticalResolution = 200;

imgOptions.TiffCompression = TiffCompression.CompressionCCITT4;

imgOptions.PrintingPage = PrintingPageType.IgnoreBlank;

int sheetPageCount = sheet.GetPageCount(imgOptions.PrintingPage);

for (int j = 0; j < sheetPageCount; j++)

sheet.SheetToImageByPage(j, "C:\\report\\Image" + j + ".tif", imgOptions);

Thank You & Best Regards,

Hello,

Aspose.Cells.dll (v 4.8.1.10) gives better viewable output image then previous version but the output image is different then one you would see in 'Print Preview' in Excel or actual printed paper.

Your attached 'Image0.tif' only shows Column 1 through Column 7 and partial of Column 8 whereas 'Print Preview' in Excel or actual printed paper shows All Columns (from 1 to 10 and Total).

We would like to see the generated output image and actual printed paper be the SAME.

Please review your 'Image0.tif' and 'Print Preview' of Excel for this differences and provide us with updated dll that gives closer to Excel result.

Thank You.

Hi,

We found the issue and will figure it out.

Your issue has been registered into out issue tracking system with an issue id: CELLSNET-12890.

By the way as a workaround, you may try to save the sheet image using SheetToImage() instead of SheetToImageByPage() method. I have tested and it works well.

Thank you.

Hi,

SheetToImage doesn't work for us since we need it ByPage if excel spreadsheet doesn't fit in a page.

Do you have ETA for this fix? We need this fix asap.

Thanks!

Hi,

The issue is under process, we will update you soon.

Thank you.

Hi,

Thank you for considering Aspose.

Please try the attached latest fix of Aspose.Cells. We have fixed your mentioned issue.

Thank You & Best Regards,

The issues you have found earlier (filed as 12890) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.