Excel File to TIFF conversion issues

Greetings,

I need to convert Excel files to TIFF files either in single page TIFF files or multipage TIFF files (containing output of complete Excel file).

Currently, I am facing a couple of issues:

  1. The WorkbookRenderer.ToImage() generates a 0 byte output file. On the otherhand WorkbookRenderer.ToImage() works fine. Is this a bug or am I missing something at my end? Following are the steps that I perform:
    1. Workbook workBook = new Workbook(fileName);
    2. ImageOrPrintOptions printOptions = new ImageOrPrintOptions();
    3. printOptions.HorizontalResolution = 300;
    4. printOptions.VerticalResolution = 300;
    5. printOptions.PrintingPage = PrintingPageType.IgnoreBlank;
    6. printOptions.PrintWithStatusDialog = false;
    7. printOptions.ImageFormat = System.Drawing.Imaging.ImageFormat.Tiff;
    8. printOptions.TiffCompression = TiffCompression.CompressionNone;
    9. WorkbookRender bookRender = new WorkbookRender(workBook, printOptions);
    10. bookRender.ToImage(outputFile);
  2. WorkbookRenderer.ToImage creates a multipage TIFF file. Is it possible to create TIFF files for individual pages in the whole workbook using this method or do I need to take any other approach?
  3. I find that for a couple of XLS/XLSX file I receive cell format exception while generating the TIFF file. Any pointers in this regards?

I am using Aspose.Cells.dll 7.0.2.0 with C# on .Net Framework 4.0.

Thank you in advance.

Regards,
Syed

Hi,


Please try the fixed version: v7.0.2.7, if it works fine for your mentioned issues.

1) Please attach your template file here (if you still got the issue after using v7.0.2.7), we will check your issue soon.

2) You may try one page per sheet option on e.g ImageOrPrintOptions imgOptions.OnePagePerSheet attribute. Also, you may try to scan individual worksheets and take images for sheets separately. See the topic:
http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/converting-worksheet-to-image-worksheet-to-image-by-page.html

3) Please attach the sample files here.

Thank you.

Amjad,

Thank you for your response.

Aspose.Cells 7.0.2.7 worked fine but I can still see a couple of files that generate the exception. I will group them together and send them your way for further investigation.

I will implement the code mentioned in the article and will let you know if I face any issues.

Thank you for your support.

Regards,
Syed.

Hi,

Thanks for your posting and using Aspose.Cells.

Let us know if you face any issue relating to tiff conversion, we will look into it and help you asap.

Also, we have now done major improvements in the tiff conversion, so you should download and give a try to latest version:
Aspose.Cells
for .NET v7.3.4.1

and check the results at your end. Let us know your feedback

Besides that, we recommend you to download and give a try to latest offline demos of Aspose.Cells which you can find from theses links.

These demos can work with Visual Studio 2005, 2008 or 2010. Please read the readme.txt file before running the demos.