The SpreadsheetOptions class encapsulates various settings and parameters that can be used to control the rendering of spreadsheet files (such as Excel or CSV files) in the GroupDocs.Viewer component. For details, see children of the Render spreadsheet files topic.
Example usage:
PngViewOptions pngViewOptions = new PngViewOptions();
SpreadsheetOptions spreadsheetOptions = pngViewOptions.getSpreadsheetOptions();
spreadsheetOptions.setRenderHeadings(true);
spreadsheetOptions.setCountColumnsPerPage(24);
try (Viewer viewer = new Viewer("document.docx")) {
viewer.view(pngViewOptions);
// Use the viewer object for further operations
}
To set right margin of the worksheet when converting to pdf if less than 0 then default convert value is used If the parameter is less than 0, then the default value is used.
To set right margin of the worksheet when converting to pdf if less than 0 then default convert value is used If the parameter is less than 0, then the default value is used.
To set top margin of the worksheet when converting to pdf if less than 0 then default convert value is used If the parameter is less than 0, then the default value is used.
To set top margin of the worksheet when converting to pdf if less than 0 then default convert value is used If the parameter is less than 0, then the default value is used.
To set bottom margin of the worksheet when converting to pdf if less than 0 then default convert value is used If the parameter is less than 0, then the default value is used.
To set bottom margin of the worksheet when converting to pdf if less than 0 then default convert value is used If the parameter is less than 0, then the default value is used.
To set left margin of the worksheet when converting to pdf if less than 0 then default convert value is used
If the parameter is less than 0, then the default value is used. For details, see the documentation.
Returns:
double
setLeftMargin(double leftMargin)
public void setLeftMargin(double leftMargin)
To set left margin of the worksheet when converting to pdf if less than 0 then default convert value is used
If the parameter is less than 0, then the default value is used. For details, see the documentation.
Parameters:
Parameter
Type
Description
leftMargin
double
getRightMargin()
public double getRightMargin()
To set right margin of the worksheet when converting to pdf if less than 0 then default convert value is used If the parameter is less than 0, then the default value is used. For details, see the documentation.
Returns:
double
setRightMargin(double rightMargin)
public void setRightMargin(double rightMargin)
To set right margin of the worksheet when converting to pdf if less than 0 then default convert value is used If the parameter is less than 0, then the default value is used. For details, see the documentation.
Parameters:
Parameter
Type
Description
rightMargin
double
getTopMargin()
public double getTopMargin()
To set top margin of the worksheet when converting to pdf if less than 0 then default convert value is used If the parameter is less than 0, then the default value is used. For details, see the documentation.
Returns:
double
setTopMargin(double topMargin)
public void setTopMargin(double topMargin)
To set top margin of the worksheet when converting to pdf if less than 0 then default convert value is used If the parameter is less than 0, then the default value is used. For details, see the documentation.
Parameters:
Parameter
Type
Description
topMargin
double
getBottomMargin()
public double getBottomMargin()
To set bottom margin of the worksheet when converting to pdf if less than 0 then default convert value is used If the parameter is less than 0, then the default value is used. For details, see the documentation.
Returns:
double
setBottomMargin(double bottomMargin)
public void setBottomMargin(double bottomMargin)
To set bottom margin of the worksheet when converting to pdf if less than 0 then default convert value is used If the parameter is less than 0, then the default value is used. For details, see the documentation.
Parameters:
Parameter
Type
Description
bottomMargin
double
getHorizontalResolution()
public int getHorizontalResolution()
Gets or sets the horizontal resolution for generated images in dots per inch. This option is used when rendering spreadsheets to PNG or JPEG formats only.
Default value is 96 DPI. Min possible value - 72 DPI, max possible value - 600 DPI. If the user-specified value is out of these limits, the min or max possible value will be applied.
Returns:
int - the horizontal resolution in DPI.
setHorizontalResolution(int horizontalResolution)
public void setHorizontalResolution(int horizontalResolution)
Sets the horizontal resolution for generated images in dots per inch. This option is used when rendering spreadsheets to PNG or JPEG formats only.
Default value is 96 DPI. Min possible value - 72 DPI, max possible value - 600 DPI. If the user-specified value is out of these limits, the min or max possible value will be applied.
Parameters:
Parameter
Type
Description
horizontalResolution
int
the horizontal resolution in DPI.
getVerticalResolution()
public int getVerticalResolution()
Gets or sets the vertical resolution for generated images in dots per inch. This option is used when rendering spreadsheets to PNG or JPEG formats only.
Default value is 96 DPI. Min possible value - 72 DPI, max possible value - 600 DPI. If the user-specified value is out of these limits, the min or max possible value will be applied.
Returns:
int - the vertical resolution in DPI.
setVerticalResolution(int verticalResolution)
public void setVerticalResolution(int verticalResolution)
Sets the vertical resolution for generated images in dots per inch. This option is used when rendering spreadsheets to PNG or JPEG formats only.
Default value is 96 DPI. Min possible value - 72 DPI, max possible value - 600 DPI. If the user-specified value is out of these limits, the min or max possible value will be applied.
Parameters:
Parameter
Type
Description
verticalResolution
int
the vertical resolution in DPI.
getValidHorizontalDpi()
public int getValidHorizontalDpi()
Returns:
int
getValidVerticalDpi()
public int getValidVerticalDpi()
Returns:
int
forRenderingPrintAreaAndPageBreaks()
public static SpreadsheetOptions forRenderingPrintAreaAndPageBreaks()
Initializes a new instance of SpreadsheetOptions for rendering print areas and page breaks. For details, see the documentation.
Returns:SpreadsheetOptions - New instance of SpreadsheetOptions for rendering pages based on page breaks that are included into print area. The behavior is similar to printing in Excel.
forRenderingByPageBreaks()
public static SpreadsheetOptions forRenderingByPageBreaks()
Initializes a new instance of the SpreadsheetOptions class for rendering print areas only. For details, see the documentation.
Returns:SpreadsheetOptions - a new instance of SpreadsheetOptions for rendering print areas only. The behavior is similar to printing in Excel, where the worksheet is rendered by page breaks.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.