PrintJob.setName() equivalent in DocPrintJob

Discussion in 'Java' started by staff, Aug 31, 2004.

  1. staff

    staff Guest

    Hello all,

    I was using PrintJob for printing, but now I have to use DocPrintJob. In
    PrintJob there was method setName() for setting job name. In DocPrintJob
    there is no such method, and I couldn't find any similar doing the same
    thing.

    Does anyone know how to set name of DocPrintJob?

    Thanks in advance
    Pawel Stawicki
     
    staff, Aug 31, 2004
    #1
    1. Advertising

  2. staff

    Guest

    On Tuesday, August 31, 2004 2:45:41 AM UTC-5, staff wrote:
    > Hello all,
    >
    > I was using PrintJob for printing, but now I have to use DocPrintJob. In
    > PrintJob there was method setName() for setting job name. In DocPrintJob
    > there is no such method, and I couldn't find any similar doing the same
    > thing.
    >
    > Does anyone know how to set name of DocPrintJob?
    >
    > Thanks in advance
    > Pawel Stawicki



    I see this is an old issue, but for future reference you can use:

    //Create Object to store attributes
    PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
    //Add the jobname as attribute
    aset.add(new JobName(pdfFile.getName(), Locale.getDefault()));
    ....
    DocPrintJob docPrint = ps.createPrintJob();
    docPrint.print(printDoc, aset);
     
    , Oct 12, 2012
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brendan Duffy

    Re: Image Scanning - TWAIN equivalent

    Brendan Duffy, Jul 24, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    1,486
    Brendan Duffy
    Jul 24, 2003
  2. Lolo
    Replies:
    3
    Views:
    597
  3. Sanjeev
    Replies:
    4
    Views:
    3,573
    Jonathan Bromley
    Jul 23, 2004
  4. Eric Peers
    Replies:
    2
    Views:
    1,370
    Jonathan Bromley
    Nov 18, 2004
  5. stat
    Replies:
    2
    Views:
    2,336
Loading...

Share This Page