查看本地打印机列表
PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet();
DocFlavor flavor = DocFlavor.BYTE_ARRAY.PNG;
//可用的打印机列表(字符串数组)
PrintService printService[] = PrintServiceLookup.lookupPrintServices(flavor, pras);
for(int i=0;i<printService.length;i++){
System.out.println(""+printService[i].getName());
}
//当前默认打印机
PrintService PS = PrintServiceLookup.lookupDefaultPrintService();