1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
3 <!-- SECTION: Specifications -->
5 <title>CUPS PPD Extensions
</title>
6 <meta name='keywords' content='Programming, PostScript Printer Description'
>
7 <link rel='stylesheet' type='text/css' href='../cups.css'
>
11 "$Id: spec-ppd.html 5217 2006-03-02 21:24:01Z mike $"
13 CUPS PPD extensions specification for the Common UNIX Printing System (CUPS).
15 Copyright 1997-2006 by Easy Software Products.
17 These coded instructions, statements, and computer programs are the
18 property of Easy Software Products and are protected by Federal
19 copyright law. Distribution and use rights are outlined in the file
20 "LICENSE.txt" which should have been included with this file. If this
21 file is missing or damaged please contact Easy Software Products
24 Attn: CUPS Licensing Information
25 Easy Software Products
26 44141 Airport View Drive, Suite 204
27 Hollywood, Maryland 20636 USA
30 EMail: cups-info@cups.org
31 WWW: http://www.cups.org
34 <h2 class='title'
><a name='INTRODUCTION'
>Introduction
</a></h2>
36 <p>This specification describes the attributes and extensions
38 href=
"http://partners.adobe.com/public/developer/en/ps/5003.PPD_Spec_v4.3.pdf">
39 Adobe TechNote #
5003: PostScript Printer Description File Format
40 Specification Version
4.3</a>. PostScript Printer Description
41 (
"PPD") files describe the capabilities of each printer and are
42 used by CUPS to support printer-specific features and intelligent
45 <h2 class='title'
><a name='SYNTAX'
>PPD File Syntax
</a></h2>
47 <p>The PPD format is text-based and uses lines of up to
255
48 characters terminated by a carriage return, linefeed, or
49 combination of carriage return and line feed. The following ABNF
50 definition [RFC2234] defines the general format of lines in a PPD
54 PPD-FILE = HEADER +(DATA / COMMENT / LINE-END)
56 HEADER =
"*" 0x50.50.44.2D
.41.64.6F
.62.65 ":" ; *PPD-Adobe:
57 *WSP DQUOTE
"4.3" DQUOTE LINE-END
59 COMMENT =
"*%" *TCHAR LINE-END
61 DATA =
"*" 1*KCHAR [ WSP
1*KCHAR [
"/" 1*TCHAR ] ]
":"
62 1*(*WSP VALUE) LINE-END
64 VALUE =
1*TCHAR / DQUOTE
1*SCHAR DQUOTE
66 KCHAR = ALPHA / DIGIT /
"_" /
"." /
"-"
68 SCHAR = LINE-END / WSP / %x21 / %x23-
7E / %xA0-FF
70 TCHAR = %x20-
7E / %xA0-FF
72 LINE-END = CR / LF / CR LF
76 <h2 class='title'
><a name='ATTRIBUTES'
>General Attributes
</a></h2>
80 <p class='summary'
>*APBookFile:
"file URL"</p>
82 <p>This string attribute specifies the Apple help book file to use
83 for this printer driver.
</p>
88 *APBookFile:
"file:///Library/Printers/vendor/Help/filename"
91 <h3>APDuplexRequiresFlippedMargin
</h3>
93 <p class='summary'
>*APDuplexRequiresFlippedMargin: boolean
</p>
95 <p>This boolean attribute notifies the RIP filters that the
96 destination printer does not require the top and bottom margins
97 of the
<tt>ImageableArea
</tt> swapped for the back page. The
98 default value is
<code>true
</code>.
</p>
102 <pre class='command'
>
103 <em>*% Don't swap the top and bottom margins for the back side
</em>
104 *APDuplexRequiresFlippedMargin: false
107 <p>Also see the related
<tt>cupsFlipDuplex
</tt> attribute.
</p>
111 <p class='summary'
>*cupsFilter:
"source/type cost program"</p>
113 <p>This string attribute provides a conversion rule from the
114 given source type to the printer's native format using the
115 filter
"program". If a printer supports the source type directly,
116 the special filter program
"-" may be specified.
</p>
120 <pre class='command'
>
121 <em>*% Standard raster printer driver filter
</em>
122 *cupsFilter:
"application/vnd.cups-raster 100 rastertofoo"
124 <em>*% Plain text filter
</em>
125 *cupsFilter:
"text/plain 10 texttofoo"
127 <em>*% Pass-through filter for PostScript printers
</em>
128 *cupsFilter:
"application/vnd.cups-postscript 0 -"
131 <h3>cupsFlipDuplex
</h3>
133 <p class='summary'
>*cupsFlipDuplex: boolean
</p>
135 <p>This boolean attribute notifies the RIP filters that the
136 destination printer requires an upside-down image for the back
137 page. The default value is
<code>false
</code>.
</p>
141 <pre class='command'
>
142 <em>*% Flip the page image for the back side of duplexed output
</em>
143 *cupsFlipDuplex: true
146 <p>Also see the related
<tt>APDuplexRequiresFlippedMargins
</tt> attribute.
</p>
148 <h3>cupsIPPReason
</h3>
150 <p class='summary'
>*cupsIPPReason reason/Reason Text:
"optional URIs"</p>
152 <p>This optional attribute maps custom
153 <code>printer-state-reasons
</code> keywords that are generated by
154 the driver to human readable text. The optional URIs string
155 contains zero or more URIs separated by a newline. Each URI can
156 be a CUPS server absolute path to a help file under the
157 scheduler's
<code>DocumentRoot
</code> directory, a full HTTP URL
158 (
"http://www.domain.com/path/to/help/page.html"), or any other
159 valid URI which directs the user at additional information
160 concerning the condition that is being reported.
</p>
164 <pre class='command'
>
165 <em>*% Map com.vendor-error to text but no page
</em>
166 *cupsIPPReason com.vendor-error/A serious error occurred:
""
168 <em>*% Map com.vendor-error to text and a local page
</em>
169 *cupsIPPReason com.vendor-error/A serious error occurred:
"/help/com.vendor/error.html"
171 <em>*% Map com.vendor-error to text and a remote page
</em>
172 *cupsIPPReason com.vendor-error/A serious error occurred:
"http://www.vendor.com/help"
174 <em>*% Map com.vendor-error to text and a local, Apple help book, and remote page
</em>
175 *APHelpBook:
"file:///Library/Printers/vendor/Help/filename"
176 *cupsIPPReason com.vendor-error/A serious error occurred:
"/help/com.vendor/error.html
177 help:anchor='com.vendor-error'%20bookID=Vendor%20Help
178 http://www.vendor.com/help"
182 <h3>cupsLanguages
</h3>
184 <p class='summary'
>*cupsLanguages:
"locale list"</p>
186 <p>This attribute describes which language localizations are
187 included in the PPD. The
"locale list" string is a space-delimited
188 list of locale names (
"en",
"en_US",
"fr_FR", etc.)
</p>
192 <pre class='command'
>
193 <em>*% Specify Canadian, UK, and US English, and Candian and French French
</em>
194 *cupsLanguages:
"en_CA en_UK en_US fr_CA fr_FR"
197 <h3>cupsManualCopies
</h3>
199 <p class='summary'
>*cupsManualCopies: boolean
</p>
201 <p>This boolean attribute notifies the RIP filters that the
202 destination printer does not support copy generation in
203 hardware. The default value is
<code>false
</code>.
</p>
207 <pre class='command'
>
208 <em>*% Tell the RIP filters to generate the copies for us
</em>
209 *cupsManualCopies: true
212 <h3>cupsModelNumber
</h3>
214 <p class='summary'
>*cupsModelNumber: number
</p>
216 <p>This integer attribute specifies a printer-specific model
217 number. This number can be used by a filter program to adjust
218 the output for a specific model of printer.
</p>
222 <pre class='command'
>
223 <em>*% Specify an integer for a driver-specific model number
</em>
224 *cupsModelNumber:
1234
227 <h3>cupsPortMonitor
</h3>
229 <p class='summary'
>*cupsPortMonitor urischeme/Descriptive Text:
"port monitor"</p>
231 <p>This string attribute specifies printer-specific
"port
232 monitor" filters that may be used with the printer. The CUPS
233 scheduler also looks for the
<tt>Protocols
</tt> attribute to see
234 if the
<tt>BCP
</tt> or
<tt>TBCP
</tt> protocols are supported. If
235 so, the corresponding port monitor (
"bcp" and
"tbcp",
236 respectively) is listed in the printer's
237 <tt>port-monitor-supported
</tt> attribute.
</p>
239 <p>The
"urischeme" portion of the attribute specifies the URI scheme
240 that this port monitor should be used for. Typically this is used to
241 pre-select a particular port monitor for each type of connection that
242 is supported by the printer. The
"port monitor" string can be
"none"
243 to disable the port monitor for the given URI scheme.
</p>
247 <pre class='command'
>
248 <em>*% Specify a PostScript printer that supports the TBCP protocol
</em>
251 <em>*% Specify that TBCP should be used for socket connections but not USB
</em>
252 *cupsPortMonitor socket/AppSocket Printing:
"tbcp"
253 *cupsPortMonitor usb/USB Printing:
"none"
255 <em>*% Specify a printer-specific port monitor for an Epson USB printer
</em>
256 *cupsPortMonitor usb/USB Status Monitor:
"epson-usb"
261 <p class='summary'
>*cupsVersion: major.minor
</p>
263 <p>This required attribute describes which version of the CUPS
264 PPD file extensions was used. Currently it must be the string
265 "1.0",
"1.1", or
"1.2".
</p>
269 <pre class='command'
>
270 <em>*% Specify a CUPS
1.2 driver
</em>
274 <h2 class='title'
><a name='OPTIONS'
>Custom Options
</a></h2>
276 <p>CUPS supports custom options using an extension of the
277 <tt>CustomPageSize
</tt> and
<tt>ParamCustomPageSize
</tt>
280 <pre class='command'
>
281 *CustomFoo True:
"command"
282 *ParamCustomFoo Name1/Text
1: order type minimum maximum
283 *ParamCustomFoo Name2/Text
2: order type minimum maximum
285 *ParamCustomFoo NameN/Text N: order type minimum maximum
288 <p>When the base option is part of the
<tt>JCLSetup
</tt> section,
289 the
"command" string contains JCL commands with
"\order"
290 placeholders for each numbered parameter. The CUPS API handles
291 any necessary value quoting for HP-PJL commands. For example, if
292 the JCL command string is
"@PJL SET PASSCODE=\1" and the first
293 option value is
"1234" then CUPS will output the string
294 "@PJL SET PASSCODE=1234".
</p>
296 <p>For non-
<tt>JCLSetup
</tt> options, the
"order" value is a
297 number from
1 to N and specifies the order of values as they are
298 placed on the stack before the command. For example, if the
299 PostScript command string is
300 "<</cupsReal1 2 1 roll>>setpagedevice" and the
301 option value is
"2.0" then CUPS will output the string
302 "2.0 <</cupsReal1 2 1 roll>>setpagedevice".
</p>
304 <p>The
"type" is one of the following keywords:
</p>
308 <li><tt>curve
</tt> - a real value from
"minimum" to
309 "maximum" representing a gamma correction curve using the
310 function: f(x) = x
<sup>value
</sup></li>
312 <li><tt>int
</tt> - an integer value from
"minimum" to
315 <li><tt>invcurve
</tt> - a real value from
"minimum" to
316 "maximum" representing a gamma correction curve using the
317 function: f(x) = x
<sup>1 / value
</sup></li>
319 <li><tt>passcode
</tt> - a string of numbers value with a
320 minimum of
"minimum" numbers and a maximum of
"maximum"
321 numbers (
"minimum" and
"maximum" are numbers and passcode
322 strings are not displayed in the user interface)
</li>
324 <li><tt>password
</tt> - a string value with a minimum of
325 "minimum" characters and a maximum of
"maximum"
326 characters (
"minimum" and
"maximum" are numbers and password
327 strings are not displayed in the user interface)
</li>
329 <li><tt>points
</tt> - a measurement value in points from
330 "minimum" to
"maximum"</li>
332 <li><tt>real
</tt> - a real value from
"minimum" to
335 <li><tt>string
</tt> - a string value with a minimum of
336 "minimum" characters and a maximum of
"maximum"
337 characters (
"minimum" and
"maximum" are numbers)
</li>
343 <pre class='command'
>
344 <em>*% Base JCL key code option
</em>
345 *OpenUI JCLPasscode/Key Code: PickOne
346 *OrderDependency:
10 JCLSetup *JCLPasscode
347 *DefaultJCLPasscode: None
348 *JCLPasscode None/No Code:
""
349 *JCLPasscode
1111:
"@PJL SET PASSCODE = 1111<0A>"
350 *JCLPasscode
2222:
"@PJL SET PASSCODE = 2222<0A>"
351 *JCLPasscode
3333:
"@PJL SET PASSCODE = 3333<0A>"
352 *JCLCloseUI: *JCLPasscode
354 <em>*% Custom JCL key code option
</em>
355 *CustomJCLPasscode True:
"@PJL SET PASSCODE = \1<0A>"
356 *ParamCustomJCLPasscode Code/Key Code:
1 passcode
4 4
359 <em>*% Base PostScript watermark option
</em>
360 *OpenUI WatermarkText/Watermark Text: PickOne
361 *OrderDependency:
10 AnySetup *WatermarkText
362 *DefaultWatermarkText: None
363 *WatermarkText None:
""
364 *WatermarkText Draft:
"<</cupsString1(Draft)>>setpagedevice"
365 *CloseUI: *WatermarkText
367 <em>*% Custom PostScript watermark option
</em>
368 *CustomWatermarkText True:
"<</cupsString1 2 1 roll>>setpagedevice"
369 *ParamCustomWatermarkText Text:
1 string
0 32
372 <em>*% Base PostScript gamma/density option
</em>
373 *OpenUI GammaDensity/Gamma and Density: PickOne
374 *OrderDependency:
10 AnySetup *GammaDensity
375 *DefaultGammaDensity: Normal
376 *GammaDensity Normal/Normal:
"<</cupsReal1 1.0/cupsReal2 1.0>>setpagedevice"
377 *GammaDensity Light/Lighter:
"<</cupsReal1 0.9/cupsReal2 0.67>>setpagedevice"
378 *GammaDensity Dark/Darker:
"<</cupsReal1 1.1/cupsReal2 1.5>>setpagedevice"
379 *CloseUI: *GammaDensity
381 <em>*% Custom PostScript gamma/density option
</em>
382 *CustomGammaDensity True:
"<</cupsReal1 3 1 roll/cupsReal2 3 1>>setpagedevice"
383 *ParamCustomGammaDensity Gamma:
1 curve
0.1 10
384 *ParamCustomGammaDensity Density:
2 real
0 2
388 <h2 class='title'
><a name='PROFILES'
>Color Profiles
</a></h2>
390 <p>CUPS supports two types of color profiles. The first type is
391 based on sRGB and is used by the standard CUPS raster filters and
392 ESP Ghostscript. The second type is based on ICC profiles and is
393 used by the Core Graphics-based filters on MacOS X.
</p>
395 <blockquote><b>Note:
</b> At this time, none of the CUPS raster
396 filters support ICC profiles. This will be addressed as time
397 and resources permit.
</blockquote>
399 <h3>cupsColorProfile
</h3>
401 <p class='summary'
>*cupsColorProfile Resolution/MediaType:
"density
402 gamma m00 m01 m02 m10 m11 m12 m20 m21 m22"</p>
404 <p>This string attribute specifies an sRGB-based color profile
405 consisting of gamma and density controls and a
3x3 CMY color
406 transform matrix.
</p>
408 <p>The
<i>Resolution
</i> and
<i>MediaType
</i> values may be
"-"
409 to act as a wildcard. Otherwise they must match one of the
410 <tt>Resolution
</tt> or
<tt>MediaType
</tt> attributes defined in
413 <p>The
<i>density
</i> and
<i>gamma
</i> values define gamma and
414 density adjustment function such that:
</p>
416 <pre class='command'
>
417 f(x) = density * x
<sup style='font-size:
100%'
>gamma
</sup>
420 <p>The
<i>m00
</i> through
<i>m22
</i> values define a
3x3
421 transformation matrix for the CMY color values. The density
422 function is applied
<i>after
</i> the CMY transformation:
</p>
424 <pre class='command'
>
432 <pre class='command'
>
433 <em>*% Specify a profile for printing at
360dpi on all media types
</em>
434 *cupsColorProfile
360dpi/-:
"1.0 1.5 1.0 0.0 -0.2 -0.4 1.0 0.0 -0.2 0.0 1.0"
436 <em>*% Specify a profile for printing at
720dpi on Glossy media
</em>
437 *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"
439 <em>*% Specify a default profile for printing at all other resolutions and media types
</em>
440 *cupsColorProfile -/-:
"0.9 2.0 1.0 0.0 -0.2 -0.4 1.0 0.0 -0.2 0.0 1.0"
443 <h3>cupsICCProfile
</h3>
445 <p class='summary'
>*cupsICCProfile
446 ColorModel.MediaType.Resolution/Description:
"filename"</p>
448 <p>This attribute specifies an ICC color profile that is
449 used to convert the document colors to the device
450 colorspace. The
<tt>ColorModel
</tt>,
<tt>MediaType
</tt>, and
451 <tt>Resolution
</tt> keywords specify a selector for color
452 profiles. If omitted, the color profile will match any option
453 keyword for the corresponding main keyword.
</p>
455 <p>The
<tt>Description
</tt> specifies human-readable text that
456 is associated with the color profile. The
<tt>filename
</tt>
457 portion specifies the ICC color profile to use; if the filename
458 is not absolute, it is loaded relative to the
459 <var>/usr/share/cups/profiles
</var> directory.
</p>
463 <pre class='command'
>
464 <em>*% Specify a profile for CMYK printing at
360dpi on all media types
</em>
465 *cupsICCProfile CMYK.
.360dpi/
360dpi CMYK:
"vendor/foo-360-cmyk.icc"
467 <em>*% Specify a profile for RGB printing at
720dpi on Glossy media
</em>
468 *cupsColorProfile RGB.Glossy
.720dpi/
720dpi Glossy:
"vendor/foo-720-glossy-rgb.icc"
470 <em>*% Specify a default profile for printing at all other resolutions and media types
</em>
471 *cupsICCProfile ../Default:
"vendor/foo-default.icc"
474 <h4>Customizing the Profile Selection Keywords
</h4>
476 <p>The
<tt>ColorModel
</tt>,
<tt>MediaType
</tt>, and
477 <tt>Resolution
</tt> keywords can be reassigned to different main
478 keywords, allowing drivers to do color profile selection based
479 on different parameters. The
<tt>cupsICCQualifier1
</tt>,
480 <tt>cupsICCQualifier2
</tt>, and
<tt>cupsICCQualifier3
</tt>
481 attributes define the mapping from selector to main keyword:
</p>
483 <pre class='command'
>
484 *cupsICCQualifier1: MainKeyword
485 *cupsICCQualifier2: MainKeyword
486 *cupsICCQualifier3: MainKeyword
489 <p>The default mapping is as follows:
</p>
491 <pre class='command'
>
492 *cupsICCQualifier1: ColorModel
493 *cupsICCQualifier2: MediaType
494 *cupsICCQualifier3: Resolution
498 <h2 class='title'
><a name='I18N'
>Globalized PPD Support
</a></h2>
500 <p>CUPS
1.2 and higher adds support for PPD files containing multiple
501 languages by following the following additional rules:
</p>
505 <li>The
<tt>LanguageVersion
</tt> MUST be
<tt>English
</tt></li>
507 <li>The
<tt>LanguageEncoding
</tt> MUST be
<tt>ISOLatin1
</tt></li>
509 <li>The
<tt>cupsLanguages
</tt> attribute MUST be provided and
510 list each of the supported locales in the PPD file
</li>
512 <li>Main and option keywords MUST NOT exceed
34 (instead of
40)
513 characters to allow room for the locale prefixes in translation
516 <li>The main keyword
"Translation" MUST NOT be used
</li>
518 <li>Translation strings included with the main and option
519 keywords MUST NOT contain characters outside the ASCII
520 subset of ISOLatin1 and UTF-
8; developers wishing to use
521 characters outside ASCII MUST provide a separate set of
522 English localization attributes for the affected keywords.
</li>
524 <li>Localizations are specified using a locale prefix of
525 the form
"ll" or
"ll_CC." where
"ll" is the
2-letter ISO
526 language code and
"CC" is the
2-letter ISO country
529 <li>Locale-specific translation strings MUST be encoded
532 <li>Main keywords MUST be localized using one of the
534 <p><tt>*ll.Translation MainKeyword/translation
536 <tt>*ll_CC.Translation MainKeyword/translation
537 text:
""</tt></p></li>
539 <li>Option keywords MUST be localized using one of the
541 <p><tt>*ll.MainKeyword OptionKeyword/translation
543 <tt>*ll_CC.MainKeyword OptionKeyword/translation
544 text:
""</tt></p></li>
546 <li>Localization attributes MAY appear anywhere after the
547 first line of the PPD file
</li>
551 <blockquote><b>Note:
</b>
552 We use a
<tt>LanguageEncoding
</tt> value of
<tt>ISOLatin1
</tt>
553 and limit the allowed base translation strings to ASCII to avoid
554 character coding issues that would otherwise occur. In addition,
555 requiring the base translation strings to be in English allows
556 for easier fallback translation when no localization is provided
557 in the PPD file for a given locale.
</blockquote>
561 <pre class='command'
>
562 *LanguageVersion: English
563 *LanguageEncoding: ISOLatin1
564 *cupsLanguages:
"de_DE fr_FR"
565 *ModelName:
"Foobar Laser 9999"
567 <em>*% Localize ModelName for French and German
</em>
568 *fr_FR.Translation ModelName/La Foobar Laser
9999:
""
569 *de_DE.Translation ModelName/Foobar LaserDrucken
9999:
""
571 *cupsIPPReason com.vendor-error/A serious error occurred:
"/help/com.vendor/error.html"
572 <em>*% Localize printer-state-reason for French and German
</em>
573 *fr_FR.cupsIPPReason com.vendor-error/Une erreur s
èrieuse s'est produite:
"/help/com.vendor/error.html"
574 *de_DE.cupsIPPReason com.vendor-error/Eine ernste St
örung trat:
"/help/com.vendor/error.html"
578 *OpenUI *InputSlot/Paper Source: PickOne
579 *OrderDependency:
10 AnySetup *InputSlot
580 *DefaultInputSlot: Auto
581 <em>*% Localize InputSlot for French and German
</em>
582 *fr_FR.Translation InputSlot/Papier source:
""
583 *de_DE.Translation InputSlot/Papiereinzug:
""
584 *InputSlot Auto/Default:
"<</ManualFeed false>>setpagedevice"
585 <em>*% Localize InputSlot=Auto for French and German
</em>
586 *fr_FR.InputSlot Auto/Par Defaut:
""
587 *de_DE.InputSlot Auto/Standard:
""
588 *InputSlot Manual/Manual Feed:
"<</ManualFeed true>>setpagedevice"
589 <em>*% Localize InputSlot=Manual for French and German
</em>
590 *fr_FR.InputSlot Manual/Manuel mecanisme de alimentation:
""
591 *de_DE.InputSlot Manual/Manueller Einzug:
""
596 <h2 class='title'
><a name='HISTORY'
>Change History
</a></h2>
598 <h3>Changes in CUPS
1.2</h3>
602 <li>Added globalization support attributes
</li>
604 <li>Added custom option values support
</li>
606 <li>Added
<tt>APBookFile
</tt> attribute
</li>
608 <li>Added
<tt>APDuplexRequiresFlippedMargin
</tt> attribute
</li>
610 <li>Added
<tt>cupsICCProfile
</tt> attribute
</li>
612 <li>Added
<tt>cupsIPPReason
</tt> attribute
</li>
614 <li>Added
<tt>cupsLanguages
</tt> attribute
</li>
616 <li>Added
<tt>cupsPortMonitor
</tt> attribute
</li>
618 <li>Removed
<tt>cupsProtocol
</tt> attribute
</li>
622 <h3>Changes in CUPS
1.1</h3>
626 <li>Added
<tt>cupsFlipDuplex
</tt> attribute
</li>
628 <li>Added
<tt>cupsProtocol
</tt> attribute
</li>