public class PrintingManager
extends java.lang.Object
Constructor and Description |
---|
PrintingManager()
Constuctor method for the manager.
|
Modifier and Type | Method and Description |
---|---|
protected void |
finalize()
Clean-up method to help the gc.
|
static javax.print.PrintService |
findPrinter(java.lang.String name)
Looks for a certain print service by its name.
|
static javax.print.PrintService[] |
getAvailablePrinters()
Provides the list of printers installed for the system.
|
boolean |
isPDFSupported()
Checks if the PDF engine is currently available (iText).
|
static boolean |
isPrinterAvailable(java.lang.String name,
boolean checkready)
Checks if a certain printer is up and running for this system.
|
boolean |
isPrintingSupported()
Checks if the printing engine is currently available (Jasper).
|
static void |
main(java.lang.String[] arg)
This may be used especially for debugging purposes.
|
boolean |
preview(boolean merge,
javax.print.PrintService service,
java.awt.Component comp,
boolean openpdf,
java.util.Vector<PrintingJob> jobs,
BackgroundTask bgtask)
Displays the given printing pages using a dialog, pages can be printed/exported from there.
|
boolean |
preview(boolean merge,
javax.print.PrintService service,
java.awt.Component comp,
DockingManager manager,
BackgroundTask bgtask,
boolean openpdf)
Generates the printing pages and prints them using a dialog, pages can be printed/exported from there.
|
boolean |
print(boolean merge,
javax.print.PrintService service,
DockingManager manager,
BackgroundTask bgtask)
Generates the printing pages and prints directly using the OS specific printing functionality.
|
boolean |
print(boolean merge,
javax.print.PrintService service,
java.util.Vector<PrintingJob> jobs)
Prints the given printing pages directly using the OS specific printing functionality.
|
boolean |
processAuto(boolean merge,
javax.print.PrintService service,
java.awt.Component comp,
DockingManager manager,
BackgroundTask bgtask,
boolean preview,
boolean openpdf)
Processes the given printing job based on the application configuration settings.
|
static java.lang.String |
setupFontDirectory()
Sets the directory to find fonts used by JasperReports.
|
protected void |
showNoPagesDialog(java.awt.Component comp)
Gives the user a hint that no printing pages are available.
|
protected void |
showPreviewer(javax.print.PrintService service,
java.awt.Component comp,
java.util.Vector<PrintingJob> jobs,
boolean openpdf,
BackgroundTask bgtask,
boolean merge,
DockingManager manager)
Shows the preview dialog.
|
public PrintingManager()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
- Error indicationpublic boolean isPrintingSupported()
public boolean isPDFSupported()
public static javax.print.PrintService[] getAvailablePrinters()
public static boolean isPrinterAvailable(java.lang.String name, boolean checkready)
name
- Printer name to checkcheckready
- Check if printer is ready, too?public static javax.print.PrintService findPrinter(java.lang.String name)
name
- Printer name to checknull
if not availablejava.lang.NullPointerException
- If a parameter is null
public static java.lang.String setupFontDirectory()
null
if not availablepublic boolean print(boolean merge, javax.print.PrintService service, java.util.Vector<PrintingJob> jobs)
merge
- Shall the separate jobs be merged?service
- The service to use, per dialog otherwisejobs
- The containers with printing pagespublic boolean print(boolean merge, javax.print.PrintService service, DockingManager manager, BackgroundTask bgtask)
merge
- Shall the separate jobs be merged?service
- The service to use, per dialog otherwisemanager
- The docking component (status bar etc.)bgtask
- The task to generate printing pages, must implement PrintingTask
public boolean preview(boolean merge, javax.print.PrintService service, java.awt.Component comp, boolean openpdf, java.util.Vector<PrintingJob> jobs, BackgroundTask bgtask)
merge
- Shall the separate jobs be merged?service
- The service to use, per dialog otherwisecomp
- The component to search the parental windowopenpdf
- Show PDF viewer?jobs
- The containers with printing pagesbgtask
- The task to generate printing pages, must implement PrintingTask
(optional)java.lang.NullPointerException
- If a parameter is null
public boolean preview(boolean merge, javax.print.PrintService service, java.awt.Component comp, DockingManager manager, BackgroundTask bgtask, boolean openpdf)
merge
- Shall the separate jobs be merged?service
- The service to use, per dialog otherwisecomp
- The component to search the parental windowmanager
- The docking component (status bar etc.)bgtask
- The task to generate printing pages, must implement PrintingTask
openpdf
- Show PDF viewer?java.lang.NullPointerException
- If a parameter is null
public boolean processAuto(boolean merge, javax.print.PrintService service, java.awt.Component comp, DockingManager manager, BackgroundTask bgtask, boolean preview, boolean openpdf)
merge
- Shall the separate jobs be merged?service
- The service to use, per dialog otherwisecomp
- The component to search the parental windowmanager
- The docking component (status bar etc.)bgtask
- The task to generate printing pages, must implement PrintingTask
preview
- Show the preview? Direct printing otherwise.openpdf
- Show PDF viewer?java.lang.NullPointerException
- If a parameter is null
protected void showNoPagesDialog(java.awt.Component comp)
comp
- The component to search the parental windowprotected void showPreviewer(javax.print.PrintService service, java.awt.Component comp, java.util.Vector<PrintingJob> jobs, boolean openpdf, BackgroundTask bgtask, boolean merge, DockingManager manager)
comp
- The component to search the parental windowservice
- The service to use, per dialog otherwisejobs
- The containers with printing pagesopenpdf
- Show PDF viewer?bgtask
- The task to generate printing pages, must implement PrintingTask
(optional)merge
- Shall the separate jobs be merged?manager
- The docking component (status bar etc.)public static void main(java.lang.String[] arg)
arg
- Array of String
objects with console paramsCopyright © 2005-2023 Leisenfels GmbH. All rights reserved.