Posted By:
Sriram_Sundararajan
Posted On:
Tuesday, December 27, 2005 01:50 AM
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 sh
More>>
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.
<<Less