| Constructor Summary |
|---|
WorkbookRender(workbook, options)
The construct of WorkbookRender |
| Property Getters/Setters Summary | ||
|---|---|---|
method | getPageCount() | |
Gets the total page count of workbook.
|
||
| Method Summary | ||
|---|---|---|
method | getPageSizeInch(pageIndex) | |
Get page size in inch of output image.
|
||
method | toImage(pageIndex, stream) | |
Render certain page to a stream.
|
||
method | toImage(pageIndex, fileName) | |
Render certain page to a file.
|
||
method | toImage(filename) | |
Render whole workbook as Tiff Image to a file.
|
||
method | toImageBytes() | |
Render whole workbook as Tiff Image to a byte array.
|
||
method | toPrinter(printerName) | |
Render workbook to Printer
|
||
method | toPrinter(printerName, jobName) | |
Render workbook to Printer
|
||
WorkbookRender(workbook, options)
workbook: Workbook - Indicate which workbook to be rendered.options: ImageOrPrintOptions - ImageOrPrintOptions contains some property of output imageint getPageCount()
float[] getPageSizeInch(pageIndex)
pageIndex: int - The page index is based on zero.toImage(filename)
filename: String - the filename of the output imagetoImage(pageIndex, fileName)
pageIndex: int - indicate which page is to be convertedfileName: String - filename of the output imagetoImage(pageIndex, stream)
pageIndex: int - indicate which page is to be convertedstream: OutputStream - the stream of the output imagetoPrinter(printerName)
printerName: String - the name of the printer , for example: "Microsoft Office Document Image Writer"toPrinter(printerName, jobName)
printerName: String - the name of the printer , for example: "Microsoft Office Document Image Writer"jobName: String - set the print job name toImageBytes()
Example:
import jpype
import asposecells
jpype.startJVM()
from asposecells.api import *
wb = Workbook("Book2.xlsx")
imgOptions = ImageOrPrintOptions()
imgOptions.setHorizontalResolution(200)
imgOptions.setVerticalResolution(300)
imgOptions.setSaveFormat(SaveFormat.XPS)
workbookRender = WorkbookRender(wb, imgOptions)
with open("workbook.xps", "wb") as w:
content = workbookRender.toImageBytes()
w.write(content)
jpype.shutdownJVM()