How to cheat printer

Michael R Sweet msweet at apple.com
Fri Jul 11 09:43:04 PDT 2008


keens312 wrote:
> Hi Michael,
> 
> Our printer needs to support the resolutions 400x600x2 dpi.
> 
> The requirement for the filter driver is that:
> 1. Still send down 600x600x2 raster data.
> 2. In Raster header, tell printer firmware the resolution is 400x600x2.
> 
> So, in PPD, we wrote like this:
> *Choice "400x600x2/400x600x2" "<</HWResolution[600 600]/cupsBitsPerColor 8/cupsColorSpace 0/cupsCompression 2>>setpagedevice"
> 
> The difficult part is how to change the raster header.
> Can I change HWResolution value in cups_page_header_t struct for this purpose?
> 
> Any better solution for this?

Your resolution options can set any of the values in the page header.
The resolution name (NNNxNNNdpi) does *not* have to match what you
set HWResolution to, although is does help.

Gutenprint already has to deal with this and uses the real vertical
resolution with a made-up horizontal resolution to support multiple
versions of a particular resolution.

That said, there *are* applications that use the resolution names to
determine things like fallback or compositing resolutions.  Typically
they will use the minimum of the horizontal and vertical components,
so if you keep the vertical component constant you'll have the fewest
problems.

Also, the recommended way of implementing this is to NOT use the
Resolution option name, but instead define your own (as I suggested
previously) so the Adobe naming conventions do not make your life
more difficult.  Define a DefaultResolution attribute to allow
apps that do their own compositing (mainly Adobe Illustrator and
Quark) to use a better default than 72 or 300 DPI.

-- 
______________________________________________________________________
Michael R Sweet                        Senior Printing System Engineer





More information about the cups mailing list