Print Dialog

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rich Sweeny

    #1

    Print Dialog

    Hi,
    I am working in Mac OSX 10.3.7 with SDK 1.4_2. When my Print Dialog box
    comes up just about everything is disabled except selecting from the 4
    printers I have and being able to set the page margins. The dialog has 3
    panes. The first pane, 'General', I can select my printer but the property
    button for the printer is disabled along with the page range settings and
    number of copies. The second pane, 'Page Setup', the only thing I can do is
    set the margins. The media size and source is disabled along with page
    orientation. The third pane, 'Appearance', everything is disabled. This is
    color, quality, job attributes, and size.

    I would like the user to be able to access these settings and modify how the
    job should print.

    This is the code I am using to print the files.

    Thanks,
    Rich

    /////////////////////////// CODE /////////////////////////////////////////

    // set the attributes
    PrintRequestAtt ributeSet aset = new HashPrintReques tAttributeSet() ;
    aset.add( MediaSizeName.N A_LETTER );
    aset.add( OrientationRequ ested.PORTRAIT );
    MediaPrintableA rea printArea =
    new MediaPrintableA rea( 71.12F, 71.12F, 448F, 646F, Size2DSyntax.MM );

    /* Create a print job */
    PrinterJob pj = PrinterJob.getP rinterJob();
    pj.setPrintable ( this );

    /* locate a print service that can handle the request */
    PrintService[] services = PrinterJob.look upPrintServices ();
    pj.setPrintable ( this );
    if( services.length > 0 ) {
    System.out.prin tln( "selected printer " + services[0].getName());
    try {
    pj.setPrintServ ice( services[0] );

    // the printer dialog
    if( pj.printDialog( aset ) ) {
    pj.print( aset );
    } // end if
    } catch ( PrinterExceptio n pe ) {
    System.err.prin tln( pe );
    } // end try-catc

    } // end if

Working...