I have a postscript printer (Driver) installed on my machine and it supports copies, n-up etc. But when i print using JPS, PrintRequestAttributeSet has no effect on printing. please find the code below and let me know if i am doing anything wrong:
DocFlavor flavor = DocFlavor.INPUT_STREAM.POSTSCRIPT;
PrintService[] pservices = PrintServiceLookup.lookupPrintServices(flavor, null);
PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
aset.add(new Copies(2));
PrintService[] pservices = PrintServiceLookup.lookupPrintServices(flavor, null);
if (pservices.length > 0)
{
DocPrintJob pj = pservices[0].createPrintJob(); // printer is at 0th index
FileInputStream fis = new FileInputStream("C:\\Test\\2.ps");
Doc doc = new SimpleDoc(fis, flavor,null);
pj.print(doc, aset);
}