📄 e703. discovering available print services.txt
字号:
// Look up all services
PrintService[] services = PrintServiceLookup.lookupPrintServices(null, null);
// Look up the default print service
PrintService service = PrintServiceLookup.lookupDefaultPrintService();
// Find all services that can support a particular
// input format; in this case, a GIF
services = PrintServiceLookup.lookupPrintServices(
DocFlavor.INPUT_STREAM.GIF, null);
// Find a particular service by name;
// in this case "HP LaserJet 6MP PS"
AttributeSet aset = new HashAttributeSet();
aset.add(new PrinterName("HP LaserJet 6MP PS", null));
services = PrintServiceLookup.lookupPrintServices(null, aset);
// Find all services that support a set of print job capabilities;
// in this case, color
aset = new HashAttributeSet();
aset.add(ColorSupported.SUPPORTED);
services = PrintServiceLookup.lookupPrintServices(null, aset);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -