Results 1 to 4 of 4
  1. #1
    pjmorce is offline Member
    Join Date
    Nov 2008
    Posts
    17
    Rep Power
    0

    Default Job name when printing file

    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

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    Is that Java API talking about any deprecation on 1.6 features? I cannot see any other cause for this.

  3. #3
    pjmorce is offline Member
    Join Date
    Nov 2008
    Posts
    17
    Rep Power
    0

    Default The bug is known

    I searched more and I found that it is a known bug by sun and it has been corrected on Java 1.6.

    Sun Bug ID: 4988628.

    I would like to know if there is a workaround to resolve the problem with java 1.5.

    Thanks

    Regards

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    If Suns' corrected this bug on 1.6, I don't think there is a way to do it in 1.5. But there can be another approach, but I didn't get a way into my mind at once.

    Why don't you work on with 1.6, all the things you have done on 1.5 is possible on 1.6 as well. Only thing may you have to do is remove deprecated stuff. But between 1.5 and 1.6 there is no huge difference.

Similar Threads

  1. Help in Printing
    By kirly in forum Advanced Java
    Replies: 3
    Last Post: 10-03-2011, 04:40 PM
  2. Printing Example
    By Java Tip in forum SWT Tips
    Replies: 0
    Last Post: 07-11-2008, 05:41 PM
  3. Problem after Printing GUI.
    By coldblood22 in forum AWT / Swing
    Replies: 1
    Last Post: 04-05-2008, 03:43 PM
  4. Printing using java
    By ramachandran in forum Advanced Java
    Replies: 1
    Last Post: 01-05-2008, 11:16 AM
  5. printing problem
    By ntpl in forum AWT / Swing
    Replies: 0
    Last Post: 11-27-2007, 12:20 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
  •