|
|
|
|
org.eclipse.swt.printing
Class PrinterData
java.lang.Object
org.eclipse.swt.graphics.DeviceData
org.eclipse.swt.printing.PrinterData
-
public final class PrinterData
- extends
DeviceData
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.
-
See Also:
-
Printer ,
Printer.getPrinterList() ,
PrintDialog.open() ,
Printing snippets,
Sample code and further information
Field Summary
|
static int
|
ALL_PAGES
scope field value indicating that
all pages should be printed |
boolean
|
collate
whether or not the printer should collate the printed paper
Note that this field may be controlled by the printer driver. |
int
|
copyCount
the number of copies to print. |
String
|
driver
the printer driver
On Windows systems, this is the name of the driver (often "winspool"). |
int
|
endPage
the end page of a page range, used when scope is PAGE_RANGE. |
String
|
fileName
the name of the file to print to if printToFile is true. |
static int
|
LANDSCAPE
orientation field value indicating
landscape paper orientation |
String
|
name
the name of the printer
On Windows systems, this is the name of the 'device'. |
int
|
orientation
The orientation of the paper, which can be either PORTRAIT
or LANDSCAPE. |
static int
|
PAGE_RANGE
scope field value indicating that
the range of pages specified by startPage and endPage
should be printed |
static int
|
PORTRAIT
orientation field value indicating
portrait paper orientation |
boolean
|
printToFile
whether or not the print job should go to a file |
int
|
scope
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
|
static int
|
SELECTION
scope field value indicating that
the current selection should be printed |
int
|
startPage
the start page of a page range, used when scope is PAGE_RANGE. |
Constructor Summary
|
PrinterData
()
Constructs an instance of this class that can be
used to print to the default printer. |
PrinterData
(
String driver,
String name)
Constructs an instance of this class with the given
printer driver and printer name. |
Method Summary
|
String
|
toString
()
Returns a string containing a concise, human-readable
description of the receiver. |
driver
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).
name
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'.
scope
public int scope
- 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
startPage
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.
endPage
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.
printToFile
public boolean printToFile
- whether or not the print job should go to a file
fileName
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.
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
ALL_PAGES
public static final int ALL_PAGES
-
scope field value indicating that
all pages should be printed
-
See Also:
-
Constant Field Values
PAGE_RANGE
public static final int PAGE_RANGE
-
scope field value indicating that
the range of pages specified by startPage and endPage
should be printed
-
See Also:
-
Constant Field Values
SELECTION
public static final int SELECTION
-
scope field value indicating that
the current selection should be printed
-
See Also:
-
Constant Field Values
PORTRAIT
public static final int PORTRAIT
-
orientation field value indicating
portrait paper orientation
-
Since:
- 3.5
-
See Also:
-
Constant Field Values
LANDSCAPE
public static final int LANDSCAPE
-
orientation field value indicating
landscape paper orientation
-
Since:
- 3.5
-
See Also:
-
Constant Field Values
PrinterData
public PrinterData()
- Constructs an instance of this class that can be
used to print to the default printer.
-
See Also:
-
Printer.getDefaultPrinterData()
PrinterData
public PrinterData(
String driver,
String name)
- Constructs an instance of this class with the given
printer driver and printer name.
-
Parameters:
-
driver - the printer driver for the printer -
name - the name of the printer -
See Also:
-
driver ,
name
toString
public
String toString()
- Returns a string containing a concise, human-readable
description of the receiver.
-
-
Overrides:
-
toString
in class
Object
-
-
Returns:
- a string representation of the receiver
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.
|
|
|