public class PrintingService
extends java.lang.Object
PrinterSetupDialog
s. It exposes a single factory method and
some constants used for setting options in the chained methods of the returned dialog class.PrintingService.PrinterSetupDialog
Modifier and Type | Class and Description |
---|---|
static class |
PrintingService.PrinterSetupDialog
A class that collects option information about a printer selection statement using chained
methods.
|
private static class |
PrintingService.WorkArea
Contextual data.
|
Modifier and Type | Field and Description |
---|---|
static int |
ANY
Constant for page orientation.
|
static int |
LANDSCAPE
Constant for page orientation.
|
private static java.util.logging.Logger |
LOG
Logger for this class.
|
static int |
NONE
Constant for page orientation.
|
static int |
PDF_PRINTER_CONTROL_HANDLE
Control handle of the built-in PDF printer visible to the legacy app
|
static java.lang.String |
PDF_PRINTER_DESCR
Displayable name of the built-in PDF printer visible to the legacy app
|
static java.lang.String |
PDF_PRINTER_NAME
Name of the built-in PDF printer, this is the name the legacy app can use
in the OUTPUT TO PRINTER to address the built-in PDF printer directly.
|
static int |
PORTRAIT
Constant for page orientation.
|
private static java.lang.String |
PRINT_ROOT_NODE
The root node name of the directory print settings
|
private static ContextLocal<PrintingService.WorkArea> |
workArea
The print options as set in the current session
|
Constructor and Description |
---|
PrintingService() |
Modifier and Type | Method and Description |
---|---|
static PrintingService.PrinterSetupDialog |
createSetupDialog()
Factory method for a printer setup dialog.
|
static int |
getControlHandle()
The value of SESSION:PRINTER-CONTROL-HANDLE.
|
static int |
getHDC()
The value of SESSION:PRINTER-HDC.
|
static PrintOptions |
getPrintOptions()
Returns the print options set in the current context.
|
private static float |
loadMargin(java.lang.String attributeName)
Loads margin value from server directory.
|
private static PrintOptions |
loadPrintOptionsFromDirectory()
Loads the following attributes from server directory.
|
static void |
resetControlHandle()
The method sets SESSION:PRINTER-CONTROL-HANDLE and SESSION:PRINTER-HDC to their initial values.
|
static void |
validatePrinterName(java.lang.String name)
Validates the supplied name.
|
public static final int NONE
public static final int PORTRAIT
public static final int LANDSCAPE
public static final int ANY
public static final java.lang.String PDF_PRINTER_NAME
public static final java.lang.String PDF_PRINTER_DESCR
public static final int PDF_PRINTER_CONTROL_HANDLE
private static final java.lang.String PRINT_ROOT_NODE
private static final java.util.logging.Logger LOG
private static final ContextLocal<PrintingService.WorkArea> workArea
public static PrintingService.PrinterSetupDialog createSetupDialog()
PrintingService.PrinterSetupDialog
that can chain eventual option and and finally
execute on client side.public static int getControlHandle()
public static int getHDC()
public static void resetControlHandle()
public static PrintOptions getPrintOptions()
null
.public static void validatePrinterName(java.lang.String name)
name
- A printer name.private static PrintOptions loadPrintOptionsFromDirectory()
PrintOptions.PageSize
for all possible values
PrintOptions.PageOrientation
for all
possible values
<node class="container" name="print">
<node class="string" name="page_size">
<node-attribute name="value" value="Letter"/>
</node>
<node class="string" name="page_orientation">
<node-attribute name="value" value="Portrait"/>
</node>
<node class="string" name="page_margin_top">
<node-attribute name="value" value="0"/>
</node>
<node class="string" name="page_margin_left">
<node-attribute name="value" value="10"/>
</node>
<node class="string" name="page_margin_bottom">
<node-attribute name="value" value="0"/>
</node>
<node class="string" name="page_margin_right">
<node-attribute name="value" value="10"/>
</node>
</node>
The method searches for the above structure in the following directory nodes in the order given:
/server/<serverID>/runtime/<account_or_group>/<id>
If no user/process or group nodes are present, then this is checked: /server/<serverID>/runtime/default/<id>
If no /server/<serverID>/runtime node exists, this is checked (it is the global default area for all servers): /server/default/runtime/<account_or_group>/<id>
Finally, if no user/process or group nodes are present in the global default area, then this is checked: /server/default/runtime/default/<id>
private static float loadMargin(java.lang.String attributeName)
attributeName
- The margin attribute name.