public class PrintSettings
extends java.lang.Object
Constructor and Description |
---|
PrintSettings() |
Modifier and Type | Method and Description |
---|---|
ColorModel |
getColorModel()
Returns the selected color model.
返回选定的颜色模型。 |
int |
getCopies()
Returns the number of copies to print.
返回要打印的份数。 |
DuplexMode |
getDuplexMode()
Returns the selected duplex mode.
返回所选的双工模式。 |
PageMargins |
getPageMargins()
Returns page margins.
返回页边距。 |
java.util.List<PageRange> |
getPageRanges()
Returns a list of page ranges that indicate what pages will be printed.
返回指示要打印哪些页面的页面范围的列表。 |
PaperSize |
getPaperSize()
Returns the paper size format.
返回纸张尺寸格式。 |
java.lang.String |
getPdfFilePath()
Returns a string that represents absolute or relative (to the directory with Chromium binaries) path to the PDF file with the printed document.
返回一个字符串,该字符串表示具有打印文档的PDF文件的绝对路径或相对路径(对于带有Chromium二进制文件的目录)。 |
java.lang.String |
getPrinterName()
Returns a string that represents printer name.
返回代表打印机名称的字符串。 |
boolean |
isDisplayHeaderFooter()
Indicates whether headers and footers should be displayed on the printed document.
指示是否在打印的文档上显示页眉和页脚。 |
boolean |
isLandscape()
Indicates whether the document will be printed in landscape or portrait mode.
指示将以横向还是纵向模式打印文档。 |
boolean |
isPrintBackgrounds()
Indicates whether background graphics should be printed or not.
指示是否应打印背景图形。 |
boolean |
isPrintSelectionOnly()
Indicates whether only selection should be printed or the entire document.
指示是仅打印选择内容还是整个文档。 |
boolean |
isPrintToPDF()
Returns
如果文档应打印到PDF文档中并存储在通过setPDFFilePath(String)方法提供的文件中,则返回true。 true if the document should be printed into a PDF document and stored in a file provided through the
setPDFFilePath(String) method.
|
void |
setColorModel(ColorModel colorModel)
Sets print color model.
设置打印颜色模型。 |
void |
setCopies(int copies)
Sets the number of copies to print.
设置要打印的份数。 |
void |
setDisplayHeaderFooter(boolean displayHeaderFooter)
Enables/disables displaying of headers and footers.
启用/禁用页眉和页脚的显示。 |
void |
setDuplexMode(DuplexMode duplexMode)
Sets print duplex mode.
设置打印双面模式。 |
void |
setLandscape(boolean landscape)
Enables/disables landscape mode.
启用/禁用横向模式。 |
void |
setPageMargins(PageMargins pageMargins)
Sets page margins.
设置页边距。 |
void |
setPageRanges(java.util.List<PageRange> ranges)
Sets the list of page ranges that indicate what pages will be printed.
设置页面范围列表,以指示要打印的页面。 |
void |
setPaperSize(PaperSize paperSize)
Sets the paper size format.
设置纸张尺寸格式。 |
void |
setPDFFilePath(java.lang.String pdfFilePath)
Provides an absolute or relative to the directory with Chromium binaries path to a file where the PDF with the printed document should be stored in case of printing to a PDF document.
提供绝对或相对于Chromium二进制文件目录的目录到文件的位置,如果要打印到PDF文档,则应将带有打印文档的PDF存储在该文件中。 |
void |
setPrintBackgrounds(boolean printBackgrounds)
Enables/disables printing background.
启用/禁用打印背景。 |
void |
setPrinterName(java.lang.String printerName)
Sets printer device name.
设置打印机设备名称。 |
void |
setPrintSelectionOnly(boolean printSelectionOnly)
Sets whether only selection on the document should be printed.
设置是否仅打印文档上的选择。 |
void |
setPrintToPDF(boolean printToPDF)
Indicates whether the document should be printed into a PDF document.
指示是否应将文档打印为PDF文档。 |
public boolean isPrintToPDF()
true
if the document should be printed into a PDF document and stored in a file provided through the
setPDFFilePath(String)
method.
public void setPrintToPDF(boolean printToPDF)
public java.lang.String getPdfFilePath()
public void setPDFFilePath(java.lang.String pdfFilePath)
public java.lang.String getPrinterName()
public void setPrinterName(java.lang.String printerName)
null
or empty.
public int getCopies()
public void setCopies(int copies)
public boolean isPrintBackgrounds()
public void setPrintBackgrounds(boolean printBackgrounds)
false
is ignored since PDF is always printed with background graphics.
public boolean isLandscape()
public void setLandscape(boolean landscape)
public boolean isDisplayHeaderFooter()
public void setDisplayHeaderFooter(boolean displayHeaderFooter)
false
is ignored since PDF is always printed with headers and footers.
public PageMargins getPageMargins()
public void setPageMargins(PageMargins pageMargins)
public DuplexMode getDuplexMode()
public void setDuplexMode(DuplexMode duplexMode)
public ColorModel getColorModel()
public void setColorModel(ColorModel colorModel)
public java.util.List<PageRange> getPageRanges()
public void setPageRanges(java.util.List<PageRange> ranges)
public PaperSize getPaperSize()
public void setPaperSize(PaperSize paperSize)
public boolean isPrintSelectionOnly()
true
but there's no selection on the document, an empty document will be printed.
public void setPrintSelectionOnly(boolean printSelectionOnly)