473,403 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

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
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
0 3524

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: KohlerTommy | last post by:
In my application I need to give the user the ability to print duplex if the selected printer supports duplex printing. Many of the printer options do not make much sense in my application, and...
1
by: John | last post by:
Hello, Is it possible to modify the print dialog box that appears when a user clicks File->Print? Is it possible to make this modification so that all Windows programs use the modified print...
1
by: hamil | last post by:
I am trying to print a graphic file (tif) and also use the PrintPreview control, the PageSetup control, and the Print dialog control. The code attached is a concatination of two examples taken out...
22
by: stephen | last post by:
I have created an order form that users javascript to create a new html document when the customers clicks the "print page" button. Once the new document has been created it then prints the...
3
by: John Peterson | last post by:
Hello all! I'm at my wits end trying to search for what I assumed to be a relatively straightforward task. I have a Web application written in C#, and I have a button on the form that I want to...
0
by: Siv | last post by:
Hi, This is driving me nuts, I have created a custom print preview dialog, I have a toolbar at the top of the window that allows the user to select a page setup dialog and a printer dialog. All...
1
by: milti | last post by:
Hi All!! Is there any way, I can avoid the Print Dialog from appearing multiple times? Let me be more clear. I've say three files. file1.html, file2.html and file3.html. there's a button...
2
by: Brad Pears | last post by:
I have some sample code that uses the print dialog, print preview and a print direct options. If I select print preview and then click the printer icon from that, the document prints. If I...
1
by: Jorgen Bodde | last post by:
Hi All, I am at a loss. This is slightly OT because it concerns Windows and HTML printing. I would like to print a HTML document from Python, but not showing the printing dialog. After numerous...
0
by: Andrew Meador | last post by:
I have implemented a printing scenario where an html file is printed using the the following code: public void PrintHtmlFile(string url) { RegistryKey IERegKey; string header = null; string...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.