This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to distinguish Hardware printer and Software printer

 
Minh Bui
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hello,
My Destop application use javax.print.* to detech printer. However, what i get are all the printers that are in Control Panel/Printers and Faxes folder. How can i distinguish hardware printers( real printer) and software printers(got from installing software:Snagit 9, ... ) to remove software printers from printer lists?
My code:

Can i select correct printers from function: PrintServiceLookup.lookupPrintServices with correct conditions?
Thank you.
Minhbt.
 
Minh Bui
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I thinks i can distinguish hardware printer and software printer(cutePDF, Snagit ..) by their attributes. For example, software printer do not connect to computer through LPT, COM, or USB port, but hardware is reverse. But i still did not find the instance of this in java.
Here is what i got now, I m not sure this work for all hardware printer.

Any ideas?
Minhbt.

[Edit Insert line breaks in "code". Such long lines go off the edge of the screen and are difficult to read.[/edit]
 
Campbell Ritchie
Sheriff
Pie
Posts: 49776
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Too difficult a question for "beginning Java". Moving thread.
 
Minh Bui
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I think the key point here is: How to get port name of printer?
Virtual printers do not connect computer through COM, LPT or USB port.
Any idea?
Minhbt.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic