to_tiff method

to_tiff

Render whole worksheet as Tiff Image to stream.

def to_tiff(self, stream):
    ...
ParameterTypeDescription
streamio.RawIOBasethe stream of the output image

to_tiff

Render whole worksheet as Tiff Image to a file.

def to_tiff(self, filename):
    ...
ParameterTypeDescription
filenamestrthe filename of the output image

Example

The following code outputs all the pages of the first sheet to Tiff image.

from aspose.cells import SaveFormat, Workbook
from aspose.cells.rendering import ImageOrPrintOptions, SheetRender

# load the source file with images.
wb = Workbook("Book1.xlsx")
imgOpt = ImageOrPrintOptions()
# set output image type.
imgOpt.save_format = SaveFormat.TIFF
# render the first sheet.
sr = SheetRender(wb.worksheets[0], imgOpt)
# output all the pages of the sheet to Tiff image.
sr.to_tiff("output.tiff")

See Also