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 @@ +

Writing PostScript Option Commands for Raster Drivers

+ +

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.

+ +

Supported PostScript Operators

+ +

CUPS supports the following PostScript operators in addition to the usual PostScript number, string (literal and hex-encoded), boolean, null, and name values:

+ + + +

Supported Page Device Attributes

+ +

Table 1 shows the supported page device attributes along with PostScript code examples.

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 1: Supported Page Device Attributes
Name(s)TypeDescriptionExample(s)
AdvanceDistanceIntegerSpecifies the number of points to advance roll media after printing.<</AdvanceDistance 18>>setpagedevice
AdvanceMediaIntegerSpecifies 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
CollateBooleanSpecifies whether collated copies are required.<</Collate true>>setpagedevice
CutMediaIntegerSpecifies 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
DuplexBooleanSpecifies whether 2-sided printing is required.<</Duplex true>>setpagedevice
HWResolutionInteger ArraySpecifies the resolution of the page image in pixels per inch.<</HWResolution[1200 1200]>>setpagedevice
InsertSheetBooleanSpecifies whether to insert a blank sheet before the job.<</InsertSheet true>>setpagedevice
JogIntegerSpecifies 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
LeadingEdgeIntegerSpecifies the leading edge of the media: 0 = top, 1 = right, 2 = bottom, 3 = left.<</LeadingEdge 0>>setpagedevice
ManualFeedBooleanSpecifies whether media should be drawn from the manual feed tray. Note: The MediaPosition attribute is preferred over the ManualFeed attribute.<</ManualFeed true>>setpagedevice
MediaClassStringSpecifies a named media.<</MediaClass (Invoices)>>setpagedevice
MediaColorStringSpecifies the color of the media.<</MediaColor >>setpagedevice
MediaPositionIntegerSpecifies the tray or source of the media.<</MediaPosition 12>>setpagedevice
MediaTypeStringSpecifies the general media type.<</MediaType (Glossy)>>setpagedevice
MediaWeightIntegerSpecifies the media weight in grams per meter2.<</MediaWeight 100>>setpagedevice
MirrorPrintBooleanSpecifies whether to flip the output image horizontally.<</MirrorPrint true>>setpagedevice
NegativePrintBooleanSpecifies whether to invert the output image.<</NegativePrint true>>setpagedevice
NumCopiesIntegerSpecifies the number of copies to produce of each page.<</NumCopies 100>>setpagedevice
OrientationIntegerSpecifies the orientation of the output: 0 = portrait, 1 = landscape rotated counter-clockwise, 2 = upside-down, 3 = landscape rotated clockwise.<</Orientation 3>>setpagedevice
OutputFaceUpBooleanSpecifies whether to place the media face-up in the output bin/tray.<</OutputFaceUp true>>setpagedevice
OutputTypeStringSpecifies the output type name.<</OutputType (Photo)>>setpagedevice
PageSizeInteger/Real ArraySpecifies the width and length/height of the page in points.<</PageSize[595 842]>>setpagedevice
SeparationsBooleanSpecifies whether to produce color separations.<</Separations true>>setpagedevice
TraySwitchBooleanSpecifies whether to switch trays automatically.<</TraySwitch true>>setpagedevice
TumbleBooleanSpecifies whether the back sides of pages are rotated 180 degrees.<</Tumble true>>setpagedevice
cupsBorderlessScalingFactorRealSpecifies the amount to scale the page image dimensions.<</cupsBorderlessScalingFactor 1.01>>setpagedevice
cupsColorOrderIntegerSpecifies the order of colors: 0 = chunked, 1 = banded, 2 = planar.<</cupsColorOrder 0>>setpagedevice
cupsColorSpaceIntegerSpecifies 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
cupsCompressionIntegerSpecifies a driver compression type/mode.<</cupsCompression 2>>setpagedevice
cupsInteger0
+ ...
+ cupsInteger15
IntegerSpecifies driver integer values.<</cupsInteger11 1234>>setpagedevice
cupsMarkerTypeStringSpecifies the type of ink/toner to use.<</cupsMarkerType (Black+Color)>>setpagedevice
cupsMediaTypeIntegerSpecifies a numeric media type.<</cupsMediaType 999>>setpagedevice
cupsPageSizeNameStringSpecifies the name of the page size.<</cupsPageSizeName (A4.Full)>>setpagedevice
cupsPreferredBitsPerColorIntegerSpecifies the preferred number of bits per color, typically 8 or 16.<</cupsPreferredBitsPerColor 16>>setpagedevice
cupsReal0
+ ...
+ cupsReal15
RealSpecifies driver real number values.<</cupsReal15 1.234>>setpagedevice
cupsRenderingIntentStringSpecifies the color rendering intent.<</cupsRenderingIntent (AbsoluteColorimetric)>>setpagedevice
cupsRowCountIntegerSpecifies the number of rows of raster data to print on each line for some drivers.<</cupsRowCount 24>>setpagedevice
cupsRowFeedIntegerSpecifies the number of rows to feed between passes for some drivers.<</cupsRowFeed 17>>setpagedevice
cupsRowStepIntegerSpecifies the number of lines between columns/rows on the print head for some drivers.<</cupsRowStep 2>>setpagedevice
cupsString0
+ ...
+ cupsString15
StringSpecifies driver string values.<</cupsString0(String Value)>>setpagedevice
+ +

Change History

+

Changes in CUPS 1.2.8

+ + +

Changes in CUPS 1.2