Print Service Discovery
by, 03-07-2012 at 06:51 PM (643 Views)
Abstract class PrintServiceLookup static methods are invoked by the application so that to locate the print services that possess certain abilities to makes the print requests of an application satisfied. E.g, to print out 2 copies of double sided document first thing that shall be searched by the application is the printers that hold the ability of double sided capability.
Java Code:DocFlavor doc_flavor = DocFlavor.INPUT_STREAM.PDF; PrintRequestAttributeSet attr_set = new HashPrintRequestAttributeSet(); attr_set.add(new Copies(2)); attr_set.add(Sides.DUPLEX); PrintService service = PrintServiceLookup.lookupPrintServices(doc_flavor, attr_set);