The Java Developers Almanac 1.4


Order this book from Amazon.

   
Home > List of Packages > javax.print.attribute.standard  [3 examples]

e711. Setting the Number of Copies of a Print Job

Print job attributes are delivered to the print service via the print request attribute set supplied to DocPrintJob.print(). See e700 The Quintessential Printing Program Using a Printing Service to see how to set up a print job.
    try {
        // Set up the attribute set
        PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
        aset.add(new Copies(2));
    
        // Print it
        job.print(doc, aset);
    } catch (PrintException e) {
    }

 Related Examples
e710. Setting the Orientation of a Print Job -- Portrait or Landscape
e712. Printing to a File


© 2002 Addison-Wesley.