Index: doc/help/spec-ppd.html =================================================================== --- doc/help/spec-ppd.html (revision 6156) +++ doc/help/spec-ppd.html (working copy) @@ -401,7 +401,7 @@ *CloseUI: *WatermarkText *% Custom PostScript watermark option -*CustomWatermarkText True: "<</cupsString1 2 1 roll>>setpagedevice" +*CustomWatermarkText True: "<</cupsString1 3 -1 roll>>setpagedevice" *ParamCustomWatermarkText Text: 1 string 0 32 @@ -415,7 +415,7 @@ *CloseUI: *GammaDensity *% Custom PostScript gamma/density option -*CustomGammaDensity True: "<</cupsReal1 3 1 roll/cupsReal2 3 1>>setpagedevice" +*CustomGammaDensity True: "<</cupsReal1 3 -1 roll/cupsReal2 5 -1>>setpagedevice" *ParamCustomGammaDensity Gamma: 1 curve 0.1 10 *ParamCustomGammaDensity Density: 2 real 0 2 @@ -626,8 +626,340 @@ +
PPD files are used for both PostScript and non-PostScript printers. For CUPS raster drivers, you use a subset of the PostScript language to set page device attributes such as page size, resolution, and so forth. For example, the following code sets the page size to A4 size:
+ ++*PageSize A4: "<</PageSize[595 842]>>setpagedevice" ++ +
Custom options typically use other operators to organize the values into a key/value dictionary for setpagedevice. For example, our previous CustomWatermarkText option code uses the roll operator to move the custom string value into the dictionary for setpagedevice:
+ ++*CustomWatermarkText True: "<</cupsString1 3 -1 roll>>setpagedevice" ++ +
For a custom string value of "My Watermark", CUPS will produce the following PostScript code for the option:
+ ++(My Watermark) +<</cupsString1 3 -1 roll>>setpagedevice ++ +
The code moves the string value ("My Watermark") from the bottom of the stack to the top, creating a dictionary that looks like:
+ ++<</cupsString1(My Watermark)>>setpagedevice ++ +
The resulting dictionary sets the page device attributes that are sent to your raster driver in the page header.
+ +CUPS supports the following PostScript operators in addition to the usual PostScript number, string (literal and hex-encoded), boolean, null, and name values:
+ +Table 1 shows the supported page device attributes along with PostScript code examples.
+ +Name(s) | +Type | +Description | +Example(s) | +
---|---|---|---|
AdvanceDistance | +Integer | +Specifies the number of points to advance roll media after printing. | +<</AdvanceDistance 18>>setpagedevice | +
AdvanceMedia | +Integer | +Specifies when to advance the media: 0 = never, 1 = after the file, 2 = after the job, 3 = after the set, and 4 = after the page. | +<</AdvanceMedia 4>>setpagedevice | +
Collate | +Boolean | +Specifies whether collated copies are required. | +<</Collate true>>setpagedevice | +
CutMedia | +Integer | +Specifies when to cut the media: 0 = never, 1 = after the file, 2 = after the job, 3 = after the set, and 4 = after the page. | +<</CutMedia 1>>setpagedevice | +
Duplex | +Boolean | +Specifies whether 2-sided printing is required. | +<</Duplex true>>setpagedevice | +
HWResolution | +Integer Array | +Specifies the resolution of the page image in pixels per inch. | +<</HWResolution[1200 1200]>>setpagedevice | +
InsertSheet | +Boolean | +Specifies whether to insert a blank sheet before the job. | +<</InsertSheet true>>setpagedevice | +
Jog | +Integer | +Specifies when to shift the media in the output bin: 0 = never, 1 = after the file, 2 = after the job, 3 = after the set, and 4 = after the page. | +<</Jog 2>>setpagedevice | +
LeadingEdge | +Integer | +Specifies the leading edge of the media: 0 = top, 1 = right, 2 = bottom, 3 = left. | +<</LeadingEdge 0>>setpagedevice | +
ManualFeed | +Boolean | +Specifies whether media should be drawn from the manual feed tray. Note: The MediaPosition attribute is preferred over the ManualFeed attribute. | +<</ManualFeed true>>setpagedevice | +
MediaClass | +String | +Specifies a named media. | +<</MediaClass (Invoices)>>setpagedevice | +
MediaColor | +String | +Specifies the color of the media. | +<</MediaColor >>setpagedevice | +
MediaPosition | +Integer | +Specifies the tray or source of the media. | +<</MediaPosition 12>>setpagedevice | +
MediaType | +String | +Specifies the general media type. | +<</MediaType (Glossy)>>setpagedevice | +
MediaWeight | +Integer | +Specifies the media weight in grams per meter2. | +<</MediaWeight 100>>setpagedevice | +
MirrorPrint | +Boolean | +Specifies whether to flip the output image horizontally. | +<</MirrorPrint true>>setpagedevice | +
NegativePrint | +Boolean | +Specifies whether to invert the output image. | +<</NegativePrint true>>setpagedevice | +
NumCopies | +Integer | +Specifies the number of copies to produce of each page. | +<</NumCopies 100>>setpagedevice | +
Orientation | +Integer | +Specifies the orientation of the output: 0 = portrait, 1 = landscape rotated counter-clockwise, 2 = upside-down, 3 = landscape rotated clockwise. | +<</Orientation 3>>setpagedevice | +
OutputFaceUp | +Boolean | +Specifies whether to place the media face-up in the output bin/tray. | +<</OutputFaceUp true>>setpagedevice | +
OutputType | +String | +Specifies the output type name. | +<</OutputType (Photo)>>setpagedevice | +
PageSize | +Integer/Real Array | +Specifies the width and length/height of the page in points. | +<</PageSize[595 842]>>setpagedevice | +
Separations | +Boolean | +Specifies whether to produce color separations. | +<</Separations true>>setpagedevice | +
TraySwitch | +Boolean | +Specifies whether to switch trays automatically. | +<</TraySwitch true>>setpagedevice | +
Tumble | +Boolean | +Specifies whether the back sides of pages are rotated 180 degrees. | +<</Tumble true>>setpagedevice | +
cupsBorderlessScalingFactor | +Real | +Specifies the amount to scale the page image dimensions. | +<</cupsBorderlessScalingFactor 1.01>>setpagedevice | +
cupsColorOrder | +Integer | +Specifies the order of colors: 0 = chunked, 1 = banded, 2 = planar. | +<</cupsColorOrder 0>>setpagedevice | +
cupsColorSpace | +Integer | +Specifies the page image colorspace: 0 = W, 1 = RGB, 2 = RGBA, 3 = K, 4 = CMY, 5 = YMC, 6 = CMYK, 7 = YMCK, 8 = KCMY, 9 = KCMYcm, 10 = GMCK, 11 = GMCS, 12 = White, 13 = Gold, 14 = Silver, 15 = CIE XYZ, 16 = CIE Lab, 17 = RGBW, 32 to 46 = CIE Lab (1 to 15 inks) | +<</cupsColorSpace >>setpagedevice | +
cupsCompression | +Integer | +Specifies a driver compression type/mode. | +<</cupsCompression 2>>setpagedevice | +
cupsInteger0 + ... + cupsInteger15 |
+ Integer | +Specifies driver integer values. | +<</cupsInteger11 1234>>setpagedevice | +
cupsMarkerType | +String | +Specifies the type of ink/toner to use. | +<</cupsMarkerType (Black+Color)>>setpagedevice | +
cupsMediaType | +Integer | +Specifies a numeric media type. | +<</cupsMediaType 999>>setpagedevice | +
cupsPageSizeName | +String | +Specifies the name of the page size. | +<</cupsPageSizeName (A4.Full)>>setpagedevice | +
cupsPreferredBitsPerColor | +Integer | +Specifies the preferred number of bits per color, typically 8 or 16. | +<</cupsPreferredBitsPerColor 16>>setpagedevice | +
cupsReal0 + ... + cupsReal15 |
+ Real | +Specifies driver real number values. | +<</cupsReal15 1.234>>setpagedevice | +
cupsRenderingIntent | +String | +Specifies the color rendering intent. | +<</cupsRenderingIntent (AbsoluteColorimetric)>>setpagedevice | +
cupsRowCount | +Integer | +Specifies the number of rows of raster data to print on each line for some drivers. | +<</cupsRowCount 24>>setpagedevice | +
cupsRowFeed | +Integer | +Specifies the number of rows to feed between passes for some drivers. | +<</cupsRowFeed 17>>setpagedevice | +
cupsRowStep | +Integer | +Specifies the number of lines between columns/rows on the print head for some drivers. | +<</cupsRowStep 2>>setpagedevice | +
cupsString0 + ... + cupsString15 |
+ String | +Specifies driver string values. | +<</cupsString0(String Value)>>setpagedevice | +