SHARE
TWEET

How do I get a list of installed printers

a guest Feb 27th, 2012 12 Never
  1. import javax.print.*;
  2.  
  3. class Test {
  4.  
  5.     public static void main (String [] args)
  6.     {
  7.         PrintService[] printServices = PrintServiceLookup.lookupPrintServices(null, null);
  8.         System.out.println("Number of print services: " + printServices.length);
  9.  
  10.         for (PrintService printer : printServices)
  11.             System.out.println("Printer: " + printer.getName());
  12.     }
  13. }
RAW Paste Data
Top