Hello.
I need to get the model name of all my configured printers.
In addition I’d like to get the model name and paths to all available ppd files
on the system.
What I am trying to achieve is to provide an interface with all configured
printers with informations such as model name and ppd file name
and to allow the user to change a ppd file for an already configured printer.
For this I’d like to have a list of all available ppd files on the system where
the user can choose from. Changing the ppd file already works.
I did my first steps with:
cups_dest_t *dests;
const char *value;
const char *ppdFile;
ppd_file_t *ppd;
cups_dinfo_t *destInfo;
int num_dests;
num_dests = cupsGetDests(&dests);
for(int i=0; i < num_dests; i++)
{
if(dests[i].instance == NULL)
{
destInfo = cupsCopyDestInfo(http, &dests[i]);
ppdFile = cupsGetPPD(dests[i].name);
ppd = ppdOpenFile(ppdFile);
printf("printer model : %s\n", ppd->modelname);
ppdClose(ppd);
unlink(ppdFile);
cupsFreeDestInfo(destInfo);
}
}
but Xcode 7.2.1 on Mac OS 10.11.3 says cupsGetPPD/ppdOpenFile/ppdCloseFile is
deprecated, use cupsCopyDestInfo and friends instead. But with cupsCopyDestInfo
I don’t get my desired data like model name and path.
Any Ideas how to move away from the deprecated API?
And can someone point me into the right direction, how to achieve my goal to
get a list of configured ppds for a certain printer name and to all available
ppds along with the model name the ppd is working with?
Thank you very much,
kind regards,
Robert
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Printing mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/printing/archive%40mail-archive.com
This email sent to [email protected]