Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Identifying Type of Printer Using Java

 
vasu devan
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Friends

Currently i am Using javax.print Package to Print TXT Files
Its Working Fine.

But Whats my Query is

Is There any Possibility to Identify the Type of Printer's im using,for example is the Printer is Laser or dot-matrix or inkjet?

I Tried search engine to find any other possiblity,i didnt get any solution.

Any help will be greatly Appreciated and its Needed Urgently

Thanks in advance

Regards
Vasu
 
Pradeep Kadambar
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vasu,

Java won't provide you that flexibility at h/w level. If you want to detect the printer driver type then you need to use native code to access the APIs.

Check with Java COM bridges.

 
vasu devan
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Pradeep,

Thanks for the response
Do you have any link for getting info through native methods?

Regards
vasu
 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jacob
 
Jeff Yung
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Call JNI to call C program.

Please check it out:
http://as.wiley.com/WileyCDA/WileyAncillary/productCd-076454957X,typeCd-DOWNLOAD.html

See the sample code of JMX programming chapter 13.

It will get the following object (if you use level 4):
PRINTER_INFO_4
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/prntspol_8vle.asp

Hope it may help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic