How to get media size of current job?
Lu binbin
lbblscy at trogine.com
Sat Dec 12 00:24:24 PST 2009
> 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".
More information about the cups
mailing list