WorkbookRender

WorkbookRender class

Represents a Workbook render. The constructor of this class , must be used after modification of pagesetup, cell style.

class WorkbookRender;

Constructors

NameDescription
constructor(Workbook, ImageOrPrintOptions)The construct of WorkbookRender

Methods

MethodDescription
getPageCount()Gets the total page count of workbook.
getPageSizeInch(number)Get page size in inch of output image.
toImage()Render whole workbook as Tiff Image to stream.
toImage(string)Render whole workbook as Tiff Image to a file.
toImage(number, string)Render certain page to a file.
toImage(number)Render certain page to a stream.
dispose()Releases resources created and used for rendering.
isNull()Checks whether the implementation object is null.

constructor(Workbook, ImageOrPrintOptions)

The construct of WorkbookRender

constructor(workbook: Workbook, options: ImageOrPrintOptions);

Parameters:

ParameterTypeDescription
workbookWorkbookIndicate which workbook to be rendered.
optionsImageOrPrintOptionsImageOrPrintOptions contains some property of output image

getPageCount()

Gets the total page count of workbook.

getPageCount() : number;

getPageSizeInch(number)

Get page size in inch of output image.

getPageSizeInch(pageIndex: number) : number[];

Parameters:

ParameterTypeDescription
pageIndexnumberThe page index is based on zero.

Returns

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

toImage()

Render whole workbook as Tiff Image to stream.

toImage() : Uint8Array;

Returns

The result stream

toImage(string)

Render whole workbook as Tiff Image to a file.

toImage(filename: string) : void;

Parameters:

ParameterTypeDescription
filenamestringthe filename of the output image

toImage(number, string)

Render certain page to a file.

toImage(pageIndex: number, fileName: string) : void;

Parameters:

ParameterTypeDescription
pageIndexnumberindicate which page is to be converted
fileNamestringfilename of the output image

toImage(number)

Render certain page to a stream.

toImage(pageIndex: number) : Uint8Array;

Parameters:

ParameterTypeDescription
pageIndexnumberindicate which page is to be converted

Returns

The result stream

dispose()

Releases resources created and used for rendering.

dispose() : void;

isNull()

Checks whether the implementation object is null.

isNull() : boolean;