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. <p> Application code does <em>not</em> need to explicitly release the resources managed by each instance when those instances are no longer required, and thus no <code>dispose()</code> method is provided. </p>

@see Printer @see Printer#getPrinterList @see PrintDialog#open @see <a href="http://www.eclipse.org/swt/snippets/#printing">Printing snippets</a> @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>

Constructors

this
this()

Constructs an instance of this class that can be used to print to the default printer.

this
this(String driver, String name)

Constructs an instance of this class with the given printer driver and printer name.

Members

Functions

toString
String toString()

Returns a string containing a concise, human-readable description of the receiver.

Static variables

ALL_PAGES
int ALL_PAGES;

<code>scope</code> field value indicating that all pages should be printed

PAGE_RANGE
int PAGE_RANGE;

<code>scope</code> field value indicating that the range of pages specified by startPage and endPage should be printed

SELECTION
int SELECTION;

<code>scope</code> field value indicating that the current selection should be printed

Variables

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

endPage
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
String fileName;

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

name
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'.

otherData
char[] otherData;

private, platform-specific data On Windows, this contains a copy of the DEVMODE struct returned from the <code>PrintDialog</code>. On GTK, this contains a copy of the print_settings and page_setup returned from the <code>PrintDialog</code>. On OS X Carbon, this contains a copy of the PrintSettings and PageFormat returned from the <code>PrintDialog</code>. This field is not currently used on the X/Window System.

printToFile
bool printToFile;

whether or not the print job should go to a file

scope_
int scope_;

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

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

Meta