Application code does not need to explicitly release the
resources managed by each instance when those instances are no longer
required, and thus no dispose() method is provided.
Printer, Printer#getPrinterList, PrintDialog#open, Printing snippets, Sample code and further information
| Modifier and Type | Field and Description |
|---|---|
| public static final int | ALL_PAGES
|
| public boolean | collate
whether or not the printer should collate the printed paper Note that this field may be controlled by the printer driver. |
| public int | copyCount
the number of copies to print. |
| public String | driver
the printer driver On Windows systems, this is the name of the driver (often "winspool"). |
| public int | duplex
Single-sided or double-sided printing, expressed as one of the following values:
|
| public static final int | DUPLEX_LONG_EDGE
|
| public static final int | DUPLEX_NONE
|
| public static final int | DUPLEX_SHORT_EDGE
|
| public int | endPage
the end page of a page range, used when scope is PAGE_RANGE. |
| public String | fileName
the name of the file to print to if printToFile is true. |
| public static final int | LANDSCAPE
|
| public String | name
the name of the printer On Windows systems, this is the name of the 'device'. |
| public int | orientation
The orientation of the paper, which can be either PORTRAIT or LANDSCAPE. |
| pack-priv byte[] | otherData
private, platform-specific data
On Windows, this contains a copy of the DEVMODE struct
returned from the |
| public static final int | PAGE_RANGE
|
| public static final int | PORTRAIT
|
| public boolean | printToFile
whether or not the print job should go to a file |
| public int | scope
the scope of the print job, expressed as one of the following values:
|
| public static final int | SELECTION
|
| public int | startPage
the start page of a page range, used when scope is PAGE_RANGE. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | PrinterData(String
the printer driver for the printer driver, String the name of the printer name)Constructs an instance of this class with the given printer driver and printer name. |
| Modifier and Type | Method and Description |
|---|---|
| public String | Returns: a string representation of the receiverOverrides java. |
| ALL_PAGES | back to summary |
|---|---|
| public static final int ALL_PAGES
| |
| collate | back to summary |
|---|---|
| public boolean collate whether or not the printer should collate the printed paper Note that this field may be controlled by the printer driver. In other words, the printer itself may be capable of doing the collation, and if so, the value of this field will always be false. | |
| copyCount | back to summary |
|---|---|
| public int copyCount the number of copies to print. Note that this field may be controlled by the printer driver In other words, the printer itself may be capable of printing multiple copies, and if so, the value of this field will always be 1. | |
| driver | back to summary |
|---|---|
| public String driver the printer driver On Windows systems, this is the name of the driver (often "winspool"). On Mac OSX, this is the destination type ("Printer", "Fax", "File", or "Preview"). On X/Window systems, this is the name of a display connection to the Xprt server (the default is ":1"). On GTK+, this is the backend type name (eg. GtkPrintBackendCups). | |
| duplex | back to summary |
|---|---|
| public int duplex Single-sided or double-sided printing, expressed as one of the following values:
The default value is
| |
| DUPLEX_LONG_EDGE | back to summary |
|---|---|
| public static final int DUPLEX_LONG_EDGE
For portrait orientation, the long edge is vertical. For landscape orientation, the long edge is horizontal. This is also known as duplex printing.
| |
| DUPLEX_NONE | back to summary |
|---|---|
| public static final int DUPLEX_NONE
This is also known as simplex printing.
| |
| DUPLEX_SHORT_EDGE | back to summary |
|---|---|
| public static final int DUPLEX_SHORT_EDGE
For portrait orientation, the short edge is horizontal. For landscape orientation, the short edge is vertical. This is also known as duplex tumble printing.
| |
| endPage | back to summary |
|---|---|
| public int endPage the end page of a page range, used when scope is PAGE_RANGE. This value can be from 1 to the maximum number of pages for the platform. | |
| fileName | back to summary |
|---|---|
| public String fileName the name of the file to print to if printToFile is true. Note that this field is ignored if printToFile is false. | |
| LANDSCAPE | back to summary |
|---|---|
| public static final int LANDSCAPE
| |
| name | back to summary |
|---|---|
| public String name the name of the printer On Windows systems, this is the name of the 'device'. On Mac OSX, X/Window systems, and GTK+, this is the printer's 'name'. | |
| orientation | back to summary |
|---|---|
| public int orientation The orientation of the paper, which can be either PORTRAIT or LANDSCAPE.
| |
| otherData | back to summary |
|---|---|
| pack-priv byte[] otherData private, platform-specific data
On Windows, this contains a copy of the DEVMODE struct
returned from the | |
| PAGE_RANGE | back to summary |
|---|---|
| public static final int PAGE_RANGE
| |
| PORTRAIT | back to summary |
|---|---|
| public static final int PORTRAIT
| |
| printToFile | back to summary |
|---|---|
| public boolean printToFile whether or not the print job should go to a file | |
| scope | back to summary |
|---|---|
| public int scope the scope of the print job, expressed as one of the following values:
| |
| SELECTION | back to summary |
|---|---|
| public static final int SELECTION
| |
| startPage | back to summary |
|---|---|
| public int startPage the start page of a page range, used when scope is PAGE_RANGE. This value can be from 1 to the maximum number of pages for the platform. | |
| PrinterData | back to summary |
|---|---|
| public PrinterData() Constructs an instance of this class that can be used to print to the default printer.
| |
| PrinterData | back to summary |
|---|---|
| public PrinterData(String driver, String name) Constructs an instance of this class with the given printer driver and printer name. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a string containing a concise, human-readable description of the receiver. | |