Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Problems with PrinterData(SWT Printing)
Problems with PrinterData [message #628180] Thu, 23 September 2010 10:23 Go to next message
S Iyengar is currently offline S Iyengar
Messages: 8
Registered: July 2009
Junior Member
What am I doing wrong?

I have a 3 tray printer(MyPrinter) with specific types of paper in each of them

I want to print from tray 3 always. and In my printer properties I have selected tray 3 as the paper source.

It works fine, if I use following code: and Select the printer @ run time.
.
.
.
PrinterData data = new PrintDialog(shell).open();
if(data == null)return;
Printer printer = new Printer(data);
.
.
.

It prints from tray 2 if I use the following code

String driver = "winspool";
String name = "MyPrinter";
PrinterData = new PrinterData(driver, name);
if(data == null)return;
Printer printer = new Printer(data);

This is happening since SWT 3.5 release.
Thanks,
Iyengar.
Re: Problems with PrinterData [message #628821 is a reply to message #628180] Fri, 24 September 2010 10:09 Go to previous messageGo to next message
S Iyengar is currently offline S Iyengar
Messages: 8
Registered: July 2009
Junior Member
Under debug I figured out the following
PrinterData obtained from PrintDialog has Field otherData set to an array?
This is null from new PrinterData("winspool", "MyPrinter");

Can someone please tell me What otherData is?

Thanks,

Iyengar.
Re: Problems with PrinterData [message #629473 is a reply to message #628821] Tue, 28 September 2010 12:30 Go to previous message
S Iyengar is currently offline S Iyengar
Messages: 8
Registered: July 2009
Junior Member
Changed my code to use AWT print.
Previous Topic:[resolved] NullPointerException with Button.getSelection()
Next Topic:Disable expand all tree nodes on asterisk (*) in windows
Goto Forum:
  


Current Time: Mon Oct 20 13:15:08 GMT 2014

Powered by FUDForum. Page generated in 0.02160 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software