PrintJob.setName() equivalent in DocPrintJob

S

staff

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
 
U

ulises.sci

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);
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top