Introduction

This specification describes the attributes and extensions that CUPS adds to Adobe TechNote #5003: PostScript Printer Description File Format Specification Version 4.3. PostScript Printer Description ("PPD") files describe the capabilities of each printer and are used by CUPS to support printer-specific features and intelligent filtering.

PPD File Syntax

The PPD format is text-based and uses lines of up to 255 characters terminated by a carriage return, linefeed, or combination of carriage return and line feed. The following ABNF definition [RFC2234] defines the general format of lines in a PPD file:

PPD-FILE = HEADER +(DATA / COMMENT / LINE-END)

HEADER   = "*" 0x50.50.44.2D.41.64.6F.62.65 ":"   ; *PPD-Adobe:
           *WSP DQUOTE "4.3" DQUOTE LINE-END

COMMENT  = "*%" *TCHAR LINE-END

DATA     = "*" 1*KCHAR [ WSP 1*KCHAR [ "/" 1*TCHAR ] ] ":"
           1*(*WSP VALUE) LINE-END

VALUE    = 1*TCHAR / DQUOTE 1*SCHAR DQUOTE

KCHAR    = ALPHA / DIGIT / "_" / "." / "-"

SCHAR    = LINE-END / WSP / %x21 / %x23-7E / %xA0-FF

TCHAR    = %x20-7E / %xA0-FF

LINE-END = CR / LF / CR LF

General Attributes

cupsFilter

This string attribute provides a conversion rule of the form:

source/type cost program

The destination type is assumed to the printer's type. If a printer supports the source type directly, the special filter program "-" may be specified.

Examples:

*% Standard raster printer driver filter 
*cupsFilter: "application/vnd.cups-raster 100 rastertofoo"

*% Plain text filter 
*cupsFilter: "text/plain 10 texttofoo"

*% Pass-through filter for PostScript printers 
*cupsFilter: "application/vnd.cups-postscript 0 -"

cupsFlipDuplex

This boolean attribute notifies the RIP filters that the destination printer requires an upside-down image for the back page. The default value is false.

Example:

*% Flip the page image for the back side of duplexed output 
*cupsFlipDuplex: true

cupsManualCopies

This boolean attribute notifies the RIP filters that the destination printer does not support copy generation in hardware. The default value is false.

Example:

*% Tell the RIP filters to generate the copies for us 
*cupsManualCopies: true

cupsModelNumber

This integer attribute specifies a printer-specific model number. This number can be used by a filter program to adjust the output for a specific model of printer.

Example:

*% Specify an integer for a driver-specific model number 
*cupsModelNumber: 1234

cupsPortMonitor

This string attribute specifies printer-specific "port monitor" filters that may be used with the printer. The CUPS scheduler also looks for the Protocols attribute to see if the BCP or TBCP protocols are supported. If so, the corresponding port monitor ("bcp" and "tbcp", respectively) is listed in the printer's port-monitor-supported attribute.

Examples:

*% Specify a PostScript printer that supports the TBCP protocol
*Protocols: TBCP PJL

*% Specify a printer-specific port monitor for an Epson USB printer 
*cupsPortMonitor epson-usb/USB Status Monitor: "epson-usb"

cupsVersion

This required attribute describes which version of the CUPS PPD file extensions was used. Currently it must be the string "1.0", "1.1", or "1.2".

Example:

*% Specify a CUPS 1.2 driver 
*cupsVersion: "1.2"

Custom Options

CUPS supports custom options using an extension of the CustomPageSize and ParamCustomPageSize syntax:

*CustomFoo True: "command"
*ParamCustomFoo Name1/Text 1: order type minimum maximum
*ParamCustomFoo Name2/Text 2: order type minimum maximum
...
*ParamCustomFoo NameN/Text N: order type minimum maximum

When the base option is part of the JCLSetup section, the "command" string contains JCL commands with "\order" placeholders for each numbered parameter. The CUPS API handles any necessary value quoting for HP-PJL commands.

For non-JCLSetup options, the "order" value is a number from 1 to N and specifies the order of values as they are placed on the stack before the command.

The "type" is one of the following keywords:

Examples:

*% Base JCL key code option 
*OpenUI JCLPasscode/Key Code: PickOne
*OrderDependency: 10 JCLSetup *JCLPasscode
*DefaultJCLPasscode: None
*JCLPasscode None/No Code: ""
*JCLPasscode 1111: "@PJL SET PASSCODE = 1111<0A>"
*JCLPasscode 2222: "@PJL SET PASSCODE = 2222<0A>"
*JCLPasscode 3333: "@PJL SET PASSCODE = 3333<0A>"
*JCLCloseUI: *JCLPasscode

*% Custom JCL key code option 
*CustomJCLPasscode True: "@PJL SET PASSCODE = \1<0A>"
*ParamCustomJCLPasscode Code/Key Code: 1 passcode 4 4


*% Base PostScript gamma/density option 
*OpenUI GammaDensity/Gamma and Density: PickOne
*OrderDependency: 10 AnySetup *GammaDensity
*DefaultGammaDensity: Normal
*GammaDensity Normal/Normal: "<</cupsReal1 1.0/cupsReal2 1.0>>setpagedevice"
*GammaDensity Light/Lighter: "<</cupsReal1 0.9/cupsReal2 0.67>>setpagedevice"
*GammaDensity Dark/Darker: "<</cupsReal1 1.1/cupsReal2 1.5>>setpagedevice"
*JCLCloseUI: *GammaDensity

