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 6602 2007-06-22 22:13:13Z mike $"
13 CUPS PPD extensions specification for the Common UNIX Printing System (CUPS).
15 Copyright 1997-2007 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 is
<tt>true
</tt> when
<tt>cupsFlipDuplex
</tt> is
<tt>true
</tt> and
<tt>false
</tt> otherwise.
</p>
102 <pre class='command'
>
103 <em>*% Flip the back side images
</em>
104 *cupsFlipDuplex: true
106 <em>*% Don't swap the top and bottom margins for the back side
</em>
107 *APDuplexRequiresFlippedMargin: false
110 <p>Also see the related
<tt>cupsFlipDuplex
</tt> attribute.
</p>
112 <h3>APPrinterPreset
</h3>
114 <p class='summary'
>*APPrinterPreset name/text:
"*Option Choice ..."</p>
116 <p>This attribute defines presets for multiple options that show up
117 in the print dialog on Mac OS X. Each preset maps to one or more
118 pairs of PPD options and choices.
</p>
122 <pre class='command'
>
123 *APPrinterPreset Text/Text Printing on Plain Paper:
"
129 *APPrinterPreset Photo/Photo Printing on Glossy Paper:
"
136 <h3>APRemoteQueueID
</h3>
138 <p class='summary'
>*APRemoteQueueID:
"string"</p>
140 <p>This string attribute notifies the scheduler that this PPD is for a remote CUPS printer, typically shared via Bonjour.
</p>
144 <pre class='command'
>
145 *APRemoteQueueID:
"myprinter"
148 <h3>cupsEvenDuplex
</h3>
150 <p class='summary'
>*cupsEvenDuplex: boolean
</p>
152 <p>This boolean attribute notifies the RIP filters that the
153 destination printer requires an even number of pages when
2-sided
154 printing is selected. The default value is
<code>false
</code>.
</p>
158 <pre class='command'
>
159 <em>*% Always send an even number of pages when duplexing
</em>
160 *cupsEvenDuplex: true
165 <p class='summary'
>*cupsFax: boolean
</p>
167 <p>This boolean attribute specifies whether the PPD defines a facsimile device. The default is
<tt>false
</tt>.
</p>
171 <pre class='command'
>
177 <p class='summary'
>*cupsFilter:
"source/type cost program"</p>
179 <p>This string attribute provides a conversion rule from the
180 given source type to the printer's native format using the
181 filter
"program". If a printer supports the source type directly,
182 the special filter program
"-" may be specified.
</p>
186 <pre class='command'
>
187 <em>*% Standard raster printer driver filter
</em>
188 *cupsFilter:
"application/vnd.cups-raster 100 rastertofoo"
190 <em>*% Plain text filter
</em>
191 *cupsFilter:
"text/plain 10 texttofoo"
193 <em>*% Pass-through filter for PostScript printers
</em>
194 *cupsFilter:
"application/vnd.cups-postscript 0 -"
197 <h3>cupsFlipDuplex
</h3>
199 <p class='summary'
>*cupsFlipDuplex: boolean
</p>
201 <blockquote><b>Note:
</b> The
<tt>cupsFlipDuplex
</tt> attribute is
202 not supported on Mac OS X
10.5.x or earlier.
</blockquote>
204 <p>This boolean attribute specifies the coordinate system of the
205 back side of the media when doing
2-sided printing using a CUPS
206 raster driver.
<a href='#TABLE_1'
>Table
1</a> shows how
207 <code>cupsFlipDuplex
</code> interacts with the
<code>Tumble
</code>
208 page attribute. The default value is
<code>false
</code>.
</p>
211 <table width='
80%' summary='Back Side Raster Coordinate System'
>
212 <caption>Table
1:
<a name='TABLE_1'
>Back Side Raster Coordinate System
</a></caption>
215 <th>cupsFlipDuplex
</th>
217 <th>Image Presentation
</th>
222 <td><code>false
</code></td>
223 <td><code>false
</code></td>
224 <td>Left-to-right, top-to-bottom
</td>
227 <td><code>false
</code></td>
228 <td><code>true
</code></td>
229 <td>Left-to-right, top-to-bottom
</td>
232 <td><code>true
</code></td>
233 <td><code>false
</code></td>
234 <td>Left-to-right, bottom-to-top
</td>
237 <td><code>true
</code></td>
238 <td><code>true
</code></td>
239 <td>Right-to-left, top-to-bottom
</td>
247 <pre class='command'
>
248 <em>*% Flip the page image for the back side of duplexed output
</em>
249 *cupsFlipDuplex: true
252 <p>Also see the related
<tt>APDuplexRequiresFlippedMargins
</tt>
255 <h3>cupsIPPFinishings
</h3>
257 <p class='summary'
>*cupsIPPFinishings number/text:
"*Option Choice ..."</p>
259 <p>This attribute defines a mapping from IPP
<code>finishings
</code>
260 values to PPD options and choices.
</p>
264 <pre class='command'
>
265 *cupsIPPFinishings
4/staple:
"*StapleLocation SinglePortrait"
266 *cupsIPPFinishings
5/punch:
"*PunchMedia Yes *PunchLocation LeftSide"
267 *cupsIPPFinishings
20/staple-top-left:
"*StapleLocation SinglePortrait"
268 *cupsIPPFinishings
21/staple-bottom-left:
"*StapleLocation SingleLandscape"
271 <h3>cupsIPPReason
</h3>
273 <p class='summary'
>*cupsIPPReason reason/Reason Text:
"optional URIs"</p>
275 <p>This optional attribute maps custom
276 <code>printer-state-reasons
</code> keywords that are generated by
277 the driver to human readable text. The optional URIs string
278 contains zero or more URIs separated by a newline. Each URI can
279 be a CUPS server absolute path to a help file under the
280 scheduler's
<code>DocumentRoot
</code> directory, a full HTTP URL
281 (
"http://www.domain.com/path/to/help/page.html"), or any other
282 valid URI which directs the user at additional information
283 concerning the condition that is being reported.
</p>
287 <pre class='command'
>
288 <em>*% Map com.vendor-error to text but no page
</em>
289 *cupsIPPReason com.vendor-error/A serious error occurred:
""
291 <em>*% Map com.vendor-error to text and a local page
</em>
292 *cupsIPPReason com.vendor-error/A serious error occurred:
"/help/com.vendor/error.html"
294 <em>*% Map com.vendor-error to text and a remote page
</em>
295 *cupsIPPReason com.vendor-error/A serious error occurred:
"http://www.vendor.com/help"
297 <em>*% Map com.vendor-error to text and a local, Apple help book, and remote page
</em>
298 *APHelpBook:
"file:///Library/Printers/vendor/Help/filename"
299 *cupsIPPReason com.vendor-error/A serious error occurred:
"/help/com.vendor/error.html
300 help:anchor='com.vendor-error'%20bookID=Vendor%20Help
301 http://www.vendor.com/help"
305 <h3>cupsLanguages
</h3>
307 <p class='summary'
>*cupsLanguages:
"locale list"</p>
309 <p>This attribute describes which language localizations are
310 included in the PPD. The
"locale list" string is a space-delimited
311 list of locale names (
"en",
"en_US",
"fr_CA", etc.)
</p>
315 <pre class='command'
>
316 <em>*% Specify Canadian, UK, and US English, and Candian and French French
</em>
317 *cupsLanguages:
"en_CA en_UK en_US fr_CA fr_CA"
320 <h3>cupsManualCopies
</h3>
322 <p class='summary'
>*cupsManualCopies: boolean
</p>
324 <p>This boolean attribute notifies the RIP filters that the
325 destination printer does not support copy generation in
326 hardware. The default value is
<code>false
</code>.
</p>
330 <pre class='command'
>
331 <em>*% Tell the RIP filters to generate the copies for us
</em>
332 *cupsManualCopies: true
335 <h3>cupsModelNumber
</h3>
337 <p class='summary'
>*cupsModelNumber: number
</p>
339 <p>This integer attribute specifies a printer-specific model
340 number. This number can be used by a filter program to adjust
341 the output for a specific model of printer.
</p>
345 <pre class='command'
>
346 <em>*% Specify an integer for a driver-specific model number
</em>
347 *cupsModelNumber:
1234
351 <h3>cupsPJLCharset
</h3>
353 <p class='summary'
>*cupsPJLCharset:
"ISO character set name"</p>
355 <p>This string attribute specifies the character set that is used
356 for strings in PJL commands. If not specified, US-ASCII is
361 <pre class='command'
>
362 <em>*% Specify UTF-
8 is used in PJL strings
</em>
363 *cupsPJLCharset:
"UTF-8"
367 <h3>cupsPortMonitor
</h3>
369 <p class='summary'
>*cupsPortMonitor urischeme/Descriptive Text:
"port monitor"</p>
371 <p>This string attribute specifies printer-specific
"port
372 monitor" filters that may be used with the printer. The CUPS
373 scheduler also looks for the
<tt>Protocols
</tt> attribute to see
374 if the
<tt>BCP
</tt> or
<tt>TBCP
</tt> protocols are supported. If
375 so, the corresponding port monitor (
"bcp" and
"tbcp",
376 respectively) is listed in the printer's
377 <tt>port-monitor-supported
</tt> attribute.
</p>
379 <p>The
"urischeme" portion of the attribute specifies the URI scheme
380 that this port monitor should be used for. Typically this is used to
381 pre-select a particular port monitor for each type of connection that
382 is supported by the printer. The
"port monitor" string can be
"none"
383 to disable the port monitor for the given URI scheme.
</p>
387 <pre class='command'
>
388 <em>*% Specify a PostScript printer that supports the TBCP protocol
</em>
391 <em>*% Specify that TBCP should be used for socket connections but not USB
</em>
392 *cupsPortMonitor socket/AppSocket Printing:
"tbcp"
393 *cupsPortMonitor usb/USB Printing:
"none"
395 <em>*% Specify a printer-specific port monitor for an Epson USB printer
</em>
396 *cupsPortMonitor usb/USB Status Monitor:
"epson-usb"
399 <h3>cupsPreFilter
</h3>
401 <p class='summary'
>*cupsPreFilter:
"source/type cost program"</p>
403 <p>This string attribute provides a pre-filter rule. The pre-filter
404 program will be inserted in the conversion chain immediately
405 before the filter that accepts the given MIME type.
</p>
409 <pre class='command'
>
410 <em>*% PDF pre-filter
</em>
411 *cupsPreFilter:
"application/pdf 100 mypdfprefilter"
413 <em>*% PNG pre-filter
</em>
414 *cupsPreFilter:
"image/png 0 mypngprefilter"
419 <p class='summary'
>*cupsVersion: major.minor
</p>
421 <p>This required attribute describes which version of the CUPS
422 PPD file extensions was used. Currently it must be the string
423 "1.0",
"1.1", or
"1.2".
</p>
427 <pre class='command'
>
428 <em>*% Specify a CUPS
1.2 driver
</em>
432 <h2 class='title'
><a name='OPTIONS'
>Custom Options
</a></h2>
434 <p>CUPS supports custom options using an extension of the
435 <tt>CustomPageSize
</tt> and
<tt>ParamCustomPageSize
</tt>
438 <pre class='command'
>
439 *CustomFoo True:
"command"
440 *ParamCustomFoo Name1/Text
1: order type minimum maximum
441 *ParamCustomFoo Name2/Text
2: order type minimum maximum
443 *ParamCustomFoo NameN/Text N: order type minimum maximum
446 <p>When the base option is part of the
<tt>JCLSetup
</tt> section,
447 the
"command" string contains JCL commands with
"\order"
448 placeholders for each numbered parameter. The CUPS API handles
449 any necessary value quoting for HP-PJL commands. For example, if
450 the JCL command string is
"@PJL SET PASSCODE=\1" and the first
451 option value is
"1234" then CUPS will output the string
452 "@PJL SET PASSCODE=1234".
</p>
454 <p>For non-
<tt>JCLSetup
</tt> options, the
"order" value is a
455 number from
1 to N and specifies the order of values as they are
456 placed on the stack before the command. For example, if the
457 PostScript command string is
458 "<</cupsReal1 2 1 roll>>setpagedevice" and the
459 option value is
"2.0" then CUPS will output the string
460 "2.0 <</cupsReal1 2 1 roll>>setpagedevice".
</p>
462 <p>The
"type" is one of the following keywords:
</p>
466 <li><tt>curve
</tt> - a real value from
"minimum" to
467 "maximum" representing a gamma correction curve using the
468 function: f(x) = x
<sup>value
</sup></li>
470 <li><tt>int
</tt> - an integer value from
"minimum" to
473 <li><tt>invcurve
</tt> - a real value from
"minimum" to
474 "maximum" representing a gamma correction curve using the
475 function: f(x) = x
<sup>1 / value
</sup></li>
477 <li><tt>passcode
</tt> - a string of numbers value with a
478 minimum of
"minimum" numbers and a maximum of
"maximum"
479 numbers (
"minimum" and
"maximum" are numbers and passcode
480 strings are not displayed in the user interface)
</li>
482 <li><tt>password
</tt> - a string value with a minimum of
483 "minimum" characters and a maximum of
"maximum"
484 characters (
"minimum" and
"maximum" are numbers and password
485 strings are not displayed in the user interface)
</li>
487 <li><tt>points
</tt> - a measurement value in points from
488 "minimum" to
"maximum"</li>
490 <li><tt>real
</tt> - a real value from
"minimum" to
493 <li><tt>string
</tt> - a string value with a minimum of
494 "minimum" characters and a maximum of
"maximum"
495 characters (
"minimum" and
"maximum" are numbers)
</li>
501 <pre class='command'
>
502 <em>*% Base JCL key code option
</em>
503 *OpenUI JCLPasscode/Key Code: PickOne
504 *OrderDependency:
10 JCLSetup *JCLPasscode
505 *DefaultJCLPasscode: None
506 *JCLPasscode None/No Code:
""
507 *JCLPasscode
1111:
"@PJL SET PASSCODE = 1111<0A>"
508 *JCLPasscode
2222:
"@PJL SET PASSCODE = 2222<0A>"
509 *JCLPasscode
3333:
"@PJL SET PASSCODE = 3333<0A>"
510 *JCLCloseUI: *JCLPasscode
512 <em>*% Custom JCL key code option
</em>
513 *CustomJCLPasscode True:
"@PJL SET PASSCODE = \1<0A>"
514 *ParamCustomJCLPasscode Code/Key Code:
1 passcode
4 4
517 <em>*% Base PostScript watermark option
</em>
518 *OpenUI WatermarkText/Watermark Text: PickOne
519 *OrderDependency:
10 AnySetup *WatermarkText
520 *DefaultWatermarkText: None
521 *WatermarkText None:
""
522 *WatermarkText Draft:
"<</cupsString1(Draft)>>setpagedevice"
523 *CloseUI: *WatermarkText
525 <em>*% Custom PostScript watermark option
</em>
526 *CustomWatermarkText True:
"<</cupsString1 3 -1 roll>>setpagedevice"
527 *ParamCustomWatermarkText Text:
1 string
0 32
530 <em>*% Base PostScript gamma/density option
</em>
531 *OpenUI GammaDensity/Gamma and Density: PickOne
532 *OrderDependency:
10 AnySetup *GammaDensity
533 *DefaultGammaDensity: Normal
534 *GammaDensity Normal/Normal:
"<</cupsReal1 1.0/cupsReal2 1.0>>setpagedevice"
535 *GammaDensity Light/Lighter:
"<</cupsReal1 0.9/cupsReal2 0.67>>setpagedevice"
536 *GammaDensity Dark/Darker:
"<</cupsReal1 1.1/cupsReal2 1.5>>setpagedevice"
537 *CloseUI: *GammaDensity
539 <em>*% Custom PostScript gamma/density option
</em>
540 *CustomGammaDensity True:
"<</cupsReal1 3 -1 roll/cupsReal2 5 -1>>setpagedevice"
541 *ParamCustomGammaDensity Gamma:
1 curve
0.1 10
542 *ParamCustomGammaDensity Density:
2 real
0 2
546 <h2 class='title'
><a name='PROFILES'
>Color Profiles
</a></h2>
548 <p>CUPS supports two types of color profiles. The first type is
549 based on sRGB and is used by the standard CUPS raster filters and
550 ESP Ghostscript. The second type is based on ICC profiles and is
551 used by the Core Graphics-based filters on MacOS X.
</p>
553 <blockquote><b>Note:
</b> At this time, none of the CUPS raster
554 filters support ICC profiles. This will be addressed as time
555 and resources permit.
</blockquote>
557 <h3>cupsColorProfile
</h3>
559 <p class='summary'
>*cupsColorProfile Resolution/MediaType:
"density
560 gamma m00 m01 m02 m10 m11 m12 m20 m21 m22"</p>
562 <p>This string attribute specifies an sRGB-based color profile
563 consisting of gamma and density controls and a
3x3 CMY color
564 transform matrix.
</p>
566 <p>The
<i>Resolution
</i> and
<i>MediaType
</i> values may be
"-"
567 to act as a wildcard. Otherwise they must match one of the
568 <tt>Resolution
</tt> or
<tt>MediaType
</tt> attributes defined in
571 <p>The
<i>density
</i> and
<i>gamma
</i> values define gamma and
572 density adjustment function such that:
</p>
574 <pre class='command'
>
575 f(x) = density * x
<sup style='font-size:
100%'
>gamma
</sup>
578 <p>The
<i>m00
</i> through
<i>m22
</i> values define a
3x3
579 transformation matrix for the CMY color values. The density
580 function is applied
<i>after
</i> the CMY transformation:
</p>
582 <pre class='command'
>
590 <pre class='command'
>
591 <em>*% Specify a profile for printing at
360dpi on all media types
</em>
592 *cupsColorProfile
360dpi/-:
"1.0 1.5 1.0 0.0 -0.2 -0.4 1.0 0.0 -0.2 0.0 1.0"
594 <em>*% Specify a profile for printing at
720dpi on Glossy media
</em>
595 *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"
597 <em>*% Specify a default profile for printing at all other resolutions and media types
</em>
598 *cupsColorProfile -/-:
"0.9 2.0 1.0 0.0 -0.2 -0.4 1.0 0.0 -0.2 0.0 1.0"
601 <h3>cupsICCProfile
</h3>
603 <p class='summary'
>*cupsICCProfile
604 ColorModel.MediaType.Resolution/Description:
"filename"</p>
606 <p>This attribute specifies an ICC color profile that is
607 used to convert the document colors to the device
608 colorspace. The
<tt>ColorModel
</tt>,
<tt>MediaType
</tt>, and
609 <tt>Resolution
</tt> keywords specify a selector for color
610 profiles. If omitted, the color profile will match any option
611 keyword for the corresponding main keyword.
</p>
613 <p>The
<tt>Description
</tt> specifies human-readable text that
614 is associated with the color profile. The
<tt>filename
</tt>
615 portion specifies the ICC color profile to use; if the filename
616 is not absolute, it is loaded relative to the
617 <var>/usr/share/cups/profiles
</var> directory.
</p>
621 <pre class='command'
>
622 <em>*% Specify a profile for CMYK printing at
360dpi on all media types
</em>
623 *cupsICCProfile CMYK.
.360dpi/
360dpi CMYK:
"vendor/foo-360-cmyk.icc"
625 <em>*% Specify a profile for RGB printing at
720dpi on Glossy media
</em>
626 *cupsColorProfile RGB.Glossy
.720dpi/
720dpi Glossy:
"vendor/foo-720-glossy-rgb.icc"
628 <em>*% Specify a default profile for printing at all other resolutions and media types
</em>
629 *cupsICCProfile ../Default:
"vendor/foo-default.icc"
632 <h4>Customizing the Profile Selection Keywords
</h4>
634 <p>The
<tt>MediaType
</tt> and
<tt>Resolution
</tt> keywords can be
635 reassigned to different main keywords, allowing drivers to do
636 color profile selection based on different parameters. The
637 <tt>cupsICCQualifier2
</tt> and
<tt>cupsICCQualifier3
</tt>
638 attributes define the mapping from selector to main keyword:
</p>
640 <pre class='command'
>
641 *cupsICCQualifier2: MainKeyword2
642 *cupsICCQualifier3: MainKeyword3
645 <p>The default mapping is as follows:
</p>
647 <pre class='command'
>
648 *cupsICCQualifier2: MediaType
649 *cupsICCQualifier3: Resolution
653 <h2 class='title'
><a name='I18N'
>Globalized PPD Support
</a></h2>
655 <p>CUPS
1.2 and higher adds support for PPD files containing multiple
656 languages by following the following additional rules:
</p>
660 <li>The
<tt>LanguageVersion
</tt> MUST be
<tt>English
</tt></li>
662 <li>The
<tt>LanguageEncoding
</tt> MUST be
<tt>ISOLatin1
</tt></li>
664 <li>The
<tt>cupsLanguages
</tt> attribute MUST be provided and
665 list each of the supported locales in the PPD file
</li>
667 <li>Main and option keywords MUST NOT exceed
34 (instead of
40)
668 characters to allow room for the locale prefixes in translation
671 <li>The main keyword
"Translation" MUST NOT be used
</li>
673 <li>Translation strings included with the main and option
674 keywords MUST NOT contain characters outside the ASCII
675 subset of ISOLatin1 and UTF-
8; developers wishing to use
676 characters outside ASCII MUST provide a separate set of
677 English localization attributes for the affected keywords.
</li>
679 <li>Localizations are specified using a locale prefix of
680 the form
"ll" or
"ll_CC." where
"ll" is the
2-letter ISO
681 language code and
"CC" is the
2-letter ISO country
683 <li>A generic language translation (
"ll") SHOULD be provided with country-specific differences (
"ll_CC") provided only as needed
</li>
684 <li>For historical reasons, the
"zh" and
"zh_CN" locales map to Simplified Chinese while the
"zh_TW" locale maps to Traditional Chinese
</li>
687 <li>Locale-specific translation strings MUST be encoded
690 <li>Main keywords MUST be localized using one of the
692 <p><tt>*ll.Translation MainKeyword/translation
694 <tt>*ll_CC.Translation MainKeyword/translation
695 text:
""</tt></p></li>
697 <li>Option keywords MUST be localized using one of the
699 <p><tt>*ll.MainKeyword OptionKeyword/translation
701 <tt>*ll_CC.MainKeyword OptionKeyword/translation
702 text:
""</tt></p></li>
704 <li>Localization attributes MAY appear anywhere after the
705 first line of the PPD file
</li>
709 <blockquote><b>Note:
</b>
710 We use a
<tt>LanguageEncoding
</tt> value of
<tt>ISOLatin1
</tt>
711 and limit the allowed base translation strings to ASCII to avoid
712 character coding issues that would otherwise occur. In addition,
713 requiring the base translation strings to be in English allows
714 for easier fallback translation when no localization is provided
715 in the PPD file for a given locale.
</blockquote>
719 <pre class='command'
>
720 *LanguageVersion: English
721 *LanguageEncoding: ISOLatin1
722 *cupsLanguages:
"de fr_CA"
723 *ModelName:
"Foobar Laser 9999"
725 <em>*% Localize ModelName for French and German
</em>
726 *fr_CA.Translation ModelName/La Foobar Laser
9999:
""
727 *de.Translation ModelName/Foobar LaserDrucken
9999:
""
729 *cupsIPPReason com.vendor-error/A serious error occurred:
"/help/com.vendor/error.html"
730 <em>*% Localize printer-state-reason for French and German
</em>
731 *fr_CA.cupsIPPReason com.vendor-error/Une erreur s
èrieuse s'est produite:
"/help/com.vendor/error.html"
732 *de.cupsIPPReason com.vendor-error/Eine ernste St
örung trat:
"/help/com.vendor/error.html"
736 *OpenUI *InputSlot/Paper Source: PickOne
737 *OrderDependency:
10 AnySetup *InputSlot
738 *DefaultInputSlot: Auto
739 <em>*% Localize InputSlot for French and German
</em>
740 *fr_CA.Translation InputSlot/Papier source:
""
741 *de.Translation InputSlot/Papiereinzug:
""
742 *InputSlot Auto/Default:
"<</ManualFeed false>>setpagedevice"
743 <em>*% Localize InputSlot=Auto for French and German
</em>
744 *fr_CA.InputSlot Auto/Par Defaut:
""
745 *de.InputSlot Auto/Standard:
""
746 *InputSlot Manual/Manual Feed:
"<</ManualFeed true>>setpagedevice"
747 <em>*% Localize InputSlot=Manual for French and German
</em>
748 *fr_CA.InputSlot Manual/Manuel mecanisme de alimentation:
""
749 *de.InputSlot Manual/Manueller Einzug:
""
754 <h2 class='title'
><a name='RASTERPS'
>Writing PostScript Option Commands for Raster Drivers
</a></h2>
756 <p>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:
</p>
758 <pre class='command'
>
759 *PageSize A4:
"<</PageSize[595 842]>>setpagedevice"
762 <p>Custom options typically use other operators to organize the values into a key/value dictionary for
<tt>setpagedevice
</tt>. For example, our previous
<tt>CustomWatermarkText
</tt> option code uses the
<tt>roll
</tt> operator to move the custom string value into the dictionary for
<tt>setpagedevice
</tt>:
</p>
764 <pre class='command'
>
765 *CustomWatermarkText True:
"<</cupsString1 3 -1 roll>>setpagedevice"
768 <p>For a custom string value of
"My Watermark", CUPS will produce the following PostScript code for the option:
</p>
770 <pre class='command'
>
772 <</cupsString1
3 -
1 roll
>>setpagedevice
775 <p>The code moves the string value (
"My Watermark") from the bottom of the stack to the top, creating a dictionary that looks like:
</p>
777 <pre class='command'
>
778 <</cupsString1(My Watermark)
>>setpagedevice
781 <p>The resulting dictionary sets the page device attributes that are sent to your raster driver in the page header.
</p>
783 <h3>Custom Page Size Code
</h3>
785 <p>There are many possible implementations of the
<tt>CustomPageSize
</tt> code. For CUPS raster drivers, the following code is recommended:
</p>
787 <pre class='command'
>
788 *ParamCustomPageSize Width:
1 points
<i>min-width max-width
</i>
789 *ParamCustomPageSize Height:
2 points
<i>min-height max-height
</i>
790 *ParamCustomPageSize WidthOffset:
3 points
0 0
791 *ParamCustomPageSize HeightOffset:
4 points
0 0
792 *ParamCustomPageSize Orientation:
5 int
0 0
793 *CustomPageSize True:
"pop pop pop <</PageSize[5 -2 roll]/ImagingBBox null>>setpagedevice"
796 <h3>Supported PostScript Operators
</h3>
798 <p>CUPS supports the following PostScript operators in addition to the usual PostScript number, string (literal and hex-encoded), boolean, null, and name values:
</p>
802 <li><tt><<</tt> - Start a dictionary.
</li>
804 <li><tt>>></tt> - End a dictionary.
</li>
806 <li><tt>[
</tt> - Start an array.
</li>
808 <li><tt>]
</tt> - End an array.
</li>
810 <li><tt>copy
</tt> - Copy the top N objects on the stack.
</li>
812 <li><tt>dup
</tt> - Copy the top object on the stack.
</li>
814 <li><tt>index
</tt> - Copy the Nth from the top object on the stack.
</li>
816 <li><tt>pop
</tt> - Pop the top object on the stack.
</li>
818 <li><tt>roll
</tt> - Shift the top N objects on the stack.
</li>
820 <li><tt>setpagedevice
</tt> - Set the page header values according to the key/value dictionary on the stack.
</li>
824 <blockquote><b>Note:
</b> <em>Never
<em> use the unsupported
<tt>dict
</tt> or
<tt>put
</tt> operators in your option code. These operators are typically used in option code dating back to Level
1 PostScript printers, which did not support the simpler
<tt><<</tt> or
<tt>>></tt> operators. If you have old option code using
<tt>dict
</tt> or
<tt>put
</tt>, you can rewrite it very easily to use the newer
<tt><<</tt> and
<tt>>></tt> operators instead. For example, the following code to set the page size:
826 <style type='text/css'
><!--
834 <pre class='command'
>
835 <b>1 dict dup
</b> /PageSize [
612 792]
<b>put
</b> setpagedevice
838 <p>can be rewritten as:
</p>
840 <pre class='command'
>
841 <b><<</b> /PageSize [
612 792]
<b>>></b> setpagedevice
846 <h3>Supported Page Device Attributes
</h3>
848 <p>Table
2 shows the supported page device attributes along with PostScript code examples.
</p>
851 <table summary='Supported Page Device Attributes'
>
852 <caption>Table
2:
<a name='TABLE_2'
>Supported Page Device Attributes
</a></caption>
863 <td><tt>AdvanceDistance
</tt></td>
865 <td>Specifies the number of points to advance roll media after printing.
</td>
866 <td><tt><</AdvanceDistance
18>>setpagedevice
</tt></td>
869 <td><tt>AdvanceMedia
</tt></td>
871 <td>Specifies when to advance the media:
0 = never,
1 = after the file,
2 = after the job,
3 = after the set, and
4 = after the page.
</td>
872 <td><tt><</AdvanceMedia
4>>setpagedevice
</tt></td>
875 <td><tt>Collate
</tt></td>
877 <td>Specifies whether collated copies are required.
</td>
878 <td><tt><</Collate true
>>setpagedevice
</tt></td>
881 <td><tt>CutMedia
</tt></td>
883 <td>Specifies when to cut the media:
0 = never,
1 = after the file,
2 = after the job,
3 = after the set, and
4 = after the page.
</td>
884 <td><tt><</CutMedia
1>>setpagedevice
</tt></td>
887 <td><tt>Duplex
</tt></td>
889 <td>Specifies whether
2-sided printing is required.
</td>
890 <td><tt><</Duplex true
>>setpagedevice
</tt></td>
893 <td><tt>HWResolution
</tt></td>
894 <td>Integer Array
</td>
895 <td>Specifies the resolution of the page image in pixels per inch.
</td>
896 <td><tt><</HWResolution[
1200 1200]
>>setpagedevice
</tt></td>
899 <td><tt>InsertSheet
</tt></td>
901 <td>Specifies whether to insert a blank sheet before the job.
</td>
902 <td><tt><</InsertSheet true
>>setpagedevice
</tt></td>
905 <td><tt>Jog
</tt></td>
907 <td>Specifies 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.
</td>
908 <td><tt><</Jog
2>>setpagedevice
</tt></td>
911 <td><tt>LeadingEdge
</tt></td>
913 <td>Specifies the leading edge of the media:
0 = top,
1 = right,
2 = bottom,
3 = left.
</td>
914 <td><tt><</LeadingEdge
0>>setpagedevice
</tt></td>
917 <td><tt>ManualFeed
</tt></td>
919 <td>Specifies whether media should be drawn from the manual feed tray. Note: The
<tt>MediaPosition
</tt> attribute is preferred over the
<tt>ManualFeed
</tt> attribute.
</td>
920 <td><tt><</ManualFeed true
>>setpagedevice
</tt></td>
923 <td><tt>MediaClass
</tt></td>
925 <td>Specifies a named media.
</td>
926 <td><tt><</MediaClass (Invoices)
>>setpagedevice
</tt></td>
929 <td><tt>MediaColor
</tt></td>
931 <td>Specifies the color of the media.
</td>
932 <td><tt><</MediaColor
>>setpagedevice
</tt></td>
935 <td><tt>MediaPosition
</tt></td>
937 <td>Specifies the tray or source of the media.
</td>
938 <td><tt><</MediaPosition
12>>setpagedevice
</tt></td>
941 <td><tt>MediaType
</tt></td>
943 <td>Specifies the general media type.
</td>
944 <td><tt><</MediaType (Glossy)
>>setpagedevice
</tt></td>
947 <td><tt>MediaWeight
</tt></td>
949 <td>Specifies the media weight in grams per meter
<sup>2</sup>.
</td>
950 <td><tt><</MediaWeight
100>>setpagedevice
</tt></td>
953 <td><tt>MirrorPrint
</tt></td>
955 <td>Specifies whether to flip the output image horizontally.
</td>
956 <td><tt><</MirrorPrint true
>>setpagedevice
</tt></td>
959 <td><tt>NegativePrint
</tt></td>
961 <td>Specifies whether to invert the output image.
</td>
962 <td><tt><</NegativePrint true
>>setpagedevice
</tt></td>
965 <td><tt>NumCopies
</tt></td>
967 <td>Specifies the number of copies to produce of each page.
</td>
968 <td><tt><</NumCopies
100>>setpagedevice
</tt></td>
971 <td><tt>Orientation
</tt></td>
973 <td>Specifies the orientation of the output:
0 = portrait,
1 = landscape rotated counter-clockwise,
2 = upside-down,
3 = landscape rotated clockwise.
</td>
974 <td><tt><</Orientation
3>>setpagedevice
</tt></td>
977 <td><tt>OutputFaceUp
</tt></td>
979 <td>Specifies whether to place the media face-up in the output bin/tray.
</td>
980 <td><tt><</OutputFaceUp true
>>setpagedevice
</tt></td>
983 <td><tt>OutputType
</tt></td>
985 <td>Specifies the output type name.
</td>
986 <td><tt><</OutputType (Photo)
>>setpagedevice
</tt></td>
989 <td><tt>PageSize
</tt></td>
990 <td>Integer/Real Array
</td>
991 <td>Specifies the width and length/height of the page in points.
</td>
992 <td><tt><</PageSize[
595 842]
>>setpagedevice
</tt></td>
995 <td><tt>Separations
</tt></td>
997 <td>Specifies whether to produce color separations.
</td>
998 <td><tt><</Separations true
>>setpagedevice
</tt></td>
1001 <td><tt>TraySwitch
</tt></td>
1003 <td>Specifies whether to switch trays automatically.
</td>
1004 <td><tt><</TraySwitch true
>>setpagedevice
</tt></td>
1007 <td><tt>Tumble
</tt></td>
1009 <td>Specifies whether the back sides of pages are rotated
180 degrees.
</td>
1010 <td><tt><</Tumble true
>>setpagedevice
</tt></td>
1013 <td><tt>cupsBorderlessScalingFactor
</tt></td>
1015 <td>Specifies the amount to scale the page image dimensions.
</td>
1016 <td><tt><</cupsBorderlessScalingFactor
1.01>>setpagedevice
</tt></td>
1019 <td><tt>cupsColorOrder
</tt></td>
1021 <td>Specifies the order of colors:
0 = chunked,
1 = banded,
2 = planar.
</td>
1022 <td><tt><</cupsColorOrder
0>>setpagedevice
</tt></td>
1025 <td><tt>cupsColorSpace
</tt></td>
1027 <td>Specifies 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)
</td>
1028 <td><tt><</cupsColorSpace
>>setpagedevice
</tt></td>
1031 <td><tt>cupsCompression
</tt></td>
1033 <td>Specifies a driver compression type/mode.
</td>
1034 <td><tt><</cupsCompression
2>>setpagedevice
</tt></td>
1037 <td><tt>cupsInteger0
<br>
1039 cupsInteger15
</tt></td>
1041 <td>Specifies driver integer values.
</td>
1042 <td><tt><</cupsInteger11
1234>>setpagedevice
</tt></td>
1045 <td><tt>cupsMarkerType
</tt></td>
1047 <td>Specifies the type of ink/toner to use.
</td>
1048 <td><tt><</cupsMarkerType (Black+Color)
>>setpagedevice
</tt></td>
1051 <td><tt>cupsMediaType
</tt></td>
1053 <td>Specifies a numeric media type.
</td>
1054 <td><tt><</cupsMediaType
999>>setpagedevice
</tt></td>
1057 <td><tt>cupsPageSizeName
</tt></td>
1059 <td>Specifies the name of the page size.
</td>
1060 <td><tt><</cupsPageSizeName (A4.Full)
>>setpagedevice
</tt></td>
1063 <td><tt>cupsPreferredBitsPerColor
</tt></td>
1065 <td>Specifies the preferred number of bits per color, typically
8 or
16.
</td>
1066 <td><tt><</cupsPreferredBitsPerColor
16>>setpagedevice
</tt></td>
1069 <td><tt>cupsReal0
<br>
1071 cupsReal15
</tt></td>
1073 <td>Specifies driver real number values.
</td>
1074 <td><tt><</cupsReal15
1.234>>setpagedevice
</tt></td>
1077 <td><tt>cupsRenderingIntent
</tt></td>
1079 <td>Specifies the color rendering intent.
</td>
1080 <td><tt><</cupsRenderingIntent (AbsoluteColorimetric)
>>setpagedevice
</tt></td>
1083 <td><tt>cupsRowCount
</tt></td>
1085 <td>Specifies the number of rows of raster data to print on each line for some drivers.
</td>
1086 <td><tt><</cupsRowCount
24>>setpagedevice
</tt></td>
1089 <td><tt>cupsRowFeed
</tt></td>
1091 <td>Specifies the number of rows to feed between passes for some drivers.
</td>
1092 <td><tt><</cupsRowFeed
17>>setpagedevice
</tt></td>
1095 <td><tt>cupsRowStep
</tt></td>
1097 <td>Specifies the number of lines between columns/rows on the print head for some drivers.
</td>
1098 <td><tt><</cupsRowStep
2>>setpagedevice
</tt></td>
1101 <td><tt>cupsString0
<br>
1103 cupsString15
</tt></td>
1105 <td>Specifies driver string values.
</td>
1106 <td><tt><</cupsString0(String Value)
>>setpagedevice
</tt></td>
1112 <h2 class='title'
><a name='HISTORY'
>Change History
</a></h2>
1114 <h3>Changes in CUPS
1.3</h3>
1118 <li>Added
<tt>APPrinterPreset
</tt>,
<tt>cupsIPPFinishings
</tt>, and
<tt>cupsPreFilter
</tt> attributes.
</li>
1120 <li>Added discussion of custom option code, sample
<tt>CustomPageSize
</tt> code, and
"do not use dict and put" note.
</li>
1124 <h3>Changes in CUPS
1.2.8</h3>
1128 <li>Added section on supported PostScript commands for raster
1133 <h3>Changes in CUPS
1.2</h3>
1137 <li>Added globalization support attributes
</li>
1139 <li>Added custom option values support
</li>
1141 <li>Added
<tt>APBookFile
</tt> attribute
</li>
1143 <li>Added
<tt>APDuplexRequiresFlippedMargin
</tt> attribute
</li>
1145 <li>Added
<tt>cupsICCProfile
</tt> attribute
</li>
1147 <li>Added
<tt>cupsIPPReason
</tt> attribute
</li>
1149 <li>Added
<tt>cupsLanguages
</tt> attribute
</li>
1151 <li>Added
<tt>cupsPortMonitor
</tt> attribute
</li>
1153 <li>Removed
<tt>cupsProtocol
</tt> attribute
</li>
1157 <h3>Changes in CUPS
1.1</h3>
1161 <li>Added
<tt>cupsFlipDuplex
</tt> attribute
</li>
1163 <li>Added
<tt>cupsProtocol
</tt> attribute
</li>