public interface DocPrintJob 
      | Modifier and Type | Method and Description | 
|---|---|
| void | addPrintJobAttributeListener(PrintJobAttributeListener listener, PrintJobAttributeSet attributes)
              注册侦听器以指定属性的更改。 
             | 
| void | addPrintJobListener(PrintJobListener listener)
              为此打印作业期间发生的事件注册一个侦听器。 
             | 
| PrintJobAttributeSet | getAttributes()
              获取此打印作业的一组打印属性。 
             | 
| PrintService | getPrintService() 
             确定此打印作业对象绑定到的 PrintService对象。 | 
| void | print(Doc doc, PrintRequestAttributeSet attributes)
              打印具有指定作业属性的文档。 
             | 
| void | removePrintJobAttributeListener(PrintJobAttributeListener listener)
              从此打印作业中删除属性侦听器。 
             | 
| void | removePrintJobListener(PrintJobListener listener)
              从此打印作业中移除侦听器。 
             | 
PrintService getPrintService()
PrintService对象。 
          PrintService对象。 
           PrintJobAttributeSet getAttributes()
getAttributes()方法调用时设置的属性的“快照”; 
           也就是说,如果此打印作业的属性集的内容在将来更改,则返回的属性集的对象的内容将不会被更新。 
           要检测属性值的更改,请再次调用getAttributes() ,并将新属性集与先前的属性集进行比较; 
           或者,为打印作业事件注册一个侦听器。 
           返回的值可能是空集,但不应为空。 
          void addPrintJobListener(PrintJobListener listener)
listener - 实现侦听器接口的对象 
           removePrintJobListener(javax.print.event.PrintJobListener) 
           void removePrintJobListener(PrintJobListener listener)
listener - 实现侦听器接口的对象 
           addPrintJobListener(javax.print.event.PrintJobListener) 
           void addPrintJobAttributeListener(PrintJobAttributeListener listener, PrintJobAttributeSet attributes)
getAttributes()并识别有趣且可能向侦听器报告的子集。 
           希望对特定作业属性中的更改进行更新的客户端应验证它是否在该集合中,但是仅当更改关于属性的更新,并且该作业才能检测到属性时才会进行更新。 
           此外,更新可能会受到作业的批处理。 
           为了最小化打印作业处理的开销,建议只监听可能会发生变化的属性子集。 
           如果指定的集合为空,则不会将属性更新报告给侦听器。 
           如果属性集为空,那么这意味着监听该作业支持的所有动态属性。 
           如果作业无法报告任何属性更新,则可能导致没有更新通知。 
           如果听众已经注册,它将被重新注册。 
          listener - 实现侦听器接口的对象 
           attributes - 要监听的属性,或null表示可以更改的所有属性(由作业确定)。 
           removePrintJobAttributeListener(javax.print.event.PrintJobAttributeListener) 
           void removePrintJobAttributeListener(PrintJobAttributeListener listener)
listener - 实现侦听器接口的对象 
           addPrintJobAttributeListener(javax.print.event.PrintJobAttributeListener, javax.print.attribute.PrintJobAttributeSet) 
           void print(Doc doc, PrintRequestAttributeSet attributes) throws PrintException
 打印服务实现者应该关闭他们从客户端文档获取的任何打印数据流(即Reader或InputStream实现)。 稳健的客户可能仍然希望验证这一点。 总是产生一个异常,如果一个DocFlavor不能打印。 
doc - 要印刷的文件。 
            如果必须是此PrintJob支持的风味。 
           attributes - 要应用于此打印作业的作业属性。 
            如果此参数为null,则使用默认属性。 
           PrintException - 该异常还可以实现更准确地描述异常原因的接口 
             Submit a bug or feature 
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.