Results 1 to 2 of 2
  1. #1
    nvngyl is offline Member
    Join Date
    Jul 2009
    Rep Power

    Default PS Prinitng Issue - Copies not working

    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\\");
    Doc doc = new SimpleDoc(fis, flavor,null);
    pj.print(doc, aset);

  2. #2
    Bozz is offline Member
    Join Date
    Aug 2009
    Rep Power


    Same type of issue here.

    Setting "DUPLEX" neither "Tray x" selection works.

    Who can shed some light on this ?

    Printing with attributes shouldn't be to hard.

    Thanks in advance

Similar Threads

  1. PDF Box issue
    By jazz2k8 in forum Advanced Java
    Replies: 0
    Last Post: 03-20-2009, 12:04 PM
  2. Keeping track of Copies + Comparisons in Sort Methods
    By VinceGuad in forum New To Java
    Replies: 0
    Last Post: 03-12-2009, 05:07 AM
  3. Session Issue
    By jazz2k8 in forum Advanced Java
    Replies: 2
    Last Post: 11-05-2008, 02:28 PM
  4. Replies: 8
    Last Post: 05-28-2008, 08:00 AM
  5. Issue
    By chaitu444 in forum New To Java
    Replies: 2
    Last Post: 11-06-2007, 08:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts