[Printing-architecture] CUPS and PPD

Pascal Obry pascal at obry.net
Thu Dec 14 10:57:52 UTC 2017


Hello Michael,

Sorry to bother you again with this. But now I'm not sure we are talking
about the same thing. The get cupsLocalizeDestValue() is to handle the
translation in different language I suppose, but what I want is to get the
"text" field for a *MediaType line.

With the PPD API one could do:

    ppd_option_t *opt = ppdFindOption(ppd, "MediaType");

    if (opt)
      {
        ppd_choice_t *choice = opt->choices;

        for (int k=0; k<opt->num_choices; k++)
          {
            printf ("PPD: media type %s | %s\n", choice->choice,
choice->text);
            choice++;
          }

And the choice->choice above is "Luster" in "Luster/Premium Luster Photo
Paper" (see PPD def just below) and choice->text is the second part (human
readable string) after the / so "Premium Luster Photo Paper".

   *MediaType Luster/Premium Luster Photo Paper:
"<</MediaType(Luster)>>setpagedevice"

And what I'm looking for is a way to get the human readable part without
resorting on the PPD API. I've tried many things, but fails to get this
value.

Is that possible without the PPD API?

Thanks,

-- 
  Pascal Obry /  Magny Les Hameaux (78)

  The best way to travel is by means of imagination

  http://photos.obry.net
  http://www.obry.net

  gpg --keyserver keys.gnupg.net --recv-key F949BD3B
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxfoundation.org/pipermail/printing-architecture/attachments/20171214/3402fd76/attachment-0001.html>


More information about the Printing-architecture mailing list