The Java Developers Almanac 1.4


Order this book from Amazon.

   
Home > List of Packages > javax.print.attribute  [4 examples]

e706. Determining the Capabilities of a Print Service

The capabilities of a print service are called print service attributes. Examples of print service attributes include: color-supported, printer-name, and queued-job-count. This example demonstrates how to retrieve the current attributes of a print service. To monitor changes to these attributes, see e713 Listening for Print Service Status Changes.
    Attribute[] attrs = service.getAttributes().toArray();
    for (int j=0; j<attrs.length; j++) {
        String attrName = attrs[j].getName();
    
        // Retrieve the string version of the attribute value
        String attrValue = attrs[j].toString();
    
        process(service, attrName, attrValue);
    }

 Related Examples
e707. Determining Print Job Capabilities Supported by a Print Service
e708. Getting the Default Value of a Print Job Capability
e709. Getting the Possible Values for a Print Job Capability


© 2002 Addison-Wesley.