wood burning stoves 2.0*
The moose likes Java in General and the fly likes Job name when printing file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Job name when printing file" Watch "Job name when printing file" New topic
Author

Job name when printing file

Paulo Carvalho
Ranch Hand

Joined: Nov 12, 2008
Posts: 56
Hello

I made a Java application which prints a file.

When the application sends the file for print, I define an attribute to give a name for the print Job so I can recognize the file being printed. To do this I have the following code:

...
// Monitor print job events
PrintJobManagment pjm = new PrintJobManagment(dPJ);
PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet();
pras.add(new JobName("1.doc", null));
dPJ.print(doc, pras);
...


Using java 1.6, everything works fine. When I open the printer queue I can see the file ("1.doc") being printed.

Using Java 1.5 the result is not the same: When I open the printer queue I can see a file being printed but I cannot identify it by this name. It is always called "Local Document" (or something similar).

As I must use Java 1.5 and I must be able to recognize the file being printed, anaybody can give me some information about this problem? Who can I resolve it? Is there any workaround?

Thanks
Regards
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Do the Javadocs tell you of a change to the API between 1.5 and 1.6?


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Job name when printing file
 
Similar Threads
printer not calling through this program..
print a file to a printer help
Help with printing a file to a printer
is there any guide lines for this problem ?
Printing Report in Struts2