cups4j : how to print with monochrome attribute

703 Views Asked by At

I want to print document using cups4j with monochrome attribute. I can't find a job-attributes for this option.

Could you help me please ?

The part of code related to attribute is:

HashMap<String, String> attributeMap = new HashMap<String, String>();
attributeMap.put("job-attributes", "print-color-mode-supported:keyword:monochrome");
PrintJob printJob = new PrintJob.Builder(fileInputStream).jobName("testJobName").userName("admin").copie‌​s(copies).pageRanges(pages).duplex(duplex).attributes(attributeMap).build();
PrintRequestResult printRequestResult = printer.print(printJob);
0

There are 0 best solutions below