View RSS Feed

Java AWT

Print Service Discovery

Rate this Entry
by , 03-07-2012 at 05:51 PM (802 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);

Submit "Print Service Discovery" to Facebook Submit "Print Service Discovery" to Digg Submit "Print Service Discovery" to del.icio.us Submit "Print Service Discovery" to StumbleUpon Submit "Print Service Discovery" to Google

Comments