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 Details

    • PrintUtil

      public PrintUtil()
  • Method Details

    • getDefaultPrintRequestAttributes

      public static PrintRequestAttributeSet getDefaultPrintRequestAttributes()
      Get 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 print request attributes
      Returns:
      print services
    • getPrintServices

      public static PrintService[] getPrintServices()
      Get Print Services for standard flavor and print request attributes
      Returns:
      print services
    • getDefaultPrintService

      public static PrintService getDefaultPrintService()
      Get Default Print Service
      Returns:
      PrintService
    • getPrinterJob

      public static PrinterJob getPrinterJob()
      Get default PrinterJob
      Returns:
      PrinterJob
    • getPrinterJob

      public static PrinterJob getPrinterJob(String printerName)
      Get PrinterJob with selected printer name.
      Parameters:
      printerName - if null, get default printer (Ini.P_PRINTER)
      Returns:
      PrinterJob
    • print

      public static void print(Pageable pageable, String printerName, String jobName, int copies, boolean withDialog)
      Print (async)
      Parameters:
      printerName - optional printer name
      jobName - optional printer job name
      pageable - pageable
      copies - number of copies
      withDialog - if true, shows printer dialog
    • print

      public static void print(Pageable pageable, PrintRequestAttributeSet prats)
      Print Async
      Parameters:
      pageable - pageable
      prats - print request attribute set
    • print

      public static void print(PrinterJob job, PrintRequestAttributeSet prats, boolean withDialog, boolean waitForIt)
      Print
      Parameters:
      job - printer job
      prats - print request attribute set
      withDialog - if true shows Dialog
      waitForIt - 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 pages
      copies - number of copies
      withDialog - 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 - flavor
      outputMimeType - 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.
      Parameters:
      AD_Client_ID - new Client
      trxName -