[cups.development] Where to construct cups_page_header

Michael R Sweet msweet at apple.com
Mon Dec 1 17:28:10 PST 2008


keens312 wrote:
> Hi mike,
> 
> There is a struct called cups_page_header_t that filer driver can use.
> This struct is a maping of the PPD keywords.
> So I guess it is constructed by the PPD file.
> I want to know who and when this struct constructed.

The RIP filter (typically cgpdftoraster on Mac OS X, pstoraster or
imagetoraster on Linux) that generates the raster data creates the
cups_page_header2_t structure (*not* cups_page_header_t on any recent
system which lacks all of the extended attributes) based on the option
code in the PPD file and (in some cases) calculates the values of
related attributes, e.g. cupsWidth and cupsHeight come from the
imageable area of the selected page size and the current resolution.

For pstoraster, all of this happens via Ghostscript's internal
setpagedevice hooks in gdevcups.c.  For the others, a common helper
function called cupsRasterInterpretPPD() is used which contains a
simple PostScript interpreter for parsing setpagedevice commands.
You'll find the latter function in the filter/interpret.c file
included in the CUPS sources.

Documentation on setting the page device attributes in the raster
header can be found in the CUPS PPD documentation:

     http://www.cups.org/documentation.php/spec-ppd.html

-- 
______________________________________________________________________
Michael R Sweet                        Senior Printing System Engineer





More information about the cups-devel mailing list