Class PrinterData

Instances of this class are descriptions of a print job
in terms of the printer, and the scope and type of printing
that is desired. For example, the number of pages and copies
can be specified, as well as whether or not the print job
should go to a file.

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.

Single-sided or double-sided printing, expressed as one of the
following values:
SWT.DEFAULT
the default duplex value for the printer
DUPLEX_NONE
single-sided printing
DUPLEX_LONG_EDGE
double-sided printing as if bound on the long edge
DUPLEX_SHORT_EDGE
double-sided printing as if bound on the short edge
The default value is SWT.DEFAULT, meaning do not set a value;
use the printer's default duplex setting.

the scope of the print job, expressed as one of the following values:
ALL_PAGES
Print all pages in the current document
PAGE_RANGE
Print the range of pages specified by startPage and endPage
SELECTION
Print the current selection

Field Detail

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).

printToFile

fileName

the name of the file to print to if printToFile is true.
Note that this field is ignored if printToFile is false.

copyCount

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.

collate

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.

orientation

public int orientation

The orientation of the paper, which can be either PORTRAIT
or LANDSCAPE.

Since:

3.5

duplex

public int duplex

Single-sided or double-sided printing, expressed as one of the
following values:

SWT.DEFAULT

the default duplex value for the printer

DUPLEX_NONE

single-sided printing

DUPLEX_LONG_EDGE

double-sided printing as if bound on the long edge

DUPLEX_SHORT_EDGE

double-sided printing as if bound on the short edge

The default value is SWT.DEFAULT, meaning do not set a value;
use the printer's default duplex setting.
A printer's default value is typically single-sided,
however it can default to double-sided in order to save paper.