Conversion excel sheet to Image in

I am using worksheet.SheetToImage() to convert excel sheet to Tiff image. I noticed in the recent Aspose dll the method has been deprecated. can you please let me know what method should replace sheetToImage() to convert excel sheet to image?.

Thanks,

Arun

Hi Arun,

worksheet.SheetToImage() is now obsolete. You have to use Aspose.Cells.Rendering.SheetRender API.
It represents a worksheet render which can render worksheet to various images such as (BMP, PNG, JPEG, TIFF..).

For more information please follow the link:

http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/aspose.cells.rendering.sheetrendermethods.html

Thanks,

I am trying to convert excel sheet to TIFF image using SheetRender.ToTiff() .Could you please provide some sample code to show how to use it?.

Thanks,

Arun

Hi Arun,

Here is a complete code sample with the latest approaches to convert a sheet into a multiple page TIFF image.

//Define load options
LoadOptions lopts = new LoadOptions(LoadFormat.Xlsx);
//Instantiate Workbook to load Xlsx
Workbook workbook = new Workbook(@“D:\somexlsx.xlsx”, lopts);
//Define image options
Aspose.Cells.Rendering.ImageOrPrintOptions imgOptions = new Aspose.Cells.Rendering.ImageOrPrintOptions();
imgOptions.ImageFormat = System.Drawing.Imaging.ImageFormat.Tiff;
imgOptions.VerticalResolution = 200;
imgOptions.HorizontalResolution = 200;
//Render first worksheet to TIFF
Worksheet sheet = workbook.Worksheets[0];
Aspose.Cells.Rendering.SheetRender sr = new Aspose.Cells.Rendering.SheetRender(sheet, imgOptions);
sr.ToTiff(@“d:\tiffs\TIFFIMAGE.tiff”);

Kind Regards