Resolution defination in DRV file

Michael R Sweet msweet at apple.com
Mon Jul 7 10:12:19 PDT 2008


keens312 wrote:
>> hi Michael,
>>
>> I have an issue on Mac OSX.
>>
>> The monochrone laserjet printer is required to support four resolutions:
>> 1. 400 x 600 x 1
>> 2. 600 x 600 x 1
>> 3. 600 x 600 x 2
>> 4. 1200 x 1200 x 1
>>
>> So, to implement this, I need to add lines in Drv file to specify this, and filter driver will the user selected resolution for printing.
>>
>> The issue is that only 600 x 600 x 1 can work properly.
>> For all the other resolutions, the top-left point shift to left about width/2 pixils, which means printed out of paper (on the left).
>>
>> I have totally now clue about this issue. Something wrong in Drv file or filter program?
>>
>> Could you please help to show me the code snippet for the four resolutions in the DRV file?
>>
>> Thanks
>> Keene
>>
> 
> Hi Michael, is this correct?
> 
> *Choice "Res400/Res 400" "<</HWResolution[400 600]/cupsBitsPerColor 8/cupsColorSpace 0/cupsCompression 2>>setpagedevice"
> Choice "Res600/Res 600" "<</HWResolution[600 600]/cupsBitsPerColor 8/cupsColorSpace 0/cupsCompression 3>>setpagedevice"
> Choice "Res1200/Res 1200" "<</HWResolution[1200 1200]/cupsBitsPerColor 8/cupsColorSpace 0/cupsCompression 3>>setpagedevice"

The PostScript code is correct, but the naming is not.  If you read
the PPD spec (and you really really need to do that) you'll see that
resolution names need to be of the form:

     NNNdpi
     NNNxNNNdpi

where the first form specifies an equal horizontal and vertical
resolution in dots per inch and the second form specifies them
separately (horizontal value first, then vertical).

You'll also need to declare the option itself, so the following
would be a correct and complete example:

     Option "Resolution/Output Resolution" PickOne DocumentSetup 10.0
       *Choice "400dpi/Res 400" "<</HWResolution[400 
600]/cupsBitsPerColor 8/cupsColorSpace 0/cupsCompression 2>>setpagedevice"
       Choice "600dpi/Res 600" "<</HWResolution[600 
600]/cupsBitsPerColor 8/cupsColorSpace 0/cupsCompression 3>>setpagedevice"
       Choice "1200dpi/Res 1200" "<</HWResolution[1200 
1200]/cupsBitsPerColor 8/cupsColorSpace 0/cupsCompression 3>>setpagedevice"

You may also want to change the UI text for the resolution options
to something more appropriate to your users - for technical users
"Output Resolution" and "600 DPI" are appropriate, but for non-
technical users you probably want to just call it "Quality" with
"Draft", "Normal", and "High" for 400, 600, and 1200 DPI,
respectively.

-- 
______________________________________________________________________
Michael R Sweet                        Senior Printing System Engineer





More information about the cups-devel mailing list