public final class ExcelPrintOptions extends Object
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Determines whether the specified
ExcelPrintOptions is equal
to the current ExcelPrintOptions . |
int |
getAutomaticPageBreakScalingFactor()
Scaling factor for automatic page breaks.
|
double |
getBottomMargin()
Bottom margin (in inches).
|
Optional<Double> |
getCustomPageHeight() |
Optional<Double> |
getCustomPageWidth() |
int |
getFitWorksheetHeightToPages()
Fit worksheet height to this number of pages (0 = use as many as needed).
|
int |
getFitWorksheetWidthToPages()
Fit worksheet width to this number of pages (0 = use as many as needed).
|
double |
getFooterMargin()
Footer margin (in inches).
|
double |
getHeaderMargin()
Header margin (in inches).
|
double |
getLeftMargin()
Left margin (in inches).
|
int |
getNumberOfCopies()
Number of copies to print.
|
double |
getPageHeight()
Gets the height of the page (in inches).
|
double |
getPageWidth()
Gets the width of the page (in inches).
|
PaperType |
getPaperType()
Gets the type of the paper for the page.
|
int |
getPrintResolution()
Print resolution in DPI (dots per inch).
|
double |
getRightMargin()
Right margin (in inches).
|
int |
getStartPageNumber()
Start page number.
|
double |
getTopMargin()
Top margin (in inches).
|
int |
getVerticalPrintResolution()
Vertical print resolution in DPI (dots per inch).
|
int |
hashCode()
Returns the hash code of this object.
|
boolean |
isDraftQuality()
true for printing in draft quality, false otherwise. |
boolean |
isFitToPage()
|
boolean |
isHorizontalCentered()
true for printing sheet horizontal centered, false otherwise. |
boolean |
isPortrait()
true for portrait orientation, false for landscape orientation. |
boolean |
isPrintBlackWhite()
true for printing in black and white, false otherwise. |
boolean |
isPrintCellNotes()
true for printing cell notes, false otherwise. |
boolean |
isPrintGridlines()
true for printing gridlines, false otherwise. |
boolean |
isPrintHeadings()
true for print headings, false otherwise. |
boolean |
isPrintNotesSheetEnd()
true for printing notes at end of sheet, false otherwise. |
boolean |
isPrintPagesInRows()
true for printing pages in rows, false otherwise. |
boolean |
isUseStartPageNumber()
true for using start page number, false otherwise. |
boolean |
isVerticalCentered()
true for printing sheet vertical centered, false otherwise. |
void |
setAutomaticPageBreakScalingFactor(int automaticPageBreakScalingFactor)
Sets scaling factor for automatic page breaks.
|
void |
setBottomMargin(double bottomMargin)
Bottom margin (in inches).
|
void |
setCustomPageHeight(Optional<Double> customPageHeight) |
void |
setCustomPageWidth(Optional<Double> customPageWidth) |
void |
setDraftQuality(boolean draftQuality)
true for printing in draft quality, false otherwise. |
void |
setFitToPage(boolean fitToPage)
|
void |
setFitWorksheetHeightToPages(int fitWorksheetHeightToPages)
Fit worksheet height to this number of pages (0 = use as many as needed).
|
void |
setFitWorksheetWidthToPages(int fitWorksheetWidthToPages)
Fit worksheet width to this number of pages (0 = use as many as needed).
|
void |
setFooterMargin(double footerMargin)
Footer margin (in inches).
|
void |
setHeaderMargin(double headerMargin)
Header margin (in inches).
|
void |
setHorizontalCentered(boolean horizontalCentered)
true for printing sheet horizontal centered, false otherwise. |
void |
setLeftMargin(double leftMargin)
Left margin (in inches).
|
void |
setNumberOfCopies(int numberOfCopies)
Number of copies to print.
|
void |
setPaperType(PaperType paperType)
Sets the type of the paper for the page.
|
void |
setPortrait(boolean portrait)
true for portrait orientation, false for landscape orientation. |
void |
setPrintBlackWhite(boolean printBlackWhite)
true for printing in black and white, false otherwise. |
void |
setPrintCellNotes(boolean printCellNotes)
true for printing cell notes, false otherwise. |
void |
setPrintGridlines(boolean printGridlines)
true for printing gridlines, false otherwise. |
void |
setPrintHeadings(boolean printHeadings)
true for print headings, false otherwise. |
void |
setPrintNotesSheetEnd(boolean printNotesSheetEnd)
true for printing notes at end of sheet, false otherwise. |
void |
setPrintPagesInRows(boolean printPagesInRows)
true for printing pages in rows, false otherwise. |
void |
setPrintResolution(int printResolution)
Print resolution in DPI (dots per inch).
|
void |
setRightMargin(double rightMargin)
Left margin (in inches).
|
void |
setStartPageNumber(int startPageNumber)
Set start page number.
|
void |
setTopMargin(double topMargin)
Footer margin (in inches).
|
void |
setUseStartPageNumber(boolean useStartPageNumber)
true for printing cell notes, false otherwise. |
void |
setVerticalCentered(boolean value)
true for printing sheet vertical centered, false otherwise. |
void |
setVerticalPrintResolution(int verticalPrintResolution)
Set vertical print resolution in DPI (dots per inch).
|
public boolean equals(Object obj)
ExcelPrintOptions
is equal
to the current ExcelPrintOptions
.equals
in class Object
obj
- Object of ExcelPrintOptions
type.true
if the specified ExcelPrintOptions
is equal
to the current ExcelPrintOptions
; otherwise, false
.public int getAutomaticPageBreakScalingFactor()
Unit is one percent. Value must be between 10 and 400.
Default value is 100.
MS Excel inserts automatic page breaks depending on this scaling factor. Smaller it gets, bigger will be the distance between the two automatic page breaks.
public double getBottomMargin()
Default value is 0.75. Currently supported only in XLSX and XLS.
public int getFitWorksheetHeightToPages()
Default value is 0.
public int getFitWorksheetWidthToPages()
Default value is 0.
public double getFooterMargin()
Default value is 0.3.
public double getHeaderMargin()
Default value is 0.3.
public double getLeftMargin()
Default value is 0.7. Currently supported only in XLSX and XLS.
public int getNumberOfCopies()
Default value is 1.
public double getPageHeight()
If the getPaperType()
is PaperType.Custom
, this will return page height from printer settings.
public double getPageWidth()
If the getPaperType()
is PaperType.Custom
, this will return page width from printer settings.
Accessing printer settings (if getPaperType()
is PaperType.CUSTOM
) doesn't work in Medium Trust.
public PaperType getPaperType()
Default value is PaperType.A4
.
public int getPrintResolution()
Default value is 0.
public double getRightMargin()
Default value is 0.7. Currently supported only in XLSX and XLS.
public int getStartPageNumber()
Default value is 1.
public double getTopMargin()
Default value is 0.75. Currently supported only in XLSX and XLS.
public int getVerticalPrintResolution()
Default value is 0.
public int hashCode()
public boolean isDraftQuality()
true
for printing in draft quality, false
otherwise.
Default value is false
.
public boolean isFitToPage()
true
for using
getFitWorksheetHeightToPages()
and getFitWorksheetWidthToPages()
,
false
otherwise.
This method determines whether getAutomaticPageBreakScalingFactor()
or getFitWorksheetHeightToPages()
and getFitWorksheetWidthToPages()
will be used in printing.
Default value is false
.
public boolean isHorizontalCentered()
true
for printing sheet horizontal centered, false
otherwise.
Default value is false
.
public boolean isPortrait()
true
for portrait orientation, false
for landscape orientation.
Default value is true
.
public boolean isPrintBlackWhite()
true
for printing in black and white, false
otherwise.
Default value is false
.
public boolean isPrintCellNotes()
true
for printing cell notes, false
otherwise.
Default value is false
.
public boolean isPrintGridlines()
true
for printing gridlines, false
otherwise.
Default value is false
.
This method is also supported when exporting to HTML file format.
public boolean isPrintHeadings()
true
for print headings, false
otherwise.
Default value is false
.
setPrintHeadings
is also supported when exporting to HTML file format.
public boolean isPrintNotesSheetEnd()
true
for printing notes at end of sheet, false
otherwise.
Default value is false
.
public boolean isPrintPagesInRows()
true
for printing pages in rows, false
otherwise.
Default value is false
.
public boolean isUseStartPageNumber()
true
for using start page number, false
otherwise.
Default value is false
.public boolean isVerticalCentered()
true
for printing sheet vertical centered, false
otherwise.
Default value is false
.
public void setAutomaticPageBreakScalingFactor(int automaticPageBreakScalingFactor)
Unit is one percent. Value must be between 10 and 400.
Default value is 100.
MS Excel inserts automatic page breaks depending on this scaling factor. Smaller it gets, bigger will be the distance between the two automatic page breaks.
If you set this filed, fitToPage
will automatically be set to false
.
IndexOutOfBoundsException
- Value is out of 10 to 400 range.public void setBottomMargin(double bottomMargin)
Default value is 0.75. Currently supported only in XLSX and XLS.
public void setDraftQuality(boolean draftQuality)
true
for printing in draft quality, false
otherwise.
Default value is false
.
public void setFitToPage(boolean fitToPage)
true
for using
getFitWorksheetHeightToPages()
and getFitWorksheetWidthToPages()
,
false
otherwise.
This method determines whether getAutomaticPageBreakScalingFactor()
or getFitWorksheetHeightToPages()
and getFitWorksheetWidthToPages()
will be used in printing.
Default value is false
.
public void setFitWorksheetHeightToPages(int fitWorksheetHeightToPages)
Default value is 0.
If you use this method, setFitToPage(boolean)
will automatically be set to true
.
public void setFitWorksheetWidthToPages(int fitWorksheetWidthToPages)
Default value is 0.
If you set this property, setFitToPage(boolean)
will automatically be set to true
.
public void setFooterMargin(double footerMargin)
Default value is 0.3.
public void setHeaderMargin(double headerMargin)
Default value is 0.3.
public void setHorizontalCentered(boolean horizontalCentered)
true
for printing sheet horizontal centered, false
otherwise.
Default value is false
.
public void setLeftMargin(double leftMargin)
Default value is 0.7. Currently supported only in XLSX and XLS.
public void setNumberOfCopies(int numberOfCopies)
Default value is 1.
public void setPaperType(PaperType paperType)
Default value is PaperType.A4
.
IllegalArgumentException
- Thrown if type is set to
PaperType.Custom
public void setPortrait(boolean portrait)
true
for portrait orientation, false
for landscape orientation.
Default value is true
.
public void setPrintBlackWhite(boolean printBlackWhite)
true
for printing in black and white, false
otherwise.
Default value is false
.
public void setPrintCellNotes(boolean printCellNotes)
true
for printing cell notes, false
otherwise.
Default value is false
.
public void setPrintGridlines(boolean printGridlines)
true
for printing gridlines, false
otherwise.
Default value is false
.
This method is also supported when exporting to HTML file format.
public void setPrintHeadings(boolean printHeadings)
true
for print headings, false
otherwise.
Default value is false
.
This method is also supported when exporting to HTML file format.
public void setPrintNotesSheetEnd(boolean printNotesSheetEnd)
true
for printing notes at end of sheet, false
otherwise.
Default value is false
.
public void setPrintPagesInRows(boolean printPagesInRows)
true
for printing pages in rows, false
otherwise.
Default value is false
.
public void setPrintResolution(int printResolution)
Default value is 0.
public void setRightMargin(double rightMargin)
Default value is 0.7. Currently supported only in XLSX and XLS.
public void setStartPageNumber(int startPageNumber)
Default value is 1.
public void setTopMargin(double topMargin)
Default value is 0.75.
public void setUseStartPageNumber(boolean useStartPageNumber)
true
for printing cell notes, false
otherwise.
Default value is false
.
public void setVerticalCentered(boolean value)
true
for printing sheet vertical centered, false
otherwise.
Default value is false
.
public void setVerticalPrintResolution(int verticalPrintResolution)
Default value is 0.
© GemBox d.o.o. — All rights reserved.