Results 1 to 1 of 1
  1. #1
    Join Date
    Feb 2011
    Posts
    1
    Rep Power
    0

    Default javax.print setting attributes

    There's no section for javax.print so -

    I have a program for printing a pdf file that was generated using the iText 2 package.
    The file is created as an A4 document.
    The program is able to load the file and send the print job - it reaches the printer, but on the printer the control panel prompts the user to load A4, Plain Paper. The print job will come out if the user presses "OK" on the printer to override and print to whatever paper is loaded.
    I need it to print directly without user intervention, as the same file prints directly from Adobe Reader without this problem.
    I also need it to print 2 copies and it only prints one.

    Here is the code for creating the print job:

    Java Code:
           PrintRequestAttributeSet preqats = new HashPrintRequestAttributeSet();
                preqats.add(new Copies(2));
                preqats.add(MediaTray.MAIN);
                preqats.add(MediaSizeName.ISO_A4);
                job.print(doc, preqats);
    I am running this on a Windows 7 32-bit machine.
    Printer model is HP LJ P3015.
    The printer is hosted on a Windows Server 2003 machine.
    I have set the printer defaults to:
    Paper size = A4
    Paper source = Auto
    Paper Type = Unspecified

    In the printer setup I have selected the paper size and types to Auto and unspecified.

    So in PrintRequestAttributes or DocPrintJobAttributes how do I make sure
    my print job is not trying to override the default paper type?
    Last edited by prodtechjoshim; 02-03-2011 at 04:09 PM.

Similar Threads

  1. setting attributes(variables) in an Abstract class
    By tashimoto in forum New To Java
    Replies: 2
    Last Post: 12-01-2010, 09:45 PM
  2. problem with PrintService in javax.print package
    By sandeepsai17 in forum New To Java
    Replies: 0
    Last Post: 07-13-2009, 11:27 AM
  3. javax.microedition.io/ javax.bluetooth
    By ahtiven in forum New To Java
    Replies: 3
    Last Post: 01-13-2009, 03:54 PM
  4. Replies: 0
    Last Post: 01-05-2009, 08:03 AM
  5. Print the text file and print preview them
    By Java Tip in forum java.awt
    Replies: 0
    Last Post: 06-23-2008, 12:04 AM

Posting Permissions

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