Hi,
in Aspose.Words and Aspose.Slides, you can export the document to Tiff format. This is not available in Aspose.Cells.
Are there any plans for adding the same options to Aspose.Cells, as are available in Aspose.Words and Slides? If not, can you please add this to your requested feature list?
Regards
Thomas
Hi,
You can export your worksheet to tiff image. Please see the code below.
C#
//Create a new Workbook object
//Open a template excel file
Workbook book = new Workbook(“C:\Testbook.xls”);
//Get the first worksheet.
Worksheet sheet = book.Worksheets[0];
//Define ImageOrPrintOptions
ImageOrPrintOptions imgOptions = new ImageOrPrintOptions();
//Specify the image format
imgOptions.ImageFormat = System.Drawing.Imaging.ImageFormat.Tiff;
//Render the sheet with respect to specified image/print options
SheetRender sr = new SheetRender(sheet, imgOptions);
//Render the image for the sheet
Bitmap bitmap = sr.ToImage(0);
//Save the image file
bitmap.Save(@“D:\SheetImage.tiff”);
Oh, thanks - I didn't knwo that.
The Sheetrendere, it renders just the first sheet, correct? Or does it render them all, so I can get the individual sheets from sr.ToImage(sheetNumber)?
if so, I will have to handle multipage tiff's my self, correct?
In Aspose.Words you can set the DPI, colordepth and compression for the TIFF document, will this be available in Aspose.Cells?
Regards
Thomas
Hi,
You have different options, you can take a single image of entire worksheet or you can get image in multiple pages.
Please see the full article: Converting Worksheet to Image and Worksheet to Image by Page
Secondly, you will have to iterate all your worksheets inside your workbook and get the image of each worksheet separately.
Also, there is ImageOrPrintOptions.TiffCompression property, where TiffCompression can be
CompressionNone : Specifies no compression. 0
CompressionRle : Specifies the RLE compression scheme. 1
CompressionLZW : Specifies the LZW compression scheme. 2
CompressionCCITT3 : Specifies the CCITT3 compression scheme. 3
CompressionCCITT4 : Specifies the CCITT4 compression scheme. 4
Please see if it fulfills your need.
Hi all,
thanks for the replys - it's exactly what I'm looking for :-)
Regards
Thomas