Package org.compiere.print
Class PrintUtil
- java.lang.Object
-
- org.compiere.print.PrintUtil
-
public class PrintUtil extends Object
Print Utilities- Version:
- $Id: PrintUtil.java,v 1.2 2006/07/30 00:53:02 jjanke Exp $
- Author:
- Jorg Janke
-
-
Constructor Summary
Constructors Constructor Description PrintUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
dump(PrinterJob job)
Dump Printer Job infostatic void
dump(PrintRequestAttributeSet prats)
Dump Print Request Service Attribute Set to System.outstatic void
dump(PrintServiceAttributeSet psas)
Dump Print Service Attribute Set to System.outstatic void
dump(DocFlavor docFlavor)
Dump Stream Print Servicesstatic void
dump(DocFlavor docFlavor, String outputMimeType)
Dump Stream Print Servicesstatic PrintService[]
getAllPrintServices()
Get Print Services for all flavor and prattstatic DocFlavor
getDefaultFlavor()
Get Default Application Flavorstatic PrintRequestAttributeSet
getDefaultPrintRequestAttributes()
Return Default Print Request Attributesstatic PrintService
getDefaultPrintService()
Get Default Print Servicestatic JobPriority
getJobPriority(int pages, int copies, boolean withDialog)
Get Job Priority based on pages printed.static PrinterJob
getPrinterJob()
Return default PrinterJobstatic PrinterJob
getPrinterJob(String printerName)
Return PrinterJob with selected printer name.static PrintService[]
getPrintServices()
Get Print Services for standard flavor and prattstatic void
print(Pageable pageable, String printerName, String jobName, int copies, boolean withDialog)
Print (async)static void
print(Pageable pageable, PrintRequestAttributeSet prats)
Print Asyncstatic void
print(PrinterJob job, PrintRequestAttributeSet prats, boolean withDialog, boolean waitForIt)
Printstatic void
setupPrintForm(int AD_Client_ID)
Create Print Form and Print Formats for a new Clientstatic void
setupPrintForm(int AD_Client_ID, String trxName)
Create Print Form and Print Formats for a new Client
-
-
-
Method Detail
-
getDefaultPrintRequestAttributes
public static PrintRequestAttributeSet getDefaultPrintRequestAttributes()
Return Default Print Request Attributes- Returns:
- PrintRequestAttributeSet
-
getDefaultFlavor
public static DocFlavor getDefaultFlavor()
Get Default Application Flavor- Returns:
- Pageable
-
getAllPrintServices
public static PrintService[] getAllPrintServices()
Get Print Services for all flavor and pratt- Returns:
- print services
-
getPrintServices
public static PrintService[] getPrintServices()
Get Print Services for standard flavor and pratt- Returns:
- print services
-
getDefaultPrintService
public static PrintService getDefaultPrintService()
Get Default Print Service- Returns:
- PrintService
-
getPrinterJob
public static PrinterJob getPrinterJob()
Return default PrinterJob- Returns:
- PrinterJob
-
getPrinterJob
public static PrinterJob getPrinterJob(String printerName)
Return PrinterJob with selected printer name.- Parameters:
printerName
- if null, get default printer (Ini)- Returns:
- PrinterJob
-
print
public static void print(Pageable pageable, String printerName, String jobName, int copies, boolean withDialog)
Print (async)- Parameters:
printerName
- optional printer namejobName
- optional printer job namepageable
- pageablecopies
- number of copieswithDialog
- if true, shows printer dialog
-
print
public static void print(Pageable pageable, PrintRequestAttributeSet prats)
Print Async- Parameters:
pageable
- pageableprats
- print attribure set
-
print
public static void print(PrinterJob job, PrintRequestAttributeSet prats, boolean withDialog, boolean waitForIt)
Print- Parameters:
job
- printer jobprats
- print attribure setwithDialog
- if true shows DialogwaitForIt
- if false print async
-
getJobPriority
public static JobPriority getJobPriority(int pages, int copies, boolean withDialog)
Get Job Priority based on pages printed. The more pages, the lower the priority- Parameters:
pages
- number of pagescopies
- number of copieswithDialog
- dialog gets lower priority than direct print- Returns:
- Job Priority
-
dump
public static void dump(PrinterJob job)
Dump Printer Job info- Parameters:
job
- printer job
-
dump
public static void dump(PrintServiceAttributeSet psas)
Dump Print Service Attribute Set to System.out- Parameters:
psas
- PS Attribute Set
-
dump
public static void dump(PrintRequestAttributeSet prats)
Dump Print Request Service Attribute Set to System.out- Parameters:
prats
- Print Request Attribute Set
-
dump
public static void dump(DocFlavor docFlavor, String outputMimeType)
Dump Stream Print Services- Parameters:
docFlavor
- flavoroutputMimeType
- mime
-
dump
public static void dump(DocFlavor docFlavor)
Dump Stream Print Services- Parameters:
docFlavor
- flavor
-
setupPrintForm
public static void setupPrintForm(int AD_Client_ID)
Create Print Form and Print Formats for a new Client. - Order, Invoice, etc. Called from VSetup- Parameters:
AD_Client_ID
- new Client
-
setupPrintForm
public static void setupPrintForm(int AD_Client_ID, String trxName)
Create Print Form and Print Formats for a new Client. - Order, Invoice, etc. Called from VSetup- Parameters:
AD_Client_ID
- new ClienttrxName
-
-
-