62,614
社区成员
发帖
与我相关
我的任务
分享
PrintService[] services = PrintServiceLookup.lookupPrintServices(null, null);
for (PrintService service : services) {
System.out.println(service.getName());
PrinterResolution[] supportedResolutions = (PrinterResolution[]) service.getSupportedAttributeValues(javax.print.attribute.standard.PrinterResolution.class, null, null);
for (PrinterResolution supportedResolution : supportedResolutions) {
int[] resolution = supportedResolution.getResolution(PrinterResolution.DPI);
System.out.println(resolution[0] + "x" + resolution[1]);
}
System.out.println();
}
http://www.java.net/node/657492
http://docs.oracle.com/javase/6/docs/api/javax/print/attribute/standard/PrinterResolution.html