Sides And Collate

Discussion in 'Java' started by freesoft_2000, Feb 11, 2005.

  1. Hi everyone,

    I have two questions about the java multi-platform print dialog.

    The first question is about the printing of double-sided which is
    supported by some high end printers but the thing is that when i want to
    change the properties so that the user can decide if he wants to print
    one-sided or double-sided but when i click on the appreance tab of the
    print dialog
    the Sides part seem to be always disabled no matter what i do.

    The printing of double-side is printed out correctly bu what if i decide
    to print single-side but that part of the print dialog seems to be always
    disabled

    This is what i am doing to call the multi-platform dialog to print
    double-sided

    Code:
    
    public void prt ( )
    
    PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet( );
    
    aset.add(Sides.DUPLEX);
    
    try
    {
    PrinterJob prnJob = PrinterJob.getPrinterJob( );
    
    prnJob.setPrintable(myprintableclass);
    
    if (prnJob.printDialog(aset) == false)
    {
    return;
    }
    
    //The below command line prints out the document if the user clicked Ok
    
    prnJob.print(aset);
    }
    
    catch (PrinterException e)
    {
    e.printStackTrace();
    }
    
    }
    
    
    My other question is on collating the output of my print out using the
    java multi-platform print dialog. The thing is no matter even if i select
    the collate check box or not the output of the print out is always printed
    uncollated.

    When i use the platform specific print dialog(windows in my case) the
    output can be printed collated or uncollated.

    This is what i am doing to call the multi-platform dialog to print
    collated print-outs

    Code:
    
    public void prt ( )
    
    PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet( );
    
    aset.add(SheetCollate.COLLATED);
    
    try
    {
    PrinterJob prnJob = PrinterJob.getPrinterJob( );
    
    prnJob.setPrintable(myprintableclass);
    
    if (prnJob.printDialog(aset) == false)
    {
    return;
    }
    
    //The below command line prints out the document if the user clicked Ok
    
    prnJob.print(aset);
    }
    
    catch (PrinterException e)
    {
    e.printStackTrace();
    }
    
    }
    
    
    It seems strange to me that if i use the sytem specific print dialog i can
    print
    both collated and uncollated printouts but if i use the java
    multi-platform print dialog the print out is always printed uncollated
    even when i specify it to be printed collated

    There are no exceptions thrown and the program compiles with no errors for
    both my questions.

    Am i calling java multi-platform print dialog and adding the attributes
    correctly for both my questions

    Is this a bug or am i missing something for both my questions?

    I really hope someone can help me with this problem

    Any help is greatly appreciated

    Thank You

    Yours Sincerely

    Richard West
     
    freesoft_2000, Feb 11, 2005
    #1
    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. M. Lesaar

    text to copy out of html sides

    M. Lesaar, Apr 23, 2005, in forum: HTML
    Replies:
    3
    Views:
    2,167
    M. Lesaar
    Apr 25, 2005
  2. Remy
    Replies:
    3
    Views:
    654
  3. Ron Adam

    Collate Module

    Ron Adam, Oct 23, 2006, in forum: Python
    Replies:
    0
    Views:
    351
    Ron Adam
    Oct 23, 2006
  4. xhy_China
    Replies:
    7
    Views:
    386
    RedGrittyBrick
    Dec 23, 2007
  5. Phrogz

    Hash#collate

    Phrogz, Dec 19, 2007, in forum: Ruby
    Replies:
    8
    Views:
    162
    Trans
    Dec 19, 2007
Loading...

Share This Page