Metodo to_tiff

to_tiff(self, stream)

Esegui il rendering dell’intero foglio di lavoro come immagine Tiff per lo streaming.


def to_tiff(self, stream):
    ...
ParametroTipoDescrizione
streamio.RawIOBaseil flusso dell’immagine di output

to_tiff(self, filename)

Trasforma l’intero foglio di lavoro in un file immagine Tiff.


def to_tiff(self, filename):
    ...
ParametroTipoDescrizione
filenamestril nome del file dell’immagine di output

Esempio

Il codice seguente restituisce tutte le pagine del primo foglio in un’immagine 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")

Guarda anche