Constructor Summary |
---|
SheetRender(worksheet, options)
the construct of SheetRender, need worksheet and ImageOrPrintOptions as params |
Property Getters/Setters Summary | ||
---|---|---|
method | getPageCount() | |
Indicate the total page count of current worksheet | ||
method | getPageScale() | |
Gets calculated page scale of the sheet. |
Method Summary | ||
---|---|---|
method | getPageSize(pageIndex) | |
Get page size of output image. The size unit is in point. | ||
method | toImage(pageIndex, fileName) | |
Render certain page to a file. | ||
method | toImageBytes(pageIndex) | |
Render certain page to a byte array. | ||
method | toPrinter(PrinterName) | |
Render worksheet to Printer | ||
method | toPrinter(PrinterName, DocumentName) | |
Render worksheet to Printer |
Constructor Detail |
---|
SheetRender(worksheet, options)
worksheet: Worksheet
- Indicate which spreadsheet to be rendered.options: ImageOrPrintOptions
- ImageOrPrintOptions contains some property of output imageProperty Getters/Setters Detail |
---|
getPageCount : int | |
int getPageCount() |
getPageScale : float | |
float getPageScale() |
Method Detail |
---|
getPageSize | |
float[] getPageSize(pageIndex) |
pageIndex: int
- The page index is based on zero.toImage | |
toImage(pageIndex, fileName) |
pageIndex: int
- indicate which page is to be convertedfileName: String
- filename 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(pageIndex) |
pageIndex: int
- Indicate which page is to be convertedExample:
import jpype import asposecells jpype.startJVM() from asposecells.api import * wb = Workbook("Book2.xlsx") imgOptions = ImageOrPrintOptions() imgOptions.setHorizontalResolution(200) imgOptions.setVerticalResolution(300) imgOptions.setImageFormat(ImageFormat.getJpeg()) worksheet = wb.getWorksheets().get(0) sheetRender = SheetRender(worksheet, imgOptions) with open("sheet1.jpeg", "wb") as w: content = sheetRender.toImageBytes(0) w.write(content) jpype.shutdownJVM()