método to_tiff

to_tiff(self, stream)

Representar toda la hoja de cálculo como imagen Tiff para transmitir.


def to_tiff(self, stream):
    ...
ParámetroTipoDescripción
streamio.RawIOBaseel flujo de la imagen de salida

to_tiff(self, filename)

Representar toda la hoja de cálculo como imagen Tiff en un archivo.


def to_tiff(self, filename):
    ...
ParámetroTipoDescripción
filenamestrel nombre del archivo de la imagen de salida

Ejemplo

El siguiente código genera todas las páginas de la primera hoja en una imagen Tiff.

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")

Ver también