Printers may be enumerated and selected for use with a print job.
The configuration of the printer default settings are then used to populate the initial settings for a job.
Since the availability of printers may change during the execution of a program, due to administrative actions, a long running program which has cached a printer which has since been taken off-line, may create a job using that instance, but printing will fail.
| Modifier and Type | Class and Description |
|---|---|
| public static enum | Printer.
The MarginType is used to determine the printable area of a PageLayout. |
| Modifier and Type | Field and Description |
|---|---|
| private PrinterAttributes | |
| private static ReadOnlyObjectWrapper | |
| private PageLayout | |
| private PrinterImpl |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public PageLayout | Returns: PageLayout based on the specified parameters.The paper to use paper, PageOrientation The orientation to use orient, Printer.the margin type to use mTypeObtain a new PageLayout instance for this printer using the specified parameters. |
| public PageLayout | Returns: PageLayout based on the specified parameters.The paper to use paper, PageOrientation The orientation to use orient, double the left margin to use in pts. lMargin, double the right margin to use in pts. rMargin, double the top margin to use in pts. tMargin, double the bottom margin to use in pts. bMargin)Obtain a new PageLayout for this printer using the specified parameters. |
| private static ReadOnlyObjectWrapper | |
| public static ReadOnlyObjectProperty | Returns: the current default printerA read only object property representing the current default printer. |
| public static ObservableSet | |
| pack-priv JobSettings | getDefaultJobSettings()
Returns the default settings for this printer as would be used in setting up a job for this printer. |
| public PageLayout | |
| public static Printer | |
| public String | Returns: printer name.Return the name used by the underlying system to identify the printer to users and/or applications. |
| public PrinterAttributes | Returns: printer attributes.Retrieves the delegate object encapsulating the printer attributes and capabilities. |
| pack-priv PrinterImpl | |
| public String |
| attributes | back to summary |
|---|---|
| private PrinterAttributes attributes | |
| defaultPrinter | back to summary |
|---|---|
| private static ReadOnlyObjectWrapper<Printer> defaultPrinter | |
| defPageLayout | back to summary |
|---|---|
| private PageLayout defPageLayout | |
| impl | back to summary |
|---|---|
| private PrinterImpl impl | |
| Printer | back to summary |
|---|---|
| pack-priv Printer(PrinterImpl impl) | |
| createPageLayout | back to summary |
|---|---|
| public PageLayout createPageLayout(Paper paper, PageOrientation orient, Printer. Obtain a new PageLayout instance for this printer using the specified parameters. The paper should be one of the supported papers and the orientation should be a supported orientation. If the printer cannot support the layout as specified, it will adjust the returned layout to a supported configuration
| |
| createPageLayout | back to summary |
|---|---|
| public PageLayout createPageLayout(Paper paper, PageOrientation orient, double lMargin, double rMargin, double tMargin, double bMargin) Obtain a new PageLayout for this printer using the specified parameters. The paper should be one of the supported papers and the orientation should be a supported orientation. Margin values are specified in 1/72 of an inch points. Margins will be validated against the printer supported margins, and adjusted if necessary. This method is generally useful to a client that wants margins that are different (eg wider) than the default margins, such as 1" at top and bottom and 0.5" to the left and right. A client that needs to know what margin values are legal should first
obtain a PageLayout using the If the printer cannot support the layout as specified, it will adjust the returned layout to a supported configuration
| |
| defaultPrinterImpl | back to summary |
|---|---|
| private static ReadOnlyObjectWrapper | |
| defaultPrinterProperty | back to summary |
|---|---|
| public static ReadOnlyObjectProperty A read only object property representing the current default printer. If there are no installed printers, the wrapped value will be null.
| |
| getAllPrinters | back to summary |
|---|---|
| public static ObservableSet Retrieve the installed printers. The set of printers may be dynamic. Consequently, there is no guarantee that the result will be the same from call to call, but should change only as a result of the default changing in the environment of the application. Note since printers may be installed, but offline, then the application may want to query the status of a printer before using it.
| |
| getDefaultJobSettings | back to summary |
|---|---|
| pack-priv JobSettings getDefaultJobSettings() Returns the default settings for this printer as would be used in setting up a job for this printer. When a job is first created and associated with a printer, (typically the default printer), it acquires these default settings for that printer. This method always returns a new instance. | |
| getDefaultPageLayout | back to summary |
|---|---|
| public PageLayout getDefaultPageLayout() Return the default page layout for this printer.
| |
| getDefaultPrinter | back to summary |
|---|---|
| public static Printer getDefaultPrinter() Retrieve the default printer. May return null if no printers are installed. The configuration of available printers may be dynamic. Consequently there is no guarantee that the result will be the same from call to call, but should change only as a result of the default changing in the environment of the application.
| |
| getName | back to summary |
|---|---|
| public String getName() Return the name used by the underlying system to identify the printer to users and/or applications.
| |
| getPrinterAttributes | back to summary |
|---|---|
| public PrinterAttributes getPrinterAttributes() Retrieves the delegate object encapsulating the printer attributes and capabilities.
| |
| getPrinterImpl | back to summary |
|---|---|
| pack-priv PrinterImpl getPrinterImpl() | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final Printer. | DEFAULT
This requests a default 0.75 inch margin on all sides. |
| public static final Printer. | EQUAL
Choose the largest of the four hardware margins, and use that for all for margins, so that the margins are equal on all sides. |
| public static final Printer. | EQUAL_OPPOSITES
Similar to |
| public static final Printer. | HARDWARE_MINIMUM
Request margins are set to be the smallest on each side that the hardware allows. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Printer. | |
| public static Printer. |
| DEFAULT | back to summary |
|---|---|
| public static final Printer. This requests a default 0.75 inch margin on all sides. This is considered to be a common default and is supported by all known printers. However this may be adjusted if the paper is too small, to ensure that the margins are not more than 50% of the smaller dimension. Applications that do expect to deal with such small media should likely be specifying the required margins explicitly. In the unlikely event the hardware margin is larger than 0.75" it will be adjusted to that same hardware minimum on all sides. | |
| EQUAL | back to summary |
|---|---|
| public static final Printer. Choose the largest of the four hardware margins, and use that for all for margins, so that the margins are equal on all sides. | |
| EQUAL_OPPOSITES | back to summary |
|---|---|
| public static final Printer. Similar to | |
| HARDWARE_MINIMUM | back to summary |
|---|---|
| public static final Printer. Request margins are set to be the smallest on each side that the hardware allows. This creates the greatest printable area but the margins may not be aesthetic if they are too small, or there is significant variation on the different sides of the paper. This is is also useful for an application that wants to know this so it can construct a new PageLayout that fits within these margins. | |
| MarginType | back to summary |
|---|---|
| private MarginType() | |
| valueOf | back to summary |
|---|---|
| public static Printer. | |
| values | back to summary |
|---|---|
| public static Printer. | |