• Post Reply Bookmark Topic Watch Topic
  • New Topic

printing in java

 
sriram sundararajan
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using JPS API for printing the document. Below is the code snippet which i am using.
DocFlavor flavor = DocFlavor.INPUT_STREAM.AUTOSENSE;
PrintService currentService =
PrintServiceLookup.lookupDefaultPrintService();
PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet();
DocPrintJob job = currentService.createPrintJob();
InputStream is = new BufferedInputStream(new FileInputStream("checkin.txt"));
Doc doc = new SimpleDoc(is, flavor, null);
job.print(doc, pras);
The problem with this code is while printing it is printing 10 copies of the document. But according to the API if no attribute is added it should print only 1 copy. I also explicitly added the no. of copies
PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet();
pras.add(new Copies(1));
but then also it is printing 10 copies. Let me know how to resolve this issue.
 
Nik lammar
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello


Go THERE

C ya!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!