public class PrintManager extends Object
PrintManager
manages and executes print requests.Modifier and Type | Method and Description |
---|---|
static void |
executePrintJob(AbstractPrinter printer)
Executes a print job using the given printer instance.
|
static void |
executePrintJob(PrintJobConfiguration cfg)
Executes a print job using a configuration specified in the given
PrintJobConfiguration
object. |
static String |
getLastPrintServiceName()
Returns the last used print service name if available.
|
static String[] |
getLastPrintServiceNames()
Returns all last used print service names if available.
|
static boolean |
isPrintServiceAvailable()
Returns whether any printing service is available.
|
static void |
setLastPrintServiceName(String lastPrintServiceName)
Sets the last used print service name.
|
public static void executePrintJob(AbstractPrinter printer)
Whether the print job runs asynchronously or synchronously depends on the
PrintJobConfiguration.isAsynchronousPrinting()
setting provided by the
PrintJobConfiguration
retrieved with
AbstractPrinter.getPrintJobConfiguration()
.
printer
- the AbstractPrinter
that should be executed.public static void executePrintJob(PrintJobConfiguration cfg)
PrintJobConfiguration
object.
The print job runs asynchronously or synchronously depending on the
PrintJobConfiguration.isAsynchronousPrinting()
setting.
cfg
- the PrintJobConfiguration
that provides the configuration for the print job
to be executed.public static String getLastPrintServiceName()
null
if not available.public static String[] getLastPrintServiceNames()
null
if not availablepublic static void setLastPrintServiceName(String lastPrintServiceName)
lastPrintServiceName
- last used print service name.IllegalArgumentException
- if argument for lastPrintServiceName is null
.public static boolean isPrintServiceAvailable()
true
if at least one print service is available and printing is possible,
false
otherwiseCopyright © 2024 levigo holding gmbh. All rights reserved.