[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: Default printer?

If you are getting your PrinterData object from the PrintDialog, then save 
that instead, and then you can take advantage of new 
PrintDialog.setPrinterData(data) API to set a selected printer back into the 
dialog the next time you open it.

Yes, the "default printer" that you get with 
Printer.getDefaultPrinterData(), or new Printer(), or when you open a 
PrintDialog without using setPrinterData(), is the system default printer. 
Typically, the user can change this from within the dialog, i.e. on a popup 
menu. If you need to change this programmatically in SWT, please open a bug 
report requesting it as a new feature.

Carolyn

"Matthew Hall" <matthall@xxxxxxxxxxxxxxxxx> wrote in message 
news:fu2g0f$d5j$1@xxxxxxxxxxxxxxxxxxxx
> Patrick Godeau wrote:
>> Le 15/04/2008 14:35, Tom Schindl a écrit :
>>> The default printer is the one you have set in your OS, so I doubt that 
>>> a setDefaultPrinterData can exist.
>>
>> OK, but at least I'd like to change the default printer for my 
>> application, if not for the system. How can I do that?
>
> You can recall a printer by memorizing the PrinterData.name and 
> PrinterData.driver fields in your application preferences.  To retrieve 
> the same printer, call Printer.getPrinterList() and scan through the 
> returned array for a PrinterData with the correct values in the name and 
> driver fields.
>
> Matthew