aspose file tools*
The moose likes Java in General and the fly likes How to distinguish Hardware printer and Software printer    Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to distinguish Hardware printer and Software printer    " Watch "How to distinguish Hardware printer and Software printer    " New topic
Author

How to distinguish Hardware printer and Software printer

Minh Bui
Greenhorn

Joined: Jan 07, 2010
Posts: 6

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

Joined: Jan 07, 2010
Posts: 6
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

Joined: Oct 13, 2005
Posts: 39879
    
  28
Too difficult a question for "beginning Java". Moving thread.
Minh Bui
Greenhorn

Joined: Jan 07, 2010
Posts: 6
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to distinguish Hardware printer and Software printer