Class WorkbookRender

Class WorkbookRender

Namespace: Aspose.Cells.Rendering
Assembly: Aspose.Cells.dll (25.2.0)

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

public class WorkbookRender

Inheritance

objectWorkbookRender

Inherited Members

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Constructors

WorkbookRender(Workbook, ImageOrPrintOptions)

The construct of WorkbookRender

public WorkbookRender(Workbook workbook, ImageOrPrintOptions options)

Parameters

workbook Workbook

Indicate which workbook to be rendered.

options ImageOrPrintOptions

ImageOrPrintOptions contains some property of output image

Properties

PageCount

Gets the total page count of workbook.

public int PageCount { get; }

Property Value

int

Methods

CustomPrint(bool, PrintPageEventArgs)

Client can control page setting of printer when print each page using this function.

public int CustomPrint(bool nextPageAfterPrint, PrintPageEventArgs printPageEventArgs)

Parameters

nextPageAfterPrint bool

If true , printer will go to next page after print current page

printPageEventArgs PrintPageEventArgs

System.Drawing.Printing.PrintPageEventArgs

Returns

int

Indirect next page index, based on zero

Dispose()

Releases resources created and used for rendering.

public void Dispose()

GetPageSizeInch(int)

Get page size in inch of output image.

public float[] GetPageSizeInch(int pageIndex)

Parameters

pageIndex int

The page index is based on zero.

Returns

float[]

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

ToImage(Stream)

Render whole workbook as Tiff Image to stream.

public void ToImage(Stream stream)

Parameters

stream Stream

the stream of the output image

ToImage(string)

Render whole workbook as Tiff Image to a file.

public void ToImage(string filename)

Parameters

filename string

the filename of the output image

ToImage(int, string)

Render certain page to a file.

public void ToImage(int pageIndex, string fileName)

Parameters

pageIndex int

indicate which page is to be converted

fileName string

filename of the output image

ToImage(int, Stream)

Render certain page to a stream.

public void ToImage(int pageIndex, Stream stream)

Parameters

pageIndex int

indicate which page is to be converted

stream Stream

the stream of the output image

ToPrinter(string)

Render workbook to Printer

public void ToPrinter(string printerName)

Parameters

printerName string

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

ToPrinter(string, string)

Render workbook to Printer

public void ToPrinter(string printerName, string jobName)

Parameters

printerName string

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

jobName string

set the print job name

ToPrinter(PrinterSettings)

Render workbook to Printer

public void ToPrinter(PrinterSettings PrinterSettings)

Parameters

PrinterSettings PrinterSettings

the settings of printer, e.g. PrinterName, Duplex

ToPrinter(PrinterSettings, string)

Render workbook to Printer

public void ToPrinter(PrinterSettings PrinterSettings, string jobName)

Parameters

PrinterSettings PrinterSettings

the settings of printer, e.g. PrinterName, Duplex

jobName string

set the print job name

ToPrinter(string, int, int)

Render workbook to Printer

[Obsolete("Use ToPrinter(string PrinterName) and ImageOrPrintOptions.PageIndex, PageCount instead.")]
public void ToPrinter(string printerName, int printPageIndex, int printPageCount)

Parameters

printerName string

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

printPageIndex int

the 0-based index of the first page to print, it must be in Range [0, WorkbookRender.PageCount-1]

printPageCount int

the number of pages to print, it must be greater than zero

Remarks

NOTE: This method is now obsolete. Instead, please use ToPrinter(string PrinterName) and ImageOrPrintOptions.PageIndex, PageCount to set the first page and the number of pages to print. This property will be removed 12 months later since December 2021. Aspose apologizes for any inconvenience you may have experienced.