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 6025 2006-10-11 14:59:20Z 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>
109 <h3>cupsEvenDuplex
</h3>
111 <p class='summary'
>*cupsEvenDuplex: boolean
</p>
113 <p>This boolean attribute notifies the RIP filters that the
114 destination printer requires an even number of pages when
2-sided
115 printing is selected. The default value is
<code>false
</code>.
</p>
119 <pre class='command'
>
120 <em>*% Always send an even number of pages when duplexing
</em>
121 *cupsEvenDuplex: true
126 <p class='summary'
>*cupsFilter:
"source/type cost program"</p>
128 <p>This string attribute provides a conversion rule from the
129 given source type to the printer's native format using the
130 filter
"program". If a printer supports the source type directly,
131 the special filter program
"-" may be specified.
</p>
135 <pre class='command'
>
136 <em>*% Standard raster printer driver filter
</em>
137 *cupsFilter:
"application/vnd.cups-raster 100 rastertofoo"
139 <em>*% Plain text filter
</em>
140 *cupsFilter:
"text/plain 10 texttofoo"
142 <em>*% Pass-through filter for PostScript printers
</em>
143 *cupsFilter:
"application/vnd.cups-postscript 0 -"
146 <h3>cupsFlipDuplex
</h3>
148 <p class='summary'
>*cupsFlipDuplex: boolean
</p>
150 <p>This boolean attribute notifies the RIP filters that the
151 destination printer requires an upside-down image for the back
152 page. The default value is
<code>false
</code>.
</p>
156 <pre class='command'
>
157 <em>*% Flip the page image for the back side of duplexed output
</em>
158 *cupsFlipDuplex: true
161 <p>Also see the related
<tt>APDuplexRequiresFlippedMargins
</tt>
164 <h3>cupsIPPReason
</h3>
166 <p class='summary'
>*cupsIPPReason reason/Reason Text:
"optional URIs"</p>
168 <p>This optional attribute maps custom
169 <code>printer-state-reasons
</code> keywords that are generated by
170 the driver to human readable text. The optional URIs string
171 contains zero or more URIs separated by a newline. Each URI can
172 be a CUPS server absolute path to a help file under the
173 scheduler's
<code>DocumentRoot
</code> directory, a full HTTP URL
174 (
"http://www.domain.com/path/to/help/page.html"), or any other
175 valid URI which directs the user at additional information
176 concerning the condition that is being reported.
</p>
180 <pre class='command'
>
181 <em>*% Map com.vendor-error to text but no page
</em>
182 *cupsIPPReason com.vendor-error/A serious error occurred:
""
184 <em>*% Map com.vendor-error to text and a local page
</em>
185 *cupsIPPReason com.vendor-error/A serious error occurred:
"/help/com.vendor/error.html"
187 <em>*% Map com.vendor-error to text and a remote page
</em>
188 *cupsIPPReason com.vendor-error/A serious error occurred:
"http://www.vendor.com/help"
190 <em>*% Map com.vendor-error to text and a local, Apple help book, and remote page
</em>
191 *APHelpBook:
"file:///Library/Printers/vendor/Help/filename"
192 *cupsIPPReason com.vendor-error/A serious error occurred:
"/help/com.vendor/error.html
193 help:anchor='com.vendor-error'%20bookID=Vendor%20Help
194 http://www.vendor.com/help"
198 <h3>cupsLanguages
</h3>
200 <p class='summary'
>*cupsLanguages:
"locale list"</p>
202 <p>This attribute describes which language localizations are
203 included in the PPD. The
"locale list" string is a space-delimited
204 list of locale names (
"en",
"en_US",
"fr_FR", etc.)
</p>
208 <pre class='command'
>
209 <em>*% Specify Canadian, UK, and US English, and Candian and French French
</em>
210 *cupsLanguages:
"en_CA en_UK en_US fr_CA fr_FR"
213 <h3>cupsManualCopies
</h3>
215 <p class='summary'
>*cupsManualCopies: boolean
</p>
217 <p>This boolean attribute notifies the RIP filters that the
218 destination printer does not support copy generation in
219 hardware. The default value is
<code>false
</code>.
</p>
223 <pre class='command'
>
224 <em>*% Tell the RIP filters to generate the copies for us
</em>
225 *cupsManualCopies: true
228 <h3>cupsModelNumber
</h3>
230 <p class='summary'
>*cupsModelNumber: number
</p>
232 <p>This integer attribute specifies a printer-specific model
233 number. This number can be used by a filter program to adjust
234 the output for a specific model of printer.
</p>
238 <pre class='command'
>
239 <em>*% Specify an integer for a driver-specific model number
</em>
240 *cupsModelNumber:
1234
243 <h3>cupsPortMonitor
</h3>
245 <p class='summary'
>*cupsPortMonitor urischeme/Descriptive Text:
"port monitor"</p>
247 <p>This string attribute specifies printer-specific
"port
248 monitor" filters that may be used with the printer. The CUPS
249 scheduler also looks for the
<tt>Protocols
</tt> attribute to see
250 if the
<tt>BCP
</tt> or
<tt>TBCP
</tt> protocols are supported. If
251 so, the corresponding port monitor (
"bcp" and
"tbcp",
252 respectively) is listed in the printer's
253 <tt>port-monitor-supported
</tt> attribute.
</p>
255 <p>The
"urischeme" portion of the attribute specifies the URI scheme
256 that this port monitor should be used for. Typically this is used to
257 pre-select a particular port monitor for each type of connection that
258 is supported by the printer. The
"port monitor" string can be
"none"
259 to disable the port monitor for the given URI scheme.
</p>
263 <pre class='command'
>
264 <em>*% Specify a PostScript printer that supports the TBCP protocol
</em>
267 <em>*% Specify that TBCP should be used for socket connections but not USB
</em>
268 *cupsPortMonitor socket/AppSocket Printing:
"tbcp"
269 *cupsPortMonitor usb/USB Printing:
"none"
271 <em>*% Specify a printer-specific port monitor for an Epson USB printer
</em>
272 *cupsPortMonitor usb/USB Status Monitor:
"epson-usb"
277 <p class='summary'
>*cupsVersion: major.minor
</p>
279 <p>This required attribute describes which version of the CUPS
280 PPD file extensions was used. Currently it must be the string
281 "1.0",
"1.1", or
"1.2".
</p>
285 <pre class='command'
>
286 <em>*% Specify a CUPS
1.2 driver
</em>
290 <h2 class='title'
><a name='OPTIONS'
>Custom Options
</a></h2>
292 <p>CUPS supports custom options using an extension of the
293 <tt>CustomPageSize
</tt> and
<tt>ParamCustomPageSize
</tt>
296 <pre class='command'
>
297 *CustomFoo True:
"command"
298 *ParamCustomFoo Name1/Text
1: order type minimum maximum
299 *ParamCustomFoo Name2/Text
2: order type minimum maximum
301 *ParamCustomFoo NameN/Text N: order type minimum maximum
304 <p>When the base option is part of the
<tt>JCLSetup
</tt> section,
305 the
"command" string contains JCL commands with
"\order"
306 placeholders for each numbered parameter. The CUPS API handles
307 any necessary value quoting for HP-PJL commands. For example, if
308 the JCL command string is
"@PJL SET PASSCODE=\1" and the first
309 option value is
"1234" then CUPS will output the string
310 "@PJL SET PASSCODE=1234".
</p>
312 <p>For non-
<tt>JCLSetup
</tt> options, the
"order" value is a
313 number from
1 to N and specifies the order of values as they are
314 placed on the stack before the command. For example, if the
315 PostScript command string is
316 "<</cupsReal1 2 1 roll>>setpagedevice" and the
317 option value is
"2.0" then CUPS will output the string
318 "2.0 <</cupsReal1 2 1 roll>>setpagedevice".
</p>
320 <p>The
"type" is one of the following keywords:
</p>
324 <li><tt>curve
</tt> - a real value from
"minimum" to
325 "maximum" representing a gamma correction curve using the
326 function: f(x) = x
<sup>value
</sup></li>
328 <li><tt>int
</tt> - an integer value from
"minimum" to
331 <li><tt>invcurve
</tt> - a real value from
"minimum" to
332 "maximum" representing a gamma correction curve using the
333 function: f(x) = x
<sup>1 / value
</sup></li>
335 <li><tt>passcode
</tt> - a string of numbers value with a
336 minimum of
"minimum" numbers and a maximum of
"maximum"
337 numbers (
"minimum" and
"maximum" are numbers and passcode
338 strings are not displayed in the user interface)
</li>
340 <li><tt>password
</tt> - a string value with a minimum of
341 "minimum" characters and a maximum of
"maximum"
342 characters (
"minimum" and
"maximum" are numbers and password
343 strings are not displayed in the user interface)
</li>
345 <li><tt>points
</tt> - a measurement value in points from
346 "minimum" to
"maximum"</li>
348 <li><tt>real
</tt> - a real value from
"minimum" to
351 <li><tt>string
</tt> - a string value with a minimum of
352 "minimum" characters and a maximum of
"maximum"
353 characters (
"minimum" and
"maximum" are numbers)
</li>
359 <pre class='command'
>
360 <em>*% Base JCL key code option
</em>
361 *OpenUI JCLPasscode/Key Code: PickOne
362 *OrderDependency:
10 JCLSetup *JCLPasscode
363 *DefaultJCLPasscode: None
364 *JCLPasscode None/No Code:
""
365 *JCLPasscode
1111:
"@PJL SET PASSCODE = 1111<0A>"
366 *JCLPasscode
2222:
"@PJL SET PASSCODE = 2222<0A>"
367 *JCLPasscode
3333:
"@PJL SET PASSCODE = 3333<0A>"
368 *JCLCloseUI: *JCLPasscode
370 <em>*% Custom JCL key code option
</em>
371 *CustomJCLPasscode True:
"@PJL SET PASSCODE = \1<0A>"
372 *ParamCustomJCLPasscode Code/Key Code:
1 passcode
4 4
375 <em>*% Base PostScript watermark option
</em>
376 *OpenUI WatermarkText/Watermark Text: PickOne
377 *OrderDependency:
10 AnySetup *WatermarkText
378 *DefaultWatermarkText: None
379 *WatermarkText None:
""
380 *WatermarkText Draft:
"<</cupsString1(Draft)>>setpagedevice"
381 *CloseUI: *WatermarkText
383 <em>*% Custom PostScript watermark option
</em>
384 *CustomWatermarkText True:
"<</cupsString1 2 1 roll>>setpagedevice"
385 *ParamCustomWatermarkText Text:
1 string
0 32
388 <em>*% Base PostScript gamma/density option
</em>
389 *OpenUI GammaDensity/Gamma and Density: PickOne
390 *OrderDependency:
10 AnySetup *GammaDensity
391 *DefaultGammaDensity: Normal
392 *GammaDensity Normal/Normal:
"<</cupsReal1 1.0/cupsReal2 1.0>>setpagedevice"
393 *GammaDensity Light/Lighter:
"<</cupsReal1 0.9/cupsReal2 0.67>>setpagedevice"
394 *GammaDensity Dark/Darker:
"<</cupsReal1 1.1/cupsReal2 1.5>>setpagedevice"
395 *CloseUI: *GammaDensity
397 <em>*% Custom PostScript gamma/density option
</em>
398 *CustomGammaDensity True:
"<</cupsReal1 3 1 roll/cupsReal2 3 1>>setpagedevice"
399 *ParamCustomGammaDensity Gamma:
1 curve
0.1 10
400 *ParamCustomGammaDensity Density:
2 real
0 2
404 <h2 class='title'
><a name='PROFILES'
>Color Profiles
</a></h2>
406 <p>CUPS supports two types of color profiles. The first type is
407 based on sRGB and is used by the standard CUPS raster filters and
408 ESP Ghostscript. The second type is based on ICC profiles and is
409 used by the Core Graphics-based filters on MacOS X.
</p>
411 <blockquote><b>Note:
</b> At this time, none of the CUPS raster
412 filters support ICC profiles. This will be addressed as time
413 and resources permit.
</blockquote>
415 <h3>cupsColorProfile
</h3>
417 <p class='summary'
>*cupsColorProfile Resolution/MediaType:
"density
418 gamma m00 m01 m02 m10 m11 m12 m20 m21 m22"</p>
420 <p>This string attribute specifies an sRGB-based color profile
421 consisting of gamma and density controls and a
3x3 CMY color
422 transform matrix.
</p>
424 <p>The
<i>Resolution
</i> and
<i>MediaType
</i> values may be
"-"
425 to act as a wildcard. Otherwise they must match one of the
426 <tt>Resolution
</tt> or
<tt>MediaType
</tt> attributes defined in
429 <p>The
<i>density
</i> and
<i>gamma
</i> values define gamma and
430 density adjustment function such that:
</p>
432 <pre class='command'
>
433 f(x) = density * x
<sup style='font-size:
100%'
>gamma
</sup>
436 <p>The
<i>m00
</i> through
<i>m22
</i> values define a
3x3
437 transformation matrix for the CMY color values. The density
438 function is applied
<i>after
</i> the CMY transformation:
</p>
440 <pre class='command'
>
448 <pre class='command'
>
449 <em>*% Specify a profile for printing at
360dpi on all media types
</em>
450 *cupsColorProfile
360dpi/-:
"1.0 1.5 1.0 0.0 -0.2 -0.4 1.0 0.0 -0.2 0.0 1.0"
452 <em>*% Specify a profile for printing at
720dpi on Glossy media
</em>
453 *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"
455 <em>*% Specify a default profile for printing at all other resolutions and media types
</em>
456 *cupsColorProfile -/-:
"0.9 2.0 1.0 0.0 -0.2 -0.4 1.0 0.0 -0.2 0.0 1.0"
459 <h3>cupsICCProfile
</h3>
461 <p class='summary'
>*cupsICCProfile
462 ColorModel.MediaType.Resolution/Description:
"filename"</p>
464 <p>This attribute specifies an ICC color profile that is
465 used to convert the document colors to the device
466 colorspace. The
<tt>ColorModel
</tt>,
<tt>MediaType
</tt>, and
467 <tt>Resolution
</tt> keywords specify a selector for color
468 profiles. If omitted, the color profile will match any option
469 keyword for the corresponding main keyword.
</p>
471 <p>The
<tt>Description
</tt> specifies human-readable text that
472 is associated with the color profile. The
<tt>filename
</tt>
473 portion specifies the ICC color profile to use; if the filename
474 is not absolute, it is loaded relative to the
475 <var>/usr/share/cups/profiles
</var> directory.
</p>
479 <pre class='command'
>
480 <em>*% Specify a profile for CMYK printing at
360dpi on all media types
</em>
481 *cupsICCProfile CMYK.
.360dpi/
360dpi CMYK:
"vendor/foo-360-cmyk.icc"
483 <em>*% Specify a profile for RGB printing at
720dpi on Glossy media
</em>
484 *cupsColorProfile RGB.Glossy
.720dpi/
720dpi Glossy:
"vendor/foo-720-glossy-rgb.icc"
486 <em>*% Specify a default profile for printing at all other resolutions and media types
</em>
487 *cupsICCProfile ../Default:
"vendor/foo-default.icc"
490 <h4>Customizing the Profile Selection Keywords
</h4>
492 <p>The
<tt>MediaType
</tt> and
<tt>Resolution
</tt> keywords can be
493 reassigned to different main keywords, allowing drivers to do
494 color profile selection based on different parameters. The
495 <tt>cupsICCQualifier2
</tt> and
<tt>cupsICCQualifier3
</tt>
496 attributes define the mapping from selector to main keyword:
</p>
498 <pre class='command'
>
499 *cupsICCQualifier2: MainKeyword2
500 *cupsICCQualifier3: MainKeyword3
503 <p>The default mapping is as follows:
</p>
505 <pre class='command'
>
506 *cupsICCQualifier2: MediaType
507 *cupsICCQualifier3: Resolution
511 <h2 class='title'
><a name='I18N'
>Globalized PPD Support
</a></h2>
513 <p>CUPS
1.2 and higher adds support for PPD files containing multiple
514 languages by following the following additional rules:
</p>
518 <li>The
<tt>LanguageVersion
</tt> MUST be
<tt>English
</tt></li>
520 <li>The
<tt>LanguageEncoding
</tt> MUST be
<tt>ISOLatin1
</tt></li>
522 <li>The
<tt>cupsLanguages
</tt> attribute MUST be provided and
523 list each of the supported locales in the PPD file
</li>
525 <li>Main and option keywords MUST NOT exceed
34 (instead of
40)
526 characters to allow room for the locale prefixes in translation
529 <li>The main keyword
"Translation" MUST NOT be used
</li>
531 <li>Translation strings included with the main and option
532 keywords MUST NOT contain characters outside the ASCII
533 subset of ISOLatin1 and UTF-
8; developers wishing to use
534 characters outside ASCII MUST provide a separate set of
535 English localization attributes for the affected keywords.
</li>
537 <li>Localizations are specified using a locale prefix of
538 the form
"ll" or
"ll_CC." where
"ll" is the
2-letter ISO
539 language code and
"CC" is the
2-letter ISO country
542 <li>Locale-specific translation strings MUST be encoded
545 <li>Main keywords MUST be localized using one of the
547 <p><tt>*ll.Translation MainKeyword/translation
549 <tt>*ll_CC.Translation MainKeyword/translation
550 text:
""</tt></p></li>
552 <li>Option keywords MUST be localized using one of the
554 <p><tt>*ll.MainKeyword OptionKeyword/translation
556 <tt>*ll_CC.MainKeyword OptionKeyword/translation
557 text:
""</tt></p></li>
559 <li>Localization attributes MAY appear anywhere after the
560 first line of the PPD file
</li>
564 <blockquote><b>Note:
</b>
565 We use a
<tt>LanguageEncoding
</tt> value of
<tt>ISOLatin1
</tt>
566 and limit the allowed base translation strings to ASCII to avoid
567 character coding issues that would otherwise occur. In addition,
568 requiring the base translation strings to be in English allows
569 for easier fallback translation when no localization is provided
570 in the PPD file for a given locale.
</blockquote>
574 <pre class='command'
>
575 *LanguageVersion: English
576 *LanguageEncoding: ISOLatin1
577 *cupsLanguages:
"de_DE fr_FR"
578 *ModelName:
"Foobar Laser 9999"
580 <em>*% Localize ModelName for French and German
</em>
581 *fr_FR.Translation ModelName/La Foobar Laser
9999:
""
582 *de_DE.Translation ModelName/Foobar LaserDrucken
9999:
""
584 *cupsIPPReason com.vendor-error/A serious error occurred:
"/help/com.vendor/error.html"
585 <em>*% Localize printer-state-reason for French and German
</em>
586 *fr_FR.cupsIPPReason com.vendor-error/Une erreur s
èrieuse s'est produite:
"/help/com.vendor/error.html"
587 *de_DE.cupsIPPReason com.vendor-error/Eine ernste St
örung trat:
"/help/com.vendor/error.html"
591 *OpenUI *InputSlot/Paper Source: PickOne
592 *OrderDependency:
10 AnySetup *InputSlot
593 *DefaultInputSlot: Auto
594 <em>*% Localize InputSlot for French and German
</em>
595 *fr_FR.Translation InputSlot/Papier source:
""
596 *de_DE.Translation InputSlot/Papiereinzug:
""
597 *InputSlot Auto/Default:
"<</ManualFeed false>>setpagedevice"
598 <em>*% Localize InputSlot=Auto for French and German
</em>
599 *fr_FR.InputSlot Auto/Par Defaut:
""
600 *de_DE.InputSlot Auto/Standard:
""
601 *InputSlot Manual/Manual Feed:
"<</ManualFeed true>>setpagedevice"
602 <em>*% Localize InputSlot=Manual for French and German
</em>
603 *fr_FR.InputSlot Manual/Manuel mecanisme de alimentation:
""
604 *de_DE.InputSlot Manual/Manueller Einzug:
""
609 <h2 class='title'
><a name='HISTORY'
>Change History
</a></h2>
611 <h3>Changes in CUPS
1.2</h3>
615 <li>Added globalization support attributes
</li>
617 <li>Added custom option values support
</li>
619 <li>Added
<tt>APBookFile
</tt> attribute
</li>
621 <li>Added
<tt>APDuplexRequiresFlippedMargin
</tt> attribute
</li>
623 <li>Added
<tt>cupsICCProfile
</tt> attribute
</li>
625 <li>Added
<tt>cupsIPPReason
</tt> attribute
</li>
627 <li>Added
<tt>cupsLanguages
</tt> attribute
</li>
629 <li>Added
<tt>cupsPortMonitor
</tt> attribute
</li>
631 <li>Removed
<tt>cupsProtocol
</tt> attribute
</li>
635 <h3>Changes in CUPS
1.1</h3>
639 <li>Added
<tt>cupsFlipDuplex
</tt> attribute
</li>
641 <li>Added
<tt>cupsProtocol
</tt> attribute
</li>