Unable to get paper colors from cups 2.0.1 using cups4j

97 Views Asked by At

I'm currently using Cups Version 1.2.4 for a print-application. A mandatory feature is to read the paper color (White Paper, Blue Paper, ..). This is done by reading the mediaSupported tag with an old print library called jipsi.

The print-application is now going to be updated with a new CUPS version 2.0.2 and the print library Cups4j. If I try to read the paper color with the mediaSupported tag, the resultset outputs me papersizes like "iso_b4_250x352mm" instead of the paper colors I need to get. The other data that Cups4j provides me for the printer also doesnt include the paper color. Cups4j printer information new Cups

If I use the old Cups Version 1.2.4 and cups4j, the mediaSupported tag contains the paper colors, that I need to get. Cups4j printer information old Cups

However the webinterface of the new Cups lists the paper colors that I need to access. Pic of Cups Webinterface

Now my question: Is there any way to get the paper color, maybe by asking the IPP protocol directly?

1

There are 1 best solutions below

0
On

The IPP attribute media-color-supported contains the media colors which are supported by the printer.

You can try this C code to see whether the media-color-supported contains the required value. Or may be the values are stored in media-type-supported IPP attribute as per your screenshot.

Though I am not familiar with cups4j, a similar class exists in cups4j to get the printer attributes.