Hi.
I'm searching a possibility to get a list of installed printers. I'm using JDK 1.6 with a Windows operating system. Does anyone know a solution?
Thank you in advance. Best regards Thomas
Hi.
I'm searching a possibility to get a list of installed printers. I'm using JDK 1.6 with a Windows operating system. Does anyone know a solution?
Thank you in advance. Best regards Thomas
I haven't used this myself, but maybe javax.print.PrintServiceLookup
contains what you are looking for.
Just wanted to add a little snippet:
import javax.print.*;
class Test {
public static void main (String [] args)
{
PrintService[] printServices = PrintServiceLookup.lookupPrintServices(null, null);
System.out.println("Number of print services: " + printServices.length);
for (PrintService printer : printServices)
System.out.println("Printer: " + printer.getName());
}
}