*% Custom PostScript gamma/density option 
*CustomGammaDensity True: "<</cupsReal1 3 1 roll/cupsReal2 3 1>>setpagedevice"
*ParamCustomGammaDensity Gamma: 1 curve 0.1 10
*ParamCustomGammaDensity Density: 2 real 0 2

Color Profiles

cupsColorProfile

This string attribute specifies a color profile of the form:

*cupsColorProfile Resolution/MediaType: "density gamma m00 m01 m02 m10 m11 m12 m20 m21 m22"

The Resolution and MediaType values may be "-" to act as a wildcard. Otherwise they must match one of the Resolution or MediaType attributes defined in the PPD file.

The density and gamma values define gamma and density adjustment function such that:

f(x) = density * x gamma

The m00 through m22 values define a 3x3 transformation matrix for the CMY color values. The density function is applied after the CMY transformation:

| m00 m01 m02 |
| m10 m11 m12 |
| m20 m21 m22 |

Examples:

*% Specify a profile for printing at 360dpi on all media types 
*cupsColorProfile 360dpi/-: "1.0 1.5 1.0 0.0 -0.2 -0.4 1.0 0.0 -0.2 0.0 1.0"

*% Specify a profile for printing at 720dpi on Glossy media 
*cupsColorProfile 720dpi/Glossy: "1.0 2.5 1.0 0.0 -0.2 -0.4 1.0 0.0 -0.2 0.0 1.0"

*% Specify a default profile for printing at all other resolutions and media types 
*cupsColorProfile -/-: "0.9 2.0 1.0 0.0 -0.2 -0.4 1.0 0.0 -0.2 0.0 1.0"

cupsICCProfile

This attribute specifies an ICC color profile of the form:

*cupsICCProfile ColorModel.MediaType.Resolution/Description: "filename"

The ColorModel, MediaType, and Resolution keywords specify a selector for color profiles. If omitted, the color profile will match any option keyword for the corresponding main keyword.

The Description specifies human-readable text that is associated with the color profile. The filename portion specifies the ICC color profile to use; if the filename is not absolute, it is loaded relative to the /usr/share/cups/profiles directory.

Examples:

*% Specify a profile for CMYK printing at 360dpi on all media types 
*cupsICCProfile CMYK..360dpi/360dpi CMYK: "vendor/foo-360-cmyk.icc"

*% Specify a profile for RGB printing at 720dpi on Glossy media 
*cupsColorProfile RGB.Glossy.720dpi/720dpi Glossy: "vendor/foo-720-glossy-rgb.icc"

*% Specify a default profile for printing at all other resolutions and media types 
*cupsICCProfile .../Default: "vendor/foo-default.icc"

Customizing the Profile Selection Keywords

The ColorModel, MediaType, and Resolution keywords can be reassigned to different main keywords, allowing drivers to do color profile selection based on different parameters. The cupsICCQualifier1, cupsICCQualifier2, and cupsICCQualifier3 attributes define the mapping from selector to main keyword:

*cupsICCQualifier1: MainKeyword
*cupsICCQualifier2: MainKeyword
*cupsICCQualifier3: MainKeyword

The default mapping is as follows:

*cupsICCQualifier1: ColorModel
*cupsICCQualifier2: MediaType
*cupsICCQualifier3: Resolution

I18N Support

CUPS 1.2 and higher adds support for PPD files containing multiple languages by following the following rules:

  1. The LanguageVersion is English
  2. The LanguageEncoding is ISOLatin1
  3. Main and option keywords may not exceed 34 characters, which is a subset of what the Adobe PPD spec allows.
  4. Translations are specified using a locale prefix of the form "ll" or "ll_CC." where "ll" is the 2-letter ISO language code and "CC" is the 2-letter ISO country code
  5. Translation strings are encoded using UTF-8.
  6. Main keywords are translated using any of the following forms:

    *ll.Translation MainKeyword/translation text: ""
    *ll_CC.Translation MainKeyword/translation text: ""

  7. Option keywords are translated using any of the following forms:

    *ll.MainKeyword OptionKeyword/translation text: ""
    *ll_CC.MainKeyword OptionKeyword/translation text: ""

Examples:

*LanguageVersion: English
*LanguageEncoding: ISOLatin1
*ModelName: "Foobar Laser 9999"

*% Localize for French and German
*fr_FR.Translation ModelName/La Foobar Laser 9999: ""
*de_DE.Translation ModelName/Foobar LaserDrucken 9999: ""

...

*OpenUI *InputSlot/Paper Source: PickOne
*OrderDependency: 10 AnySetup *InputSlot
*DefaultInputSlot: Auto
*% Localize for French and German
*fr_FR.Translation InputSlot/Papier source: ""
*de_DE.Translation InputSlot/Papiereinzug: ""
*InputSlot Auto/Default: "<</ManualFeed false>>setpagedevice"
*% Localize for French and German
*fr_FR.InputSlot Auto/Par Defaut: ""
*de_DE.InputSlot Auto/Standard: ""
*InputSlot Manual/Manual Feed: "<</ManualFeed true>>setpagedevice"
*% Localize for French and German
*fr_FR.InputSlot Manual/Manuel mecanisme de alimentation: ""
*de_DE.InputSlot Manual/Manueller Einzug: ""
*CloseUI: *InputSlot

Change History

Changes in CUPS 1.2

Changes in CUPS 1.1