[nbusers] Having trouble using copies in ServiceUI.PrintDialog

  • From: "Egregory11" < >
  • To:
  • Subject: [nbusers] Having trouble using copies in ServiceUI.PrintDialog
  • Date: Fri, 30 Mar 2012 16:48:01 +0000

Everything works except for the number of copies when I add 

attributes.add(new Copies(3));

It just changes the default number of copies but still only prints one label.

Any help in this would be much appreciated.



Code:
 File file = new File("12345.txt");
    InputStream is = new FileInputStream(file);
      
     PrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet();
            
                
    PrintService[] blast = PrintServiceLookup.lookupPrintServices(null,null );
    PrintService[] svc = PrintServiceLookup.lookupPrintServices(null, 
attributes);
    
    if (blast.length > 0) {
        
    PrintService service = ServiceUI.printDialog(null, 100, 100, blast, 
svc[0], null, attributes);
       
    System.out.println(service.getName());
    
    DocPrintJob job = service.createPrintJob();
    
   
 
    
   Doc doc = new SimpleDoc(is, DocFlavor.INPUT_STREAM.AUTOSENSE, null);
  
   
   
   if (service != null) {               
job.print(doc,attributes);
   }       
System.out.println("DOC : \n "+doc.getPrintData());
   
   }
    








[nbusers] Having trouble using copies in ServiceUI.PrintDialog

Egregory11 03/30/2012

<Possible follow-up(s)>

[nbusers] Having trouble using copies in ServiceUI.PrintDialog

Egregory11 03/30/2012

Project Features

About this Project

www was started in November 2009, is owned by jpirek, and has 21 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close