[cups.general] How to get media size of current job?
Michael Sweet
msweet at apple.com
Sat Dec 12 22:11:05 PST 2009
The same applies for backends - use the code below to determine which page size is selected for the job.
On Dec 12, 2009, at 12:24 AM, Lu binbin wrote:
>> On Dec 11, 2009, at 6:06 AM, Lu binbin wrote:
>>> Hi,
>>> I need to get the media or paper size of current print job in my work.
>>> In RFC 2911, I found there is a media attribute in Job Template =
>> Attribute. So I use pkipplib parse some control file =
>> (/var/spool/cups/cxxxxx),there are only Operation attributes and Job =
>> attributes.
>>> =20
>>> How can i get media size of current job? Thanks!
>>
>>
>> Are you doing this from a filter? If so, the correct way is to combine =
>> the options from argv[5] with the PPD defaults, and then query the =
>> current size using ppdPageSize:
>>
>> ppd_file_t *ppd =3D ppdOpenFile(getenv("PPD"));
>> cups_option_t *options =3D NULL;
>> int num_options =3D cupsParseOptions(argv[5], 0, &options);
>> ppd_size_t *size;
>>
>> ppdMarkDefaults(ppd);
>> cupsMarkOptions(ppd, num_options, options);
>>
>> size =3D ppdPageSize(ppd, NULL);
>>
>> ___________________________________________________
>> Michael Sweet, Senior Printing System Engineer
>>
>
> I'm not writing a filter but a simple backend.
> The options parameter(argv[5]) only contain "job-uuid=urn:uuid:8cbca66a-fc74-38ae-644b-8c38094ce5fc".
>
> _______________________________________________
> cups mailing list
> cups at easysw.com
> http://lists.easysw.com/mailman/listinfo/cups
___________________________________________________
Michael Sweet, Senior Printing System Engineer
More information about the cups
mailing list