Java Printer Usage getArrayOfPrinterNames()

Here you can find the source of getArrayOfPrinterNames()

Description

get Array Of Printer Names

License

Open Source License

Declaration

public static String[] getArrayOfPrinterNames() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import javax.print.PrintService;
import javax.print.PrintServiceLookup;

public class Main {

    public static String[] getArrayOfPrinterNames() {
        PrintService[] services = PrintServiceLookup.lookupPrintServices(null, null);
        String printers[] = new String[services.length];
        for (int i = 0; i < services.length; i++) {
            printers[i] = services[i].getName();
            //      System.out.println("PRINTER: " + printers[i]);
        }//from w  w w.j a va 2s  . c o m
        return printers;
    }
}

Related

  1. convertPageFormatUnit(int oldUnit, int newUnit, double value)
  2. createPrintRequestAttributeSet(int width, int height)
  3. findPrintService(String printerName)
  4. get_print_service(String printerName, HashPrintRequestAttributeSet aset)
  5. getAttribute( PrintService ps, Class category)
  6. getAvailablePrinters()
  7. getDefaultPrinterName()
  8. getDefaultPrinterName()