1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
3 <!-- SECTION: Programming -->
5 <title>CUPS PPD Extensions
</title>
6 <meta name='keywords' content='Programming, PostScript Printer Description'
>
10 "$Id: spec-ppd.html 4918 2006-01-12 05:14:40Z mike $"
12 CUPS PPD extensions specification for the Common UNIX Printing System (CUPS).
14 Copyright 1997-2006 by Easy Software Products.
16 These coded instructions, statements, and computer programs are the
17 property of Easy Software Products and are protected by Federal
18 copyright law. Distribution and use rights are outlined in the file
19 "LICENSE.txt" which should have been included with this file. If this
20 file is missing or damaged please contact Easy Software Products
23 Attn: CUPS Licensing Information
24 Easy Software Products
25 44141 Airport View Drive, Suite 204
26 Hollywood, Maryland 20636 USA
29 EMail: cups-info@cups.org
30 WWW: http://www.cups.org
33 <h2 class='title'
><a name='INTRODUCTION'
>Introduction
</a></h2>
35 <p>This specification describes the attributes and extensions
37 href=
"http://partners.adobe.com/asn/developer/PDFS/TN/5003.PPD_Spec_v4.3.pdf">
38 Adobe TechNote #
5003: PostScript Printer Description File Format
39 Specification Version
4.3</a>. PostScript Printer Description
40 (
"PPD") files describe the capabilities of each printer and are
41 used by CUPS to support printer-specific features and intelligent
44 <h2 class='title'
><a name='SYNTAX'
>PPD File Syntax
</a></h2>
46 <p>The PPD format is text-based and uses lines of up to
255
47 characters terminated by a carriage return, linefeed, or
48 combination of carriage return and line feed. The following ABNF
49 definition [RFC2234] defines the general format of lines in a PPD
53 PPD-FILE = HEADER +(DATA / COMMENT / LINE-END)
55 HEADER =
"*" 0x50.50.44.2D
.41.64.6F
.62.65 ":" ; *PPD-Adobe:
56 *WSP DQUOTE
"4.3" DQUOTE LINE-END
58 COMMENT =
"*%" *TCHAR LINE-END
60 DATA =
"*" 1*KCHAR [ WSP
1*KCHAR [
"/" 1*TCHAR ] ]
":"
61 1*(*WSP VALUE) LINE-END
63 VALUE =
1*TCHAR / DQUOTE
1*SCHAR DQUOTE
65 KCHAR = ALPHA / DIGIT /
"_" /
"." /
"-"
67 SCHAR = LINE-END / WSP / %x21 / %x23-
7E / %xA0-FF
69 TCHAR = %x20-
7E / %xA0-FF
71 LINE-END = CR / LF / CR LF
75 <h2 class='title'
><a name='ATTRIBUTES'
>General Attributes
</a></h2>
79 <p>This string attribute provides a conversion rule of the
83 source/type cost program
86 <p>The destination type is assumed to the printer's type. If a
87 printer supports the source type directly, the special filter
88 program
"-" may be specified.
</p>
93 <em>*% Standard raster printer driver filter
</em>
94 *cupsFilter:
"application/vnd.cups-raster 100 rastertofoo"
96 <em>*% Plain text filter
</em>
97 *cupsFilter:
"text/plain 10 texttofoo"
99 <em>*% Pass-through filter for PostScript printers
</em>
100 *cupsFilter:
"application/vnd.cups-postscript 0 -"
103 <h3>cupsFlipDuplex
</h3>
105 <p>This boolean attribute notifies the RIP filters that the
106 destination printer requires an upside-down image for the back
107 page. The default value is false.
</p>
111 <pre class='command'
>
112 <em>*% Flip the page image for the back side of duplexed output
</em>
113 *cupsFlipDuplex: true
116 <h3>cupsManualCopies
</h3>
118 <p>This boolean attribute notifies the RIP filters that the
119 destination printer does not support copy generation in
120 hardware. The default value is false.
</p>
124 <pre class='command'
>
125 <em>*% Tell the RIP filters to generate the copies for us
</em>
126 *cupsManualCopies: true
129 <h3>cupsModelNumber
</h3>
131 <p>This integer attribute specifies a printer-specific model
132 number. This number can be used by a filter program to adjust
133 the output for a specific model of printer.
</p>
137 <pre class='command'
>
138 <em>*% Specify an integer for a driver-specific model number
</em>
139 *cupsModelNumber:
1234
142 <h3>cupsPortMonitor
</h3>
144 <p>This string attribute specifies printer-specific
"port
145 monitor" filters that may be used with the printer. The CUPS
146 scheduler also looks for the
<tt>Protocols
</tt> attribute to see
147 if the
<tt>BCP
</tt> or
<tt>TBCP
</tt> protocols are supported. If
148 so, the corresponding port monitor (
"bcp" and
"tbcp",
149 respectively) is listed in the printer's
150 <tt>port-monitor-supported
</tt> attribute.
</p>
154 <pre class='command'
>
155 <em>*% Specify a PostScript printer that supports the TBCP protocol
</em>
158 <em>*% Specify a printer-specific port monitor for an Epson USB printer
</em>
159 *cupsPortMonitor epson-usb/USB Status Monitor:
"epson-usb"
164 <p>This required attribute describes which version of the CUPS
165 PPD file extensions was used. Currently it must be the string
166 "1.0",
"1.1", or
"1.2".
</p>
170 <pre class='command'
>
171 <em>*% Specify a CUPS
1.2 driver
</em>
176 <h2 class='title'
><a name='OPTIONS'
>Custom Options
</a></h2>
178 <p>CUPS supports custom options using an extension of the
179 <tt>CustomPageSize
</tt> and
<tt>ParamCustomPageSize
</tt>
182 <pre class='command'
>
183 *CustomFoo True:
"command"
184 *ParamCustomFoo Name1/Text
1: order type minimum maximum
185 *ParamCustomFoo Name2/Text
2: order type minimum maximum
187 *ParamCustomFoo NameN/Text N: order type minimum maximum
190 <p>When the base option is part of the
<tt>JCLSetup
</tt> section,
191 the
"command" string contains JCL commands with
"\order"
192 placeholders for each numbered parameter. The CUPS API handles
193 any necessary value quoting for HP-PJL commands.
</p>
195 <p>For non-
<tt>JCLSetup
</tt> options, the
"order" value is a
196 number from
1 to N and specifies the order of values as they are
197 placed on the stack before the command.
</p>
199 <p>The
"type" is one of the following keywords:
</p>
203 <li><tt>curve
</tt> - a real value from
"minimum" to
204 "maximum" representing a gamma correction curve using the
205 function: f(x) = x
<sup>value
</sup></li>
207 <li><tt>int
</tt> - an integer value from
"minimum" to
210 <li><tt>invcurve
</tt> - a real value from
"minimum" to
211 "maximum" representing a gamma correction curve using the
212 function: f(x) = x
<sup>1 / value
</sup></li>
214 <li><tt>passcode
</tt> - a string of numbers value with a
215 minimum of
"minimum" numbers and a maximum of
"maximum"
216 numbers (passcode strings are not displayed in the user
219 <li><tt>password
</tt> - a string value with a minimum of
220 "minimum" characters and a maximum of
"maximum"
221 characters (password strings are not displayed in the
224 <li><tt>points
</tt> - a measurement value in points from
225 "minimum" to
"maximum"</li>
227 <li><tt>real
</tt> - a real value from
"minimum" to
230 <li><tt>string
</tt> - a string value with a minimum of
231 "minimum" characters and a maximum of
"maximum"
238 <pre class='command'
>
239 <em>*% Base JCL key code option
</em>
240 *OpenUI JCLPasscode/Key Code: PickOne
241 *OrderDependency:
10 JCLSetup *JCLPasscode
242 *DefaultJCLPasscode: None
243 *JCLPasscode None/No Code:
""
244 *JCLPasscode
1111:
"@PJL SET PASSCODE = 1111<0A>"
245 *JCLPasscode
2222:
"@PJL SET PASSCODE = 2222<0A>"
246 *JCLPasscode
3333:
"@PJL SET PASSCODE = 3333<0A>"
247 *JCLCloseUI: *JCLPasscode
249 <em>*% Custom JCL key code option
</em>
250 *CustomJCLPasscode True:
"@PJL SET PASSCODE = \1<0A>"
251 *ParamCustomJCLPasscode Code/Key Code:
1 passcode
4 4
254 <em>*% Base PostScript gamma/density option
</em>
255 *OpenUI GammaDensity/Gamma and Density: PickOne
256 *OrderDependency:
10 AnySetup *GammaDensity
257 *DefaultGammaDensity: Normal
258 *GammaDensity Normal/Normal:
"<</cupsReal1 1.0/cupsReal2 1.0>>setpagedevice"
259 *GammaDensity Light/Lighter:
"<</cupsReal1 0.9/cupsReal2 0.67>>setpagedevice"
260 *GammaDensity Dark/Darker:
"<</cupsReal1 1.1/cupsReal2 1.5>>setpagedevice"
261 *JCLCloseUI: *GammaDensity
263 <em>*% Custom PostScript gamma/density option
</em>
264 *CustomGammaDensity True:
"<</cupsReal1 3 1 roll/cupsReal2 3 1>>setpagedevice"
265 *ParamCustomGammaDensity Gamma:
1 curve
0.1 10
266 *ParamCustomGammaDensity Density:
2 real
0 2
270 <h2 class='title'
><a name='PROFILES'
>Color Profiles
</a></h2>
272 <h3>cupsColorProfile
</h3>
274 <p>This string attribute specifies a color profile of the
277 <pre class='command'
>
278 *cupsColorProfile Resolution/MediaType:
"density gamma m00 m01 m02 m10 m11 m12 m20 m21 m22"
281 <p>The
<i>Resolution
</i> and
<i>MediaType
</i> values may be
"-"
282 to act as a wildcard. Otherwise they must match one of the
283 <tt>Resolution
</tt> or
<tt>MediaType
</tt> attributes defined in
286 <p>The
<i>density
</i> and
<i>gamma
</i> values define gamma and
287 density adjustment function such that:
</p>
289 <pre class='command'
>
290 f(x) = density * x
<sup style='font-size:
100%'
>gamma
</sup>
293 <p>The
<i>m00
</i> through
<i>m22
</i> values define a
3x3
294 transformation matrix for the CMY color values. The density
295 function is applied
<i>after
</i> the CMY transformation:
</p>
297 <pre class='command'
>
305 <pre class='command'
>
306 <em>*% Specify a profile for printing at
360dpi on all media types
</em>
307 *cupsColorProfile
360dpi/-:
"1.0 1.5 1.0 0.0 -0.2 -0.4 1.0 0.0 -0.2 0.0 1.0"
309 <em>*% Specify a profile for printing at
720dpi on Glossy media
</em>
310 *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"
312 <em>*% Specify a default profile for printing at all other resolutions and media types
</em>
313 *cupsColorProfile -/-:
"0.9 2.0 1.0 0.0 -0.2 -0.4 1.0 0.0 -0.2 0.0 1.0"
316 <h3>cupsICCProfile
</h3>
318 <p>This attribute specifies an ICC color profile of the
321 <pre class='command'
>
322 *cupsICCProfile ColorModel.MediaType.Resolution/Description:
"filename"
325 <p>The
<tt>ColorModel
</tt>,
<tt>MediaType
</tt>, and
326 <tt>Resolution
</tt> keywords specify a selector for color
327 profiles. If omitted, the color profile will match any option
328 keyword for the corresponding main keyword.
</p>
330 <p>The
<tt>Description
</tt> specifies human-readable text that
331 is associated with the color profile. The
<tt>filename
</tt>
332 portion specifies the ICC color profile to use; if the filename
333 is not absolute, it is loaded relative to the
334 <var>/usr/share/cups/profiles
</var> directory.
</p>
338 <pre class='command'
>
339 <em>*% Specify a profile for CMYK printing at
360dpi on all media types
</em>
340 *cupsICCProfile CMYK.
.360dpi/
360dpi CMYK:
"vendor/foo-360-cmyk.icc"
342 <em>*% Specify a profile for RGB printing at
720dpi on Glossy media
</em>
343 *cupsColorProfile RGB.Glossy
.720dpi/
720dpi Glossy:
"vendor/foo-720-glossy-rgb.icc"
345 <em>*% Specify a default profile for printing at all other resolutions and media types
</em>
346 *cupsICCProfile .../Default:
"vendor/foo-default.icc"
349 <h4>Customizing the Profile Selection Keywords
</h4>
351 <p>The
<tt>ColorModel
</tt>,
<tt>MediaType
</tt>, and
352 <tt>Resolution
</tt> keywords can be reassigned to different main
353 keywords, allowing drivers to do color profile selection based
354 on different parameters. The
<tt>cupsICCQualifier1
</tt>,
355 <tt>cupsICCQualifier2
</tt>, and
<tt>cupsICCQualifier3
</tt>
356 attributes define the mapping from selector to main keyword:
</p>
358 <pre class='command'
>
359 *cupsICCQualifier1: MainKeyword
360 *cupsICCQualifier2: MainKeyword
361 *cupsICCQualifier3: MainKeyword
364 <p>The default mapping is as follows:
</p>
366 <pre class='command'
>
367 *cupsICCQualifier1: ColorModel
368 *cupsICCQualifier2: MediaType
369 *cupsICCQualifier3: Resolution
373 <h2 class='title'
><a name='I18N'
>I18N Support
</a></h2>
375 <p>CUPS
1.2 and higher adds support for PPD files containing multiple
376 languages by following the following rules:
</p>
380 <li>The
<tt>LanguageVersion
</tt> is
<tt>English
</tt></li>
382 <li>The
<tt>LanguageEncoding
</tt> is
<tt>ISOLatin1
</tt></li>
384 <li>Main and option keywords may not exceed
34
385 characters, which is a subset of what the Adobe PPD spec
388 <li>Translations are specified using a locale prefix of
389 the form
"ll" or
"ll_CC." where
"ll" is the
2-letter ISO
390 language code and
"CC" is the
2-letter ISO country
393 <li>Translation strings are encoded using UTF-
8.
</li>
395 <li>Main keywords are translated using any of the
397 <p><tt>*ll.Translation MainKeyword/translation
399 <tt>*ll_CC.Translation MainKeyword/translation
400 text:
""</tt></p></li>
402 <li>Option keywords are translated using any of the
404 <p><tt>*ll.MainKeyword OptionKeyword/translation
406 <tt>*ll_CC.MainKeyword OptionKeyword/translation
407 text:
""</tt></p></li>
414 <pre class='command'
>
415 *LanguageVersion: English
416 *LanguageEncoding: ISOLatin1
417 *ModelName:
"Foobar Laser 9999"
419 <em>*% Localize for French and German
</em>
420 *fr_FR.Translation ModelName/La Foobar Laser
9999:
""
421 *de_DE.Translation ModelName/Foobar LaserDrucken
9999:
""
425 *OpenUI *InputSlot/Paper Source: PickOne
426 *OrderDependency:
10 AnySetup *InputSlot
427 *DefaultInputSlot: Auto
428 <em>*% Localize for French and German
</em>
429 *fr_FR.Translation InputSlot/Papier source:
""
430 *de_DE.Translation InputSlot/Papiereinzug:
""
431 *InputSlot Auto/Default:
"<</ManualFeed false>>setpagedevice"
432 <em>*% Localize for French and German
</em>
433 *fr_FR.InputSlot Auto/Par Defaut:
""
434 *de_DE.InputSlot Auto/Standard:
""
435 *InputSlot Manual/Manual Feed:
"<</ManualFeed true>>setpagedevice"
436 <em>*% Localize for French and German
</em>
437 *fr_FR.InputSlot Manual/Manuel mecanisme de alimentation:
""
438 *de_DE.InputSlot Manual/Manueller Einzug:
""
443 <h2 class='title'
><a name='HISTORY'
>Change History
</a></h2>
445 <h3>Changes in CUPS
1.2</h3>
449 <li>Added I18N support attributes
</li>
451 <li>Added custom option values support
</li>
453 <li>Added
<tt>cupsICCProfile
</tt> attribute
</li>
455 <li>Added
<tt>cupsPortMonitor
</tt> attribute
</li>
457 <li>Removed
<tt>cupsProtocol
</tt> attribute
</li>
461 <h3>Changes in CUPS
1.1</h3>
465 <li>Added
<tt>cupsFlipDuplex
</tt> attribute
</li>
467 <li>Added
<tt>cupsProtocol
</tt> attribute
</li>