[Printing-architecture] CUPS and PPD

Michael Sweet msweet at apple.com
Wed Dec 13 17:48:53 UTC 2017


Pascal,

The CUPS destination API is the replacement, specifically the cupsGetDestMedia* functions.  The current CUPS Programming Manual shows how to use it.

FWIW, media type, size, and source are combined with the new API and the typical usage is to show the ready (loaded) media.  You can also look for the supported "media-type" values with the cupsDestFindSupported function, in order to specify it separately.


> On Dec 13, 2017, at 12:08 PM, Pascal Obry <pascal at obry.net> wrote:
> 
> 
> Hello!
> 
> I'm not sure this is the right list, if not please let me know.
> 
> I've seen that the CUPS PPD API is being deprecated, so I'm trying to
> move away from it.
> 
> But for the MediaType list I cannot find a way without PPD API.
> Currently the code is something like:
> 
> 
>  const char *PPDFile = cupsGetPPD(printer_name);
>  ppd_file_t *ppd = ppdOpenFile(PPDFile);
> 
>  if (ppd)
>  {
>      ppd_option_t *opt = ppdFindOption(ppd, "MediaType");
> 
>      if (opt)
>      {
>        ppd_choice_t *choice = opt->choices;
> 
>        for (int k=0; k<opt->num_choices; k++)
>        {
>          ... use choice->text here ...
> 
> 
> What would be the equivalent without using the PPD API?
> 
> Any pointer appreciated as I've not found a solution at this stage. I'm
> sure I'm just missing something obvious...
> 
> Thanks,
> 
> -- 
>  Pascal Obry /  Magny Les Hameaux (78)
> 
>  The best way to travel is by means of imagination
> 
>  http://www.obry.net
> 
>  gpg --keyserver keys.gnupg.net --recv-key F949BD3B
> _______________________________________________
> Printing-architecture mailing list
> Printing-architecture at lists.linux-foundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/printing-architecture

_________________________________________________________
Michael Sweet, Senior Printing System Engineer

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxfoundation.org/pipermail/printing-architecture/attachments/20171213/18f2644a/attachment.html>


More information about the Printing-architecture mailing list