SheetRender

SheetRender class

Represents a worksheet render which can render worksheet to various images such as (BMP, PNG, JPEG, TIFF..) The constructor of this class , must be used after modification of pagesetup, cell style.

Constructors

NameDescription
SheetRenderthe construct of SheetRender, need worksheet and ImageOrPrintOptions as params

Properties

NameTypeDescription
PageCountNumberGets the total page count of current worksheet.
PageScaleNumberGets calculated page scale of the sheet. Returns the set scale if PageSetup.Zoom is set. Otherwise, returns the calculat

Methods

NameDescription
getPageSizeInchGet page size in inch of output image.
toImageRender certain page to a file.
toPrinterRender worksheet to Printer

SheetRender(worksheet, options)

the construct of SheetRender, need worksheet and ImageOrPrintOptions as params

ParameterTypeDescription
worksheetWorksheetIndicate which spreadsheet to be rendered.
optionsImageOrPrintOptionsImageOrPrintOptions contains some property of output image

SheetRender.PageCount property

Gets the total page count of current worksheet.

Type: Number

SheetRender.PageScale property

Gets calculated page scale of the sheet. Returns the set scale if PageSetup.Zoom is set. Otherwise, returns the calculated scale according to PageSetup.FitToPagesWide and PageSetup.FitToPagesTall .

Type: Number

getPageSizeInch(pageIndex)

Get page size in inch of output image.

ParameterTypeDescription
pageIndexNumberThe page index is based on zero.

Returns: Page size of image, [0] for width and [1] for height

toImage(pageIndex, fileName)

Render certain page to a file.

ParameterTypeDescription
pageIndexNumberindicate which page is to be converted
fileNameStringfilename of the output image

toPrinter(printerName) (1 of 2)

Render worksheet to Printer

ParameterTypeDescription
printerNameStringthe name of the printer , for example: “Microsoft Office Document Image Writer”

toPrinter(printerName, jobName) (2 of 2)

Render worksheet to Printer

ParameterTypeDescription
printerNameStringthe name of the printer , for example: “Microsoft Office Document Image Writer”
jobNameStringset the print job name