Constructor Summary |
---|
WorkbookRender(workbook, options)
The construct of WorkbookRender |
Property Getters/Setters Summary | ||
---|---|---|
method | getPageCount() | |
Indicate the total page count of workbook |
Method Summary | ||
---|---|---|
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, DocumentName) | |
Render workbook to Printer |
Constructor Detail |
---|
WorkbookRender(workbook, options)
workbook: Workbook
- Indicate which workbook to be rendered.options: ImageOrPrintOptions
- ImageOrPrintOptions contains some property of output imageProperty Getters/Setters Detail |
---|
getPageCount : int | |
int getPageCount() |
Method Detail |
---|
toImage | |
toImage(filename) |
filename: String
- the filename of the output imagetoImage | |
toImage(pageIndex, fileName) |
pageIndex: int
- indicate which page is to be convertedfileName: String
- filename of the output imagetoImage | |
toImage(pageIndex, stream) |
pageIndex: int
- indicate which page is to be convertedstream: OutputStream
- the stream of the output imagetoPrinter | |
toPrinter(PrinterName) |
PrinterName: String
- the name of the printer , for example: "Microsoft Office Document Image Writer"toPrinter | |
toPrinter(PrinterName, DocumentName) |
PrinterName: String
- the name of the printer , for example: "Microsoft Office Document Image Writer"DocumentName: String
- set the print job name toImageBytes | |
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()