GetJobAttr

// Get all print job attributes of a print service
Class[] cats = service.getSupportedAttributeCategories();
for (int j=0; j<cats.length; j++) {
    Attribute attr = (Attribute)service.getDefaultAttributeValue(cats[j]);

    if (attr != null) {
        // Get attribute name and values
        String attrName = attr.getName();
        String attrValue = attr.toString();

        Object o = service.getSupportedAttributeValues(attr.getCategory(), null, null);
        if (o.getClass().isArray()) {
            for (int k=0; k<Array.getLength(o); k++) {
                Object o2 = Array.get(o, k);
            }
        }
    }
}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.