By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,666 Members | 1,784 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,666 IT Pros & Developers. It's quick & easy.

Print Dialog

P: n/a
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.


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

// set the attributes
PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
aset.add( MediaSizeName.NA_LETTER );
aset.add( OrientationRequested.PORTRAIT );
MediaPrintableArea printArea =
new MediaPrintableArea( 71.12F, 71.12F, 448F, 646F, Size2DSyntax.MM );

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

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

// the printer dialog
if( pj.printDialog( aset ) ) {
pj.print( aset );
} // end if
} catch ( PrinterException pe ) {
System.err.println( pe );
} // end try-catc

} // end if

Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.