Class PrinterData
 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:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intscopefield value indicating that all pages should be printedbooleanwhether or not the printer should collate the printed paper Note that this field may be controlled by the printer driver.intthe number of copies to print.the printer driver On Windows systems, this is the name of the driver (often "winspool").intSingle-sided or double-sided printing, expressed as one of the following values:SWT.DEFAULTthe default duplex value for the printerDUPLEX_NONEsingle-sided printingDUPLEX_LONG_EDGEdouble-sided printing as if bound on the long edgeDUPLEX_SHORT_EDGEdouble-sided printing as if bound on the short edgestatic final intduplexfield value indicating double-sided printing for binding on the long edge.static final intduplexfield value indicating single-sided printing.static final intduplexfield value indicating double-sided printing for binding on the short edge.intthe end page of a page range, used when scope is PAGE_RANGE.the name of the file to print to if printToFile is true.static final intorientationfield value indicating landscape paper orientationthe name of the printer On Windows systems, this is the name of the 'device'.intThe orientation of the paper, which can be either PORTRAIT or LANDSCAPE.static final intscopefield value indicating that the range of pages specified by startPage and endPage should be printedstatic final intorientationfield value indicating portrait paper orientationbooleanwhether or not the print job should go to a fileintthe scope of the print job, expressed as one of the following values:ALL_PAGESPrint all pages in the current documentPAGE_RANGEPrint the range of pages specified by startPage and endPageSELECTIONPrint the current selectionstatic final intscopefield value indicating that the current selection should be printedintthe start page of a page range, used when scope is PAGE_RANGE.Fields inherited from class org.eclipse.swt.graphics.DeviceDatadebug, errors, objects, tracking
- 
Constructor SummaryConstructorsConstructorDescriptionConstructs 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
- 
Field Details- 
driverthe 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).
- 
namethe 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'.
- 
scopepublic int scopethe 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
 
- 
startPagepublic int startPagethe 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.
- 
endPagepublic int endPagethe 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.
- 
printToFilepublic boolean printToFilewhether or not the print job should go to a file
- 
fileNamethe name of the file to print to if printToFile is true. Note that this field is ignored if printToFile is false.
- 
copyCountpublic int copyCountthe 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.
- 
collatepublic boolean collatewhether 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.
- 
orientationpublic int orientationThe orientation of the paper, which can be either PORTRAIT or LANDSCAPE.- Since:
- 3.5
 
- 
duplexpublic int duplexSingle-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.- Since:
- 3.7
 
- 
ALL_PAGESpublic static final int ALL_PAGESscopefield value indicating that all pages should be printed- See Also:
 
- 
PAGE_RANGEpublic static final int PAGE_RANGEscopefield value indicating that the range of pages specified by startPage and endPage should be printed- See Also:
 
- 
SELECTIONpublic static final int SELECTIONscopefield value indicating that the current selection should be printed- See Also:
 
- 
PORTRAITpublic static final int PORTRAITorientationfield value indicating portrait paper orientation- Since:
- 3.5
- See Also:
 
- 
LANDSCAPEpublic static final int LANDSCAPEorientationfield value indicating landscape paper orientation- Since:
- 3.5
- See Also:
 
- 
DUPLEX_NONEpublic static final int DUPLEX_NONEduplexfield value indicating single-sided printing.This is also known as simplex printing. - Since:
- 3.7
- See Also:
 
- 
DUPLEX_LONG_EDGEpublic static final int DUPLEX_LONG_EDGEduplexfield value indicating double-sided printing for binding on the 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. - Since:
- 3.7
- See Also:
 
- 
DUPLEX_SHORT_EDGEpublic static final int DUPLEX_SHORT_EDGEduplexfield value indicating double-sided printing for binding on the 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. - Since:
- 3.7
- See Also:
 
 
- 
- 
Constructor Details- 
PrinterDatapublic PrinterData()Constructs an instance of this class that can be used to print to the default printer.- See Also:
 
- 
PrinterDataConstructs 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:
 
 
- 
- 
Method Details