File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other JSE/JEE APIs and the fly likes How to get the raw printer tray ID Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "How to get the raw printer tray ID" Watch "How to get the raw printer tray ID" New topic

How to get the raw printer tray ID

Don Varuna

Joined: Aug 09, 2013
Posts: 1

I’m trying to find the printer tray ids of a particular printer. I have searched and found a lot of articles in Java using the PrintService, Media and MediaTray. Yet, this doesn’t provide a solution for my requirement. I will get the following output if I run the below code.

Win32 Printer : AL-M2010-3D8E02
Form-Source ID: 5 sun.print.Win32MediaTray
MP Tray ID: 6 sun.print.Win32MediaTray
Lower Cassette 1 ID: 7 sun.print.Win32MediaTray
Lower Cassette 2 ID: 8 sun.print.Win32MediaTray
Lower Cassette 3 ID: 9 sun.print.Win32MediaTray
Lower Cassette 4 ID: 10 sun.print.Win32MediaTray

If I run the following .net code I would get the following outpt.

Automatically Select 15
MP Tray 261
Lower Cassette 1 260
Lower Cassette 2 259
Lower Cassette 3 258
Lower Cassette 4 257

The above is what I want to achieve. I want to get the raw printer ID like 260, 259, 258 and so on through Java instade of 7,8,9,10. Is this possible in some way?

Thanks in advance.
The CD Man
I agree. Here's the link:
subject: How to get the raw printer tray ID
It's not a secret anymore!