Converting Worksheet to Image File By Page

Workbook book = new Workbook("Sheet to Image by Page.xls");

Worksheet sheet = book.Worksheets[0];

Aspose.Cells.Rendering.ImageOrPrintOptions options = new Aspose.Cells.Rendering.ImageOrPrintOptions();

options.HorizontalResolution = 200;

options.VerticalResolution = 200;

//Specify the image type
options.ImageType = ImageType.Tiff;

//Sheet2Image By Page conversion

SheetRender sr = new SheetRender(sheet, options);

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

{

	Bitmap pic = sr.ToImage(j);

	pic.Save(sheet.Name + " Page" + (j + 1) + ".tiff");

}

Download Sample Code

  • Github
  • Bitbucket