com.aspose.cells
Class SheetRender

java.lang.Object
    extended by com.aspose.cells.SheetRender

public class SheetRender 
extends java.lang.Object

Represents a worksheet render which can render worksheet to various images such as (BMP, PNG, JPEG, TIFF..) The constructor of this class , must be used after modification of pagesetup, cell style.


Constructor Summary
SheetRender(Worksheet worksheet, ImageOrPrintOptions options)
           the construct of SheetRender, need worksheet and ImageOrPrintOptions as params
 
Property Getters/Setters Summary
intgetPageCount()
           Gets the total page count of current worksheet.
doublegetPageScale()
           Gets calculated page scale of the sheet. Returns the set scale if PageSetup.Zoom is set. Otherwise, returns the calculated scale according to PageSetup.FitToPagesWide and PageSetup.FitToPagesTall.
 
Method Summary
float[]getPageSize(int pageIndex)
           Get page size of output image. The size unit is in point.
float[]getPageSizeInch(int pageIndex)
           Get page size in inch of output image.
voidtoImage(int pageIndex, java.io.OutputStream stream)
           Render certain page to a stream.
voidtoImage(int pageIndex, java.lang.String fileName)
           Render certain page to a file.
voidtoPrinter(java.lang.String printerName)
           Render worksheet to Printer
voidtoPrinter(java.lang.String printerName, java.lang.String jobName)
           Render worksheet to Printer
 

Constructor Detail

SheetRender

public SheetRender(Worksheet worksheet, ImageOrPrintOptions options)
            throws java.lang.Exception
the construct of SheetRender, need worksheet and ImageOrPrintOptions as params
Parameters:
worksheet - Indicate which spreadsheet to be rendered.
options - ImageOrPrintOptions contains some property of output image

Property Getters/Setters Detail

getPageCount

public int getPageCount()
Gets the total page count of current worksheet.

getPageScale

public double getPageScale()
Gets calculated page scale of the sheet. Returns the set scale if PageSetup.Zoom is set. Otherwise, returns the calculated scale according to PageSetup.FitToPagesWide and PageSetup.FitToPagesTall.

Method Detail

getPageSize

public float[] getPageSize(int pageIndex)
Get page size of output image. The size unit is in point. NOTE: This method is now obsolete. Instead, please use GetPageSizeInch(int pageIndex). This property will be removed 12 months later since October 2021. Aspose apologizes for any inconvenience you may have experienced.
Parameters:
pageIndex - The page index is based on zero.
Returns:
Page size of image, [0] for width and [1] for height

getPageSizeInch

public float[] getPageSizeInch(int pageIndex)
Get page size in inch of output image.
Parameters:
pageIndex - The page index is based on zero.
Returns:
Page size of image, [0] for width and [1] for height

toImage

public void toImage(int pageIndex, java.lang.String fileName)
            throws java.lang.Exception
Render certain page to a file.
Parameters:
pageIndex - indicate which page is to be converted
fileName - filename of the output image

toImage

public void toImage(int pageIndex, java.io.OutputStream stream)
            throws java.lang.Exception
Render certain page to a stream.
Parameters:
pageIndex - indicate which page is to be converted
stream - the stream of the output image

toPrinter

public void toPrinter(java.lang.String printerName)
              throws java.lang.Exception
Render worksheet to Printer
Parameters:
printerName - the name of the printer , for example: "Microsoft Office Document Image Writer"

toPrinter

public void toPrinter(java.lang.String printerName, java.lang.String jobName)
              throws java.lang.Exception
Render worksheet to Printer
Parameters:
printerName - the name of the printer , for example: "Microsoft Office Document Image Writer"
jobName - set the print job name

See Also:
          Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
          Aspose.Cells Support Forum - our preferred method of support.