How can i get a printer's make and model in Java?

后端 未结 3 1286
清酒与你
清酒与你 2020-12-20 14:08

I\'m actually working on a Java application that shares printers to a server, and I need this application to get the make and model of the printers it shares.

I know

3条回答
  •  温柔的废话
    2020-12-20 14:49

    For those who are interested in this subject, I kept looking for a solution that would use the basic Java libraries but, when I started looking the source code of these libraries, I found out that most of the methods that are supposed to return printer's attributes have never been implemented, they always return a Null value. So, at this moment, there is no way to accomplish this in Java.

    There are two workarounds, that I posted on the second edit of my original question:

    • Get these informations via SNMP calls.
    • Use the windows print spooler DLL and retrieve these informations from the driver.

提交回复
热议问题