You can use cups4j
Map attributes = new HashMap();
attributes.put("job-attributes", "print-quality:enum:3#media:keyword:iso_a5_148x210mm");
printJob.setAttributes(attributes);
See the following article of how CUPS upgrade on Linux broke Java libraries and CUPS libraries: http://www.cups.org/articles.php?L433+TFAQ+Q
Now, since you can print I assume its not an issue. But I am not sure what MyAttrSet is, it should be a HashPrintRequestAttributeSet.
try:
PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
aset.add(new Copies(2));
See if this attribute is read in, then try adding yours to such a set, does it work or not. You might want to try implementing other Attributes:
The Sides attribute looks like this:
public class Sides
extends EnumSyntax
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute
{
public final Object getCategory()
{
return Sides.class;
}
...
}
Similarly Copies:
public final class Copies
extends IntegerSyntax
implements PrintRequestAttribute, PrintJobAttribute
perhaps try adding the additional implements of PrintJobAttribute