The Java Developers Almanac 1.4


Order this book from Amazon.

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

e708. Getting the Default Value of a Print Job Capability

The capabilities of a print job are called print job attributes. Examples of print job attributes include: Copies, OrientationRequested, and Destination. This example demonstrates how to retrieve the default value of a particular attribute.
    Attribute attr = (Attribute)service.getDefaultAttributeValue(Destination.class);
    
    // attr == null if the attribute is not supported
    if (attr != null) {
        String attrName = attr.getName();
        // Get string representation of default value
        String attrValue = attr.toString();
        process(service, attrName, attrValue);
    }

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


© 2002 Addison-Wesley.