• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!DOCTYPE html>
2<html lang="en-US">
3<!-- SECTION: Programming -->
4<head>
5<title>Introduction to the PPD Compiler</title>
6<meta name="keywords" content="Programming">
7<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
8<meta name="generator" content="codedoc v3.7">
9<meta name="author" content="Unknown">
10<meta name="language" content="en-US">
11<meta name="copyright" content="Unknown">
12<meta name="version" content="0.0">
13<style type="text/css"><!--
14body {
15  background: white;
16  color: black;
17  font-family: sans-serif;
18  font-size: 12pt;
19}
20a {
21  color: black;
22}
23a:link, a:visited {
24  color: #00f;
25}
26a:link:hover, a:visited:hover, a:active {
27  color: #c0c;
28}
29body, p, h1, h2, h3, h4, h5, h6 {
30  font-family: sans-serif;
31  line-height: 1.4;
32}
33h1, h2, h3, h4, h5, h6 {
34  font-weight: bold;
35  page-break-inside: avoid;
36}
37h1 {
38  font-size: 250%;
39  margin: 0;
40}
41h2 {
42  font-size: 250%;
43  margin-top: 1.5em;
44}
45h3 {
46  font-size: 200%;
47  margin-bottom: 0.5em;
48  margin-top: 1.5em;
49}
50h4 {
51  font-size: 150%;
52  margin-bottom: 0.5em;
53  margin-top: 1.5em;
54}
55h5 {
56  font-size: 125%;
57  margin-bottom: 0.5em;
58  margin-top: 1.5em;
59}
60h6 {
61  font-size: 110%;
62  margin-bottom: 0.5em;
63  margin-top: 1.5em;
64}
65img.title {
66  width: 256px;
67}
68div.header h1, div.header p {
69  text-align: center;
70}
71div.contents, div.body, div.footer {
72  page-break-before: always;
73}
74.class, .enumeration, .function, .struct, .typedef, .union {
75  border-bottom: solid 2px gray;
76}
77.description {
78  margin-top: 0.5em;
79}
80.function {
81  margin-bottom: 0;
82}
83blockquote {
84  border: solid thin gray;
85  box-shadow: 3px 3px 5px rgba(127,127,127,0.25);
86  margin: 1em 0;
87  padding: 10px;
88  page-break-inside: avoid;
89}
90p code, li code, p.code, pre, ul.code li {
91  font-family: monospace;
92  hyphens: manual;
93  -webkit-hyphens: manual;
94}
95p.code, pre, ul.code li {
96  background: rgba(127,127,127,0.25);
97  border: thin dotted gray;
98  padding: 10px;
99  page-break-inside: avoid;
100}
101pre {
102  white-space: pre-wrap;
103}
104a:link, a:visited {
105  text-decoration: none;
106}
107span.info {
108  background: black;
109  border: solid thin black;
110  color: white;
111  font-size: 80%;
112  font-style: italic;
113  font-weight: bold;
114  white-space: nowrap;
115}
116h1 span.info, h2 span.info, h3 span.info, h4 span.info {
117  border-top-left-radius: 10px;
118  border-top-right-radius: 10px;
119  float: right;
120  padding: 3px 6px;
121}
122ul.code, ul.contents, ul.subcontents {
123  list-style-type: none;
124  margin: 0;
125  padding-left: 0;
126}
127ul.code li {
128  margin: 0;
129}
130ul.contents > li {
131  margin-top: 1em;
132}
133ul.contents li ul.code, ul.contents li ul.subcontents {
134  padding-left: 2em;
135}
136table {
137  border-collapse: collapse;
138  border-spacing: 0;
139}
140td {
141  border: solid 1px gray;
142  padding: 5px 10px;
143  vertical-align: top;
144}
145td.left {
146  text-align: left;
147}
148td.center {
149  text-align: center;
150}
151td.right {
152  text-align: right;
153}
154th {
155  border-bottom: solid 2px gray;
156  padding: 1px 5px;
157  text-align: center;
158  vertical-align: bottom;
159}
160tr:nth-child(even) {
161  background: rgba(127,127,127,0.25);
162}
163table.list {
164  border-collapse: collapse;
165  width: 100%;
166}
167table.list th {
168  border-bottom: none;
169  border-right: 2px solid gray;
170  font-family: monospace;
171  font-weight: normal;
172  padding: 5px 10px 5px 2px;
173  text-align: right;
174  vertical-align: top;
175}
176table.list td {
177  border: none;
178  padding: 5px 2px 5px 10px;
179  text-align: left;
180  vertical-align: top;
181}
182h2.title, h3.title {
183  border-bottom: solid 2px gray;
184}
185/* Syntax highlighting */
186span.comment {
187  color: darkgreen;
188}
189span.directive {
190  color: purple;
191}
192span.number {
193  color: brown;
194}
195span.reserved {
196  color: darkcyan;
197}
198span.string {
199  color: magenta;
200}
201/* Dark mode overrides */
202@media (prefers-color-scheme: dark) {
203  body {
204    background: black;
205    color: #ccc;
206  }
207  a {
208    color: #ccc;
209  }
210  a:link, a:visited {
211    color: #66f;
212  }
213  a:link:hover, a:visited:hover, a:active {
214    color: #f06;
215  }
216}
217/* Show contents on left side in web browser */
218@media screen and (min-width: 800px) {
219  div.contents {
220    border-right: solid thin gray;
221    bottom: 0px;
222    box-shadow: 3px 3px 5px rgba(127,127,127,0.5);
223    font-size: 10pt;
224    left: 0px;
225    overflow: scroll;
226    padding: 1%;
227    position: fixed;
228    top: 0px;
229    width: 18%;
230  }
231  div.contents h2.title {
232    margin-top: 0px;
233  }
234  div.header, div.body, div.footer {
235    margin-left: 20%;
236    padding: 1% 2%;
237  }
238}
239/* Center title page content vertically */
240@media print {
241  div.header {
242    padding-top: 33%;
243  }
244}
245--></style>
246</head>
247<body>
248<div class="header">
249<!--
250  PPD compiler documentation for CUPS.
251
252  Copyright © 2020-2024 by OpenPrinting.
253  Copyright © 2007-2012 by Apple Inc.
254  Copyright © 1997-2007 by Easy Software Products.
255
256  Licensed under Apache License v2.0.  See the file "LICENSE" for more
257  information.
258-->
259
260<h1 class='title'>Introduction to the PPD Compiler</h1>
261
262<P>This document describes how to use the CUPS PostScript Printer Description
263(PPD) file compiler. The PPD compiler generates PPD files from simple text files
264that describe the features and capabilities of one or more printers.</P>
265
266<BLOCKQUOTE><B>Note:</B>
267
268<P>The PPD compiler and related tools are deprecated and will be removed in a future release of CUPS.</P>
269
270</BLOCKQUOTE>
271
272<div class='summary'><table summary='General Information'>
273<tbody>
274<tr>
275	<th>See Also</th>
276	<td>Programming: <a href='raster-driver.html'>Developing Raster Printer Drivers</a><br>
277	Programming: <a href='postscript-driver.html'>Developing PostScript Printer Drivers</a><br>
278	Programming: <a href='api-filter.html'>Filter and Backend Programming</a><br>
279	Programming: <a href='api-raster.html'>Raster API</a><br>
280	References: <a href='ref-ppdcfile.html'>PPD Compiler Driver Information File Reference</a><br>
281	Specifications: <a href='spec-ppd.html'>CUPS PPD Extensions</a></td>
282</tr>
283</tbody>
284</table></div>
285</div>
286<div class="contents">
287<h2 class="title">Contents</h2>
288<ul class="contents">
289<li><a href="#BASICS">The Basics</a></li>
290<li><a href="#DRV">Driver Information Files</a><ul class="subcontents">
291<li><a href="#SIMPLE">A Simple Example</a></li>
292<li><a href="#GROUPING">Grouping and Inheritance</a></li>
293<li><a href="#COLOR">Color Support</a></li>
294<li><a href="#OPTIONS">Defining Custom Options and Option Groups</a></li>
295<li><a href="#DEFINE">Defining Constants</a></li>
296<li><a href="#CONDITIONAL">Conditional Statements</a></li>
297<li><a href="#CONSTRAINTS">Defining Constraints</a></li>
298</ul></li>
299<li><a href="#LOCALIZATION">Localization</a><ul class="subcontents">
300<li><a href="#PPDPO">The ppdpo Utility</a></li>
301<li><a href="#PPDC_CATALOG">Using Message Catalogs with the PPD Compiler</a></li>
302</ul></li>
303</ul>
304</div>
305<div class="body">
306<h2 class='title'><a name='BASICS'>The Basics</a></h2>
307
308<P>The PPD compiler, <a href='man-ppdc.html'><code>ppdc(1)</code></a>, is a
309simple command-line tool that takes a single <I>driver information file</I>,
310which by convention uses the extension <VAR>.drv</VAR>, and produces one or more
311PPD files that may be distributed with your printer drivers for use with CUPS.
312For example, you would run the following command to create the English language
313PPD files defined by the driver information file <VAR>mydrivers.drv</VAR>:</P>
314
315<pre class='command'>
316ppdc mydrivers.drv
317</pre>
318
319<P>The PPD files are placed in a subdirectory called
320<VAR>ppd</VAR>. The <TT>-d</TT> option is used to put the PPD
321files in a different location, for example:</p>
322
323<pre class='command'>
324ppdc -d myppds mydrivers.drv
325</pre>
326
327<P>places the PPD files in a subdirectory named
328<VAR>myppds</VAR>. Finally, use the <TT>-l</TT> option to
329specify the language localization for the PPD files that are
330created, for example:</P>
331
332<pre class='command'>
333ppdc -d myppds/de -l de mydrivers.drv
334ppdc -d myppds/en -l en mydrivers.drv
335ppdc -d myppds/es -l es mydrivers.drv
336ppdc -d myppds/fr -l fr mydrivers.drv
337ppdc -d myppds/it -l it mydrivers.drv
338</pre>
339
340<P>creates PPD files in German (de), English (en), Spanish (es),
341French (fr), and Italian (it) in the corresponding
342subdirectories. Specify multiple languages (separated by commas) to produce
343"globalized" PPD files:</p>
344
345<pre class='command'>
346ppdc -d myppds -l de,en,es,fr,it mydrivers.drv
347</pre>
348
349
350<h2 class='title'><a name='DRV'>Driver Information Files</a></h2>
351
352<P>The driver information files accepted by the PPD compiler are
353plain text files that define the various attributes and options
354that are included in the PPD files that are generated. A driver
355information file can define the information for one or more printers and
356their corresponding PPD files.</P>
357
358<p class='example'><a name="LISTING1">Listing 1: "examples/minimum.drv"</a></p>
359
360<pre class='example'>
361<I>// Include standard font and media definitions</I>
362<a href='ref-ppdcfile.html#_include'>#include</a> &lt;font.defs&gt;
363<a href='ref-ppdcfile.html#_include'>#include</a> &lt;media.defs&gt;
364
365<I>// List the fonts that are supported, in this case all standard fonts...</I>
366<a href='ref-ppdcfile.html#Font'>Font</a> *
367
368<I>// Manufacturer, model name, and version</I>
369<a href='ref-ppdcfile.html#Manufacturer'>Manufacturer</a> "Foo"
370<a href='ref-ppdcfile.html#ModelName'>ModelName</a> "FooJet 2000"
371<a href='ref-ppdcfile.html#Version'>Version</a> 1.0
372
373<I>// Each filter provided by the driver...</I>
374<a href='ref-ppdcfile.html#Filter'>Filter</a> application/vnd.cups-raster 100 rastertofoo
375
376<I>// Supported page sizes</I>
377*<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> Letter
378<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> A4
379
380<I>// Supported resolutions</I>
381*<a href='ref-ppdcfile.html#Resolution'>Resolution</a> k 8 0 0 0 "600dpi/600 DPI"
382
383<I>// Specify the name of the PPD file we want to generate...</I>
384<a href='ref-ppdcfile.html#PCFileName'>PCFileName</a> "foojet2k.ppd"
385</pre>
386
387
388<h3><a name='SIMPLE'>A Simple Example</a></h3>
389
390<P>The example in <A HREF="#LISTING1">Listing 1</A> shows a driver information
391file which defines the minimum required attributes to provide a valid PPD file.
392The first part of the file includes standard definition files for fonts and
393media sizes:</P>
394
395<pre class='example'>
396<a href='ref-ppdcfile.html#_include'>#include</a> &lt;font.defs&gt;
397<a href='ref-ppdcfile.html#_include'>#include</a> &lt;media.defs&gt;
398</pre>
399
400<P>The <TT>#include</TT> directive works just like the C/C++ include directive;
401files included using the angle brackets (<TT>&lt;filename&gt;</TT>) are found
402in any of the standard include directories and files included using quotes
403(<TT>"filename"</TT>) are found in the same directory as the source or include
404file. The <TT>&lt;font.defs&gt;</TT> include file defines the standard fonts
405which are included with GPL Ghostscript and the Apple PDF RIP, while the
406<TT>&lt;media.defs&gt;</TT> include file defines the standard media sizes
407listed in Appendix B of the Adobe PostScript Printer Description File Format
408Specification.</P>
409
410<P>CUPS provides several other standard include files:</P>
411
412<UL>
413
414	<LI><TT>&lt;epson.h&gt;</TT> - Defines all of the rastertoepson driver
415	constants.</LI>
416
417	<LI><TT>&lt;escp.h&gt;</TT> - Defines all of the rastertoescpx driver
418	constants.</LI>
419
420	<LI><TT>&lt;hp.h&gt;</TT> - Defines all of the rastertohp driver
421	constants.</LI>
422
423	<LI><TT>&lt;label.h&gt;</TT> - Defines all of the rastertolabel driver
424	constants.</LI>
425
426	<LI><TT>&lt;pcl.h&gt;</TT> - Defines all of the rastertopclx driver
427	constants.</LI>
428
429	<LI><TT>&lt;raster.defs&gt;</TT> - Defines all of the CUPS raster format
430	constants.</LI>
431
432</UL>
433
434<P>Next we list all of the fonts that are available in the driver; for CUPS
435raster drivers, the following line is all that is usually supplied:</P>
436
437<pre class='example'>
438<a href='ref-ppdcfile.html#Font'>Font</a> *
439</pre>
440
441<P>The <TT>Font</TT> directive specifies the name of a single font or the
442asterisk to specify all fonts. For example, you would use the following line to
443define an additional bar code font that you are supplying with your printer
444driver:</P>
445
446<pre class='example'>
447<I>//   name         encoding  version  charset  status</I>
448<a href='ref-ppdcfile.html#Font'>Font</a> Barcode-Foo  Special   "(1.0)"  Special  ROM
449</pre>
450
451<P>The name of the font is <TT>Barcode-Foo</TT>. Since it is not a standard
452text font, the encoding and charset name <TT>Special</TT> is used. The version
453number is <TT>1.0</TT> and the status (where the font is located) is
454<TT>ROM</TT> to indicate that the font does not need to be embedded in
455documents that use the font for this printer.</P>
456
457<P>Third comes the manufacturer, model name, and version number information
458strings:</P>
459
460<pre class='example'>
461<a href='ref-ppdcfile.html#Manufacturer'>Manufacturer</a> "Foo"
462<a href='ref-ppdcfile.html#ModelName'>ModelName</a> "FooJet 2000"
463<a href='ref-ppdcfile.html#Version'>Version</a> 1.0
464</pre>
465
466<P>These strings are used when the user (or auto-configuration program) selects
467the printer driver for a newly connected device.</p>
468
469<P>The list of filters comes after the information strings; for the example in
470<A HREF="#LISTING1">Listing 1</A>, we have a single filter that takes CUPS
471raster data:</P>
472
473<pre class='example'>
474<a href='ref-ppdcfile.html#Filter'>Filter</a> application/vnd.cups-raster 100 rastertofoo
475</pre>
476
477<P>Each filter specified in the driver information file is the equivalent of a
478printer driver for that format; if a user submits a print job in a different
479format, CUPS figures out the sequence of commands that will produce a supported
480format for the least relative cost.</P>
481
482<P>Once we have defined the driver information we specify the supported options.
483For the example driver we support a single resolution of 600 dots per inch and
484two media sizes, A4 and Letter:</P>
485
486<pre class='example'>
487*<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> Letter
488<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> A4
489
490*<a href='ref-ppdcfile.html#Resolution'>Resolution</a> k 8 0 0 0 "600dpi/600 DPI"
491</pre>
492
493<P>The asterisk in front of the <TT>MediaSize</TT> and <TT>Resolution</TT>
494directives specify that those option choices are the default. The
495<TT>MediaSize</TT> directive is followed by a media size name which is normally
496defined in the <TT>&lt;media.defs&gt;</TT> file and corresponds to a standard
497Adobe media size name. If the default media size is <TT>Letter</TT>, the PPD
498compiler will override it to be <TT>A4</TT> for non-English localizations for
499you automatically.</P>
500
501<P>The <TT>Resolution</TT> directive accepts several values after it as
502follows:</P>
503
504<OL>
505
506	<LI>Colorspace for this resolution, if any. In the example file, the
507	colorspace <TT>k</TT> is used which corresponds to black. For printer
508	drivers that support color printing, this field is usually specified as
509	"-" for "no change".</LI>
510
511	<LI>Bits per color. In the example file, we define 8 bits per color, for
512	a continuous-tone grayscale output. All versions of CUPS support 1 and
513	8 bits per color.  CUPS 1.2 and higher (macOS 10.5 and higher) also
514	supports 16 bits per color.</LI>
515
516	<LI>Rows per band. In the example file, we define 0 rows per band to
517	indicate that our printer driver does not process the page in
518	bands.</LI>
519
520	<LI>Row feed. In the example, we define the feed value to be 0 to
521	indicate that our printer driver does not interleave the output.</LI>
522
523	<LI>Row step. In the example, we define the step value to be 0 to
524	indicate that our printer driver does not interleave the output. This
525	value normally indicates the spacing between the nozzles of an inkjet
526	printer - when combined with the previous two values, it informs the
527	driver how to stagger the output on the page to produce interleaved
528	lines on the page for higher-resolution output.</LI>
529
530	<LI>Choice name and text. In the example, we define the choice name and
531	text to be <TT>"600dpi/600 DPI"</TT>. The name and text are separated by
532	slash (<TT>/</TT>) character; if no text is specified, then the name is
533	used as the text. The PPD compiler parses the name to determine the
534	actual resolution; the name can be of the form
535	<TT><I>RESOLUTION</I>dpi</TT> for resolutions that are equal
536	horizontally and vertically or <TT><I>HRES</I>x<I>VRES</I>dpi</TT> for
537	isometric resolutions. Only integer resolution values are supported, so
538	a resolution name of <TT>300dpi</TT> is valid while <TT>300.1dpi</TT> is
539	not.</LI>
540
541</OL>
542
543<P>Finally, the <TT>PCFileName</TT> directive specifies that the named PPD file
544should be written for the current driver definitions:</P>
545
546<pre class='example'>
547<a href='ref-ppdcfile.html#PCFileName'>PCFileName</a> "foojet2k.ppd"
548</pre>
549
550<P>The filename follows the directive and <I>must</I> conform to the Adobe
551filename requirements in the Adobe Postscript Printer Description File Format
552Specification. Specifically, the filename may not exceed 8 characters followed
553by the extension <VAR>.ppd</VAR>. The <TT>FileName</TT> directive can be used to
554specify longer filenames:</P>
555
556<pre class='example'>
557<a href='ref-ppdcfile.html#FileName'>FileName</a> "FooJet 2000"
558</pre>
559
560
561<h3><a name='GROUPING'>Grouping and Inheritance</a></h3>
562
563<P>The previous example created a single PPD file. Driver information files can
564also define multiple printers by using the PPD compiler grouping functionality.
565Directives are grouped using the curly braces (<TT>{</TT> and <TT>}</TT>) and
566every group that uses the <TT>PCFileName</TT> or <TT>FileName</TT> directives
567produces a PPD file with that name. <A HREF="#LISTING2">Listing 2</A> shows a
568variation of the original example that uses two groups to define two printers
569that share the same printer driver filter but provide two different resolution
570options.</P>
571
572<p class='example'><a name="LISTING2">Listing 2: "examples/grouping.drv"</a></p>
573
574<pre class='example'>
575
576<I>// Include standard font and media definitions</I>
577<a href='ref-ppdcfile.html#_include'>#include</a> &lt;font.defs&gt;
578<a href='ref-ppdcfile.html#_include'>#include</a> &lt;media.defs&gt;
579
580<I>// List the fonts that are supported, in this case all standard fonts...</I>
581<a href='ref-ppdcfile.html#Font'>Font</a> *
582
583<I>// Manufacturer and version</I>
584<a href='ref-ppdcfile.html#Manufacturer'>Manufacturer</a> "Foo"
585<a href='ref-ppdcfile.html#Version'>Version</a> 1.0
586
587<I>// Each filter provided by the driver...</I>
588<a href='ref-ppdcfile.html#Filter'>Filter</a> application/vnd.cups-raster 100 rastertofoo
589
590<I>// Supported page sizes</I>
591*<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> Letter
592<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> A4
593
594{
595  <I>// Supported resolutions</I>
596  *<a href='ref-ppdcfile.html#Resolution'>Resolution</a> k 8 0 0 0 "600dpi/600 DPI"
597
598  <I>// Specify the model name and filename...</I>
599  <a href='ref-ppdcfile.html#ModelName'>ModelName</a> "FooJet 2000"
600  <a href='ref-ppdcfile.html#PCFileName'>PCFileName</a> "foojet2k.ppd"
601}
602
603{
604  <I>// Supported resolutions</I>
605  *<a href='ref-ppdcfile.html#Resolution'>Resolution</a> k 8 0 0 0 "1200dpi/1200 DPI"
606
607  <I>// Specify the model name and filename...</I>
608  <a href='ref-ppdcfile.html#ModelName'>ModelName</a> "FooJet 2001"
609  <a href='ref-ppdcfile.html#PCFileName'>PCFileName</a> "foojt2k1.ppd"
610}
611</pre>
612
613<P>The second example is essentially the same as the first, except that each
614printer model is defined inside of a pair of curly braces. For example, the
615first printer is defined using:</P>
616
617<pre class='example'>
618{
619  // Supported resolutions
620  *<a href='ref-ppdcfile.html#Resolution'>Resolution</a> k 8 0 0 0 "600dpi/600 DPI"
621
622  // Specify the model name and filename...
623  <a href='ref-ppdcfile.html#ModelName'>ModelName</a> "FooJet 2000"
624  <a href='ref-ppdcfile.html#PCFileName'>PCFileName</a> "foojet2k.ppd"
625}
626</pre>
627
628<P>The printer <I>inherits</I> all of the definitions from the parent group (the
629top part of the file) and adds the additional definitions inside the curly
630braces for that printer driver. When we define the second group, it also
631inherits the same definitions from the parent group but <I>none</I> of the
632definitions from the first driver. Groups can be nested to any number of levels
633to support variations of similar models without duplication of information.</P>
634
635
636<h3><a name='COLOR'>Color Support</a></h3>
637
638<P>For printer drivers that support color printing, the
639<TT>ColorDevice</TT> and <TT>ColorModel</TT> directives should be
640used to tell the printing system that color output is desired
641and in what formats. <A HREF="#LISTING3">Listing 3</A> shows a
642variation of the previous example which includes a color printer
643that supports printing at 300 and 600 DPI.</P>
644
645<P>The key changes are the addition of the <TT>ColorDevice</TT>
646directive:</P>
647
648<pre class='example'>
649<a href='ref-ppdcfile.html#ColorDevice'>ColorDevice</a> true
650</pre>
651
652<P>which tells the printing system that the printer supports
653color printing, and the <TT>ColorModel</TT> directives:</P>
654
655<pre class='example'>
656<a href='ref-ppdcfile.html#ColorModel'>ColorModel</a> Gray/Grayscale w chunky 0
657*<a href='ref-ppdcfile.html#ColorModel'>ColorModel</a> RGB/Color rgb chunky 0
658</pre>
659
660<P>which tell the printing system which colorspaces are supported by the printer
661driver for color printing. Each of the <TT>ColorModel</TT> directives is
662followed by the option name and text (<TT>Gray/Grayscale</TT> and
663<TT>RGB/Color</TT>), the colorspace name (<TT>w</TT> and <TT>rgb</TT>), the
664color organization (<TT>chunky</TT>), and the compression mode number
665(<TT>0</TT>) to be passed to the driver. The option name can be any of the
666standard Adobe <TT>ColorModel</TT> names:</P>
667
668<UL>
669
670	<LI><TT>Gray</TT> - Grayscale output.
671
672	<LI><TT>RGB</TT> - Color output, typically using the RGB
673	colorspace, but without a separate black channel.
674
675	<LI><TT>CMYK</TT> - Color output with a separate black
676	channel.
677
678</UL>
679
680<P>Custom names can be used, however it is recommended that you use your vendor
681prefix for any custom names, for example "fooName".</P>
682
683<P>The colorspace name can be any of the following universally supported
684colorspaces:</P>
685
686<UL>
687	<LI><TT>w</TT> - Luminance</LI>
688
689	<LI><TT>rgb</TT> - Red, green, blue</LI>
690
691	<LI><TT>k</TT> - Black</LI>
692
693	<LI><TT>cmy</TT> - Cyan, magenta, yellow</LI>
694
695	<LI><TT>cmyk</TT> - Cyan, magenta, yellow, black</LI>
696
697</UL>
698
699<P>The color organization can be any of the following values:</P>
700
701<UL>
702
703	<LI><TT>chunky</TT> - Color values are passed together on a line
704	as RGB RGB RGB RGB</LI>
705
706	<LI><TT>banded</TT> - Color values are passed separately
707	on a line as RRRR GGGG BBBB; not supported by the Apple
708	RIP filters</LI>
709
710	<LI><TT>planar</TT> - Color values are passed separately
711	on a page as RRRR RRRR RRRR ... GGGG GGGG GGGG ... BBBB
712	BBBB BBBB; not supported by the Apple RIP filters</LI>
713
714</UL>
715
716<P>The compression mode value is passed to the driver in the
717<TT>cupsCompression</TT> attribute. It is traditionally used to select an
718appropriate compression mode for the color model but can be used for any
719purpose, such as specifying a photo mode vs. standard mode.</P>
720
721<p class='example'><a name="LISTING3">Listing 3: "examples/color.drv"</a></p>
722
723<pre class='example'>
724
725<I>// Include standard font and media definitions</I>
726<a href='ref-ppdcfile.html#_include'>#include</a> &lt;font.defs&gt;
727<a href='ref-ppdcfile.html#_include'>#include</a> &lt;media.defs&gt;
728
729<I>// List the fonts that are supported, in this case all standard fonts...</I>
730<a href='ref-ppdcfile.html#Font'>Font</a> *
731
732<I>// Manufacturer and version</I>
733<a href='ref-ppdcfile.html#Manufacturer'>Manufacturer</a> "Foo"
734<a href='ref-ppdcfile.html#Version'>Version</a> 1.0
735
736<I>// Each filter provided by the driver...</I>
737<a href='ref-ppdcfile.html#Filter'>Filter</a> application/vnd.cups-raster 100 rastertofoo
738
739<I>// Supported page sizes</I>
740*<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> Letter
741<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> A4
742
743{
744  <I>// Supported resolutions</I>
745  *<a href='ref-ppdcfile.html#Resolution'>Resolution</a> k 8 0 0 0 "600dpi/600 DPI"
746
747  <I>// Specify the model name and filename...</I>
748  <a href='ref-ppdcfile.html#ModelName'>ModelName</a> "FooJet 2000"
749  <a href='ref-ppdcfile.html#PCFileName'>PCFileName</a> "foojet2k.ppd"
750}
751
752{
753  <I>// Supports color printing</I>
754  <a href='ref-ppdcfile.html#ColorDevice'>ColorDevice</a> true
755
756  <I>// Supported colorspaces</I>
757  <a href='ref-ppdcfile.html#ColorModel'>ColorModel</a> Gray/Grayscale w chunky 0
758  *<a href='ref-ppdcfile.html#ColorModel'>ColorModel</a> RGB/Color rgb chunky 0
759
760  <I>// Supported resolutions</I>
761  *<a href='ref-ppdcfile.html#Resolution'>Resolution</a> - 8 0 0 0 "300dpi/300 DPI"
762  <a href='ref-ppdcfile.html#Resolution'>Resolution</a> - 8 0 0 0 "600dpi/600 DPI"
763
764  <I>// Specify the model name and filename...</I>
765  <a href='ref-ppdcfile.html#ModelName'>ModelName</a> "FooJet Color"
766  <a href='ref-ppdcfile.html#PCFileName'>PCFileName</a> "foojetco.ppd"
767}
768</pre>
769
770
771<h3><a name='OPTIONS'>Defining Custom Options and Option Groups</a></h3>
772
773<P>The <TT>Group</TT>, <TT>Option</TT>, and <TT>Choice</TT>
774directives are used to define or select a group, option, or
775choice. <A HREF="#LISTING4">Listing 4</A> shows a variation of
776the first example that provides two custom options in a group
777named "Footasm".</P>
778
779<p class='example'><a name="LISTING4">Listing 4: "examples/custom.drv"</a></p>
780
781<pre class='example'>
782
783<I>// Include standard font and media definitions</I>
784<a href='ref-ppdcfile.html#_include'>#include</a> &lt;font.defs&gt;
785<a href='ref-ppdcfile.html#_include'>#include</a> &lt;media.defs&gt;
786
787<I>// List the fonts that are supported, in this case all standard fonts...</I>
788<a href='ref-ppdcfile.html#Font'>Font</a> *
789
790<I>// Manufacturer, model name, and version</I>
791<a href='ref-ppdcfile.html#Manufacturer'>Manufacturer</a> "Foo"
792<a href='ref-ppdcfile.html#ModelName'>ModelName</a> "FooJet 2000"
793<a href='ref-ppdcfile.html#Version'>Version</a> 1.0
794
795<I>// Each filter provided by the driver...</I>
796<a href='ref-ppdcfile.html#Filter'>Filter</a> application/vnd.cups-raster 100 rastertofoo
797
798<I>// Supported page sizes</I>
799*<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> Letter
800<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> A4
801
802<I>// Supported resolutions</I>
803*<a href='ref-ppdcfile.html#Resolution'>Resolution</a> k 8 0 0 0 "600dpi/600 DPI"
804
805<I>// Option Group</I>
806<a href='ref-ppdcfile.html#Group'>Group</a> "Footasm"
807
808  <I>// Boolean option</I>
809  <a href='ref-ppdcfile.html#Option'>Option</a> "fooEnhance/Resolution Enhancement" Boolean AnySetup 10
810    *<a href='ref-ppdcfile.html#Choice'>Choice</a> True/Yes "&lt;&lt;/cupsCompression 1&gt;&gt;setpagedevice"
811    <a href='ref-ppdcfile.html#Choice'>Choice</a> False/No "&lt;&lt;/cupsCompression 0&gt;&gt;setpagedevice"
812
813  <I>// Multiple choice option</I>
814  <a href='ref-ppdcfile.html#Option'>Option</a> "fooOutputType/Output Quality" PickOne AnySetup 10
815    *<a href='ref-ppdcfile.html#Choice'>Choice</a> "Auto/Automatic Selection"
816            "&lt;&lt;/OutputType(Auto)&gt;&gt;setpagedevice""
817    <a href='ref-ppdcfile.html#Choice'>Choice</a> "Text/Optimize for Text"
818            "&lt;&lt;/OutputType(Text)&gt;&gt;setpagedevice""
819    <a href='ref-ppdcfile.html#Choice'>Choice</a> "Graph/Optimize for Graphics"
820            "&lt;&lt;/OutputType(Graph)&gt;&gt;setpagedevice""
821    <a href='ref-ppdcfile.html#Choice'>Choice</a> "Photo/Optimize for Photos"
822            "&lt;&lt;/OutputType(Photo)&gt;&gt;setpagedevice""
823
824<I>// Specify the name of the PPD file we want to generate...</I>
825<a href='ref-ppdcfile.html#PCFileName'>PCFileName</a> "foojet2k.ppd"
826</pre>
827
828<P>The custom group is introduced by the <TT>Group</TT>
829directive which is followed by the name and optionally text for
830the user:</P>
831
832<pre class='example'>
833<a href='ref-ppdcfile.html#Group'>Group</a> "Footasm/Footastic Options"
834</pre>
835
836<P>The group name must conform to the PPD specification and
837cannot exceed 40 characters in length. If you specify user text,
838it cannot exceed 80 characters in length. The groups
839<TT>General</TT>, <TT>Extra</TT>, and
840<TT>InstallableOptions</TT> are predefined by CUPS; the general
841and extra groups are filled by the UI options defined by the PPD
842specification. The <TT>InstallableOptions</TT> group is reserved
843for options that define whether accessories for the printer
844(duplexer unit, finisher, stapler, etc.) are installed.</P>
845
846<P>Once the group is specified, the <TT>Option</TT> directive is
847used to introduce a new option:</P>
848
849<pre class='example'>
850<a href='ref-ppdcfile.html#Option'>Option</a> "fooEnhance/Resolution Enhancement" Boolean AnySetup 10
851</pre>
852
853<P>The directive is followed by the name of the option and any
854optional user text, the option type, the PostScript document group, and
855the sort order number. The option name must conform to the PPD specification
856and cannot exceed 40 characters in length. If you specify user text, it
857cannot exceed 80 characters in length.</P>
858
859<P>The option type can be <TT>Boolean</TT> for true/false
860selections, <TT>PickOne</TT> for picking one of many choices, or
861<TT>PickMany</TT> for picking zero or more choices. Boolean
862options can have at most two choices with the names
863<TT>False</TT> and <TT>True</TT>. Pick options can have any
864number of choices, although for Windows compatibility reasons
865the number of choices should not exceed 255.</P>
866
867<P>The PostScript document group is typically <TT>AnySetup</TT>,
868meaning that the option can be introduced at any point in the
869PostScript document. Other values include <TT>PageSetup</TT> to
870include the option before each page and <TT>DocumentSetup</TT>
871to include the option once at the beginning of the document.</P>
872
873<P>The sort order number is used to sort the printer commands
874associated with each option choice within the PostScript
875document. This allows you to setup certain options before others
876as required by the printer. For most CUPS raster printer
877drivers, the value <TT>10</TT> can be used for all options.</P>
878
879<P>Once the option is specified, each option choice can be
880listed using the <TT>Choice</TT> directive:</P>
881
882<pre class='example'>
883*<a href='ref-ppdcfile.html#Choice'>Choice</a> True/Yes "&lt;&lt;/cupsCompression 1&gt;&gt;setpagedevice"
884<a href='ref-ppdcfile.html#Choice'>Choice</a> False/No "&lt;&lt;/cupsCompression 0&gt;&gt;setpagedevice"
885</pre>
886
887<P>The directive is followed by the choice name and optionally
888user text, and the PostScript commands that should be inserted
889when printing a file to this printer. The option name must
890conform to the PPD specification and cannot exceed 40 characters
891in length. If you specify user text, it cannot exceed 80
892characters in length.</P>
893
894<P>The PostScript commands are also interpreted by any RIP
895filters, so these commands typically must be present for all
896option choices. Most commands take the form:</P>
897
898<pre class='example'>
899&lt;&lt;/name value&gt;&gt;setpagedevice
900</pre>
901
902<P>where <TT>name</TT> is the name of the PostScript page device
903attribute and <TT>value</TT> is the numeric or string value for
904that attribute.</P>
905
906
907<h3><a name='DEFINE'>Defining Constants</a></h3>
908
909<P>Sometimes you will want to define constants for your drivers
910so that you can share values in different groups within the same
911driver information file, or to share values between different
912driver information files using the <TT>#include</TT> directive.
913The <TT>#define</TT> directive is used to define constants for
914use in your printer definitions:</P>
915
916<pre class='example'>
917<a href='ref-ppdcfile.html#_define'>#define</a> NAME value
918</pre>
919
920<P>The <TT>NAME</TT> is any sequence of letters, numbers, and
921the underscore. The <TT>value</TT> is a number or string; if the
922value contains spaces you must put double quotes around it, for
923example:</P>
924
925<pre class='example'>
926<a href='ref-ppdcfile.html#_define'>#define</a> FOO "My String Value"
927</pre>
928
929<P>Constants can also be defined on the command-line using the <tt>-D</tt>
930option:</P>
931
932<pre class='command'>
933ppdc -DNAME="value" filename.drv
934</pre>
935
936<P>Once defined, you use the notation <TT>$NAME</TT> to substitute the value of
937the constant in the file, for example:</P>
938
939<pre class='example'>
940<a href='ref-ppdcfile.html#_define'>#define</a> MANUFACTURER "Foo"
941<a href='ref-ppdcfile.html#_define'>#define</a> FOO_600      0
942<a href='ref-ppdcfile.html#_define'>#define</a> FOO_1200     1
943
944{
945  <a href='ref-ppdcfile.html#Manufacturer'>Manufacturer</a> "$MANUFACTURER"
946  <a href='ref-ppdcfile.html#ModelNumber'>ModelNumber</a> $FOO_600
947  <a href='ref-ppdcfile.html#ModelName'>ModelName</a> "FooJet 2000"
948  ...
949}
950
951{
952  <a href='ref-ppdcfile.html#Manufacturer'>Manufacturer</a> "$MANUFACTURER"
953  <a href='ref-ppdcfile.html#ModelNumber'>ModelNumber</a> $FOO_1200
954  <a href='ref-ppdcfile.html#ModelName'>ModelName</a> "FooJet 2001"
955  ...
956}
957</pre>
958
959<P>Numeric constants can be bitwise OR'd together by placing the constants
960inside parenthesis, for example:</P>
961
962<pre class='example'>
963<I>// ModelNumber capability bits</I>
964<a href='ref-ppdcfile.html#_define'>#define</a> DUPLEX 1
965<a href='ref-ppdcfile.html#_define'>#define</a> COLOR  2
966
967...
968
969{
970  <I>// Define a model number specifying the capabilities of the printer...</I>
971  <a href='ref-ppdcfile.html#ModelNumber'>ModelNumber</a> ($DUPLEX $COLOR)
972  ...
973}
974</pre>
975
976
977<h3><a name='CONDITIONAL'>Conditional Statements</a></h3>
978
979<p>The PPD compiler supports conditional compilation using the <tt>#if</tt>,
980<tt>#elif</tt>, <tt>#else</tt>, and <tt>#endif</tt> directives. The <tt>#if</tt>
981and <tt>#elif</tt> directives are followed by a constant name or an expression.
982For example, to include a group of options when "ADVANCED" is defined:</p>
983
984<pre class='example'>
985<a href='ref-ppdcfile.html#_if'>#if</a> ADVANCED
986<a href='ref-ppdcfile.html#Group'>Group</a> "Advanced/Advanced Options"
987  <a href='ref-ppdcfile.html#Option'>Option</a> "fooCyanAdjust/Cyan Adjustment"
988    <a href='ref-ppdcfile.html#Choice'>Choice</a> "plus10/+10%" ""
989    <a href='ref-ppdcfile.html#Choice'>Choice</a> "plus5/+5%" ""
990    *<a href='ref-ppdcfile.html#Choice'>Choice</a> "none/No Adjustment" ""
991    <a href='ref-ppdcfile.html#Choice'>Choice</a> "minus5/-5%" ""
992    <a href='ref-ppdcfile.html#Choice'>Choice</a> "minus10/-10%" ""
993  <a href='ref-ppdcfile.html#Option'>Option</a> "fooMagentaAdjust/Magenta Adjustment"
994    <a href='ref-ppdcfile.html#Choice'>Choice</a> "plus10/+10%" ""
995    <a href='ref-ppdcfile.html#Choice'>Choice</a> "plus5/+5%" ""
996    *<a href='ref-ppdcfile.html#Choice'>Choice</a> "none/No Adjustment" ""
997    <a href='ref-ppdcfile.html#Choice'>Choice</a> "minus5/-5%" ""
998    <a href='ref-ppdcfile.html#Choice'>Choice</a> "minus10/-10%" ""
999  <a href='ref-ppdcfile.html#Option'>Option</a> "fooYellowAdjust/Yellow Adjustment"
1000    <a href='ref-ppdcfile.html#Choice'>Choice</a> "plus10/+10%" ""
1001    <a href='ref-ppdcfile.html#Choice'>Choice</a> "plus5/+5%" ""
1002    *<a href='ref-ppdcfile.html#Choice'>Choice</a> "none/No Adjustment" ""
1003    <a href='ref-ppdcfile.html#Choice'>Choice</a> "minus5/-5%" ""
1004    <a href='ref-ppdcfile.html#Choice'>Choice</a> "minus10/-10%" ""
1005  <a href='ref-ppdcfile.html#Option'>Option</a> "fooBlackAdjust/Black Adjustment"
1006    <a href='ref-ppdcfile.html#Choice'>Choice</a> "plus10/+10%" ""
1007    <a href='ref-ppdcfile.html#Choice'>Choice</a> "plus5/+5%" ""
1008    *<a href='ref-ppdcfile.html#Choice'>Choice</a> "none/No Adjustment" ""
1009    <a href='ref-ppdcfile.html#Choice'>Choice</a> "minus5/-5%" ""
1010    <a href='ref-ppdcfile.html#Choice'>Choice</a> "minus10/-10%" ""
1011<a href='ref-ppdcfile.html#_endif'>#endif</a>
1012</pre>
1013
1014
1015<h3><a name='CONSTRAINTS'>Defining Constraints</a></h3>
1016
1017<P>Constraints are strings that are used to specify that one or more option
1018choices are incompatible, for example two-sided printing on transparency media.
1019Constraints are also used to prevent the use of uninstalled features such as the
1020duplexer unit, additional media trays, and so forth.</P>
1021
1022<P>The <TT>UIConstraints</TT> directive is used to specify a constraint that is
1023placed in the PPD file. The directive is followed by a string using one of the
1024following formats:</P>
1025
1026<pre class='example'>
1027<a href='ref-ppdcfile.html#UIConstraints'>UIConstraints</a> "*Option1 *Option2"
1028<a href='ref-ppdcfile.html#UIConstraints'>UIConstraints</a> "*Option1 Choice1 *Option2"
1029<a href='ref-ppdcfile.html#UIConstraints'>UIConstraints</a> "*Option1 *Option2 Choice2"
1030<a href='ref-ppdcfile.html#UIConstraints'>UIConstraints</a> "*Option1 Choice1 *Option2 Choice2"
1031</pre>
1032
1033<P>Each option name is preceded by the asterisk (<TT>*</TT>). If no choice is
1034given for an option, then all choices <I>except</I> <TT>False</TT> and
1035<TT>None</TT> will conflict with the other option and choice(s). Since the PPD
1036compiler automatically adds reciprocal constraints (option A conflicts with
1037option B, so therefore option B conflicts with option A), you need only specify
1038the constraint once.</P>
1039
1040<p class='example'><a name="LISTING5">Listing 5: "examples/constraint.drv"</a></p>
1041
1042<pre class='example'>
1043
1044<I>// Include standard font and media definitions</I>
1045<a href='ref-ppdcfile.html#_include'>#include</a> &lt;font.defs&gt;
1046<a href='ref-ppdcfile.html#_include'>#include</a> &lt;media.defs&gt;
1047
1048<I>// List the fonts that are supported, in this case all standard fonts...</I>
1049<a href='ref-ppdcfile.html#Font'>Font</a> *
1050
1051<I>// Manufacturer, model name, and version</I>
1052<a href='ref-ppdcfile.html#Manufacturer'>Manufacturer</a> "Foo"
1053<a href='ref-ppdcfile.html#ModelName'>ModelName</a> "FooJet 2000"
1054<a href='ref-ppdcfile.html#Version'>Version</a> 1.0
1055
1056<I>// Each filter provided by the driver...</I>
1057<a href='ref-ppdcfile.html#Filter'>Filter</a> application/vnd.cups-raster 100 rastertofoo
1058
1059<I>// Supported page sizes</I>
1060*<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> Letter
1061<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> A4
1062
1063<I>// Supported resolutions</I>
1064*<a href='ref-ppdcfile.html#Resolution'>Resolution</a> k 8 0 0 0 "600dpi/600 DPI"
1065
1066<I>// Installable Option Group</I>
1067<a href='ref-ppdcfile.html#Group'>Group</a> "InstallableOptions/Options Installed"
1068
1069  <I>// Duplexing unit option</I>
1070  <a href='ref-ppdcfile.html#Option'>Option</a> "OptionDuplexer/Duplexing Unit" Boolean AnySetup 10
1071    <a href='ref-ppdcfile.html#Choice'>Choice</a> True/Installed ""
1072    *<a href='ref-ppdcfile.html#Choice'>Choice</a> "False/Not Installed" ""
1073
1074<I>// General Option Group</I>
1075<a href='ref-ppdcfile.html#Group'>Group</a> General
1076
1077  <I>// Duplexing option</I>
1078  <a href='ref-ppdcfile.html#Option'>Option</a> "Duplex/Two-Sided Printing" PickOne AnySetup 10
1079    *<a href='ref-ppdcfile.html#Choice'>Choice</a> "None/No" "&lt;&lt;/Duplex false&gt;&gt;setpagedevice""
1080    <a href='ref-ppdcfile.html#Choice'>Choice</a> "DuplexNoTumble/Long Edge Binding"
1081           "&lt;&lt;/Duplex true/Tumble false&gt;&gt;setpagedevice""
1082    <a href='ref-ppdcfile.html#Choice'>Choice</a> "DuplexTumble/Short Edge Binding"
1083           "&lt;&lt;/Duplex true/Tumble true&gt;&gt;setpagedevice""
1084
1085<I>// Only allow duplexing if the duplexer is installed</I>
1086<a href='ref-ppdcfile.html#UIConstraints'>UIConstraints</a> "*Duplex *OptionDuplexer False"
1087
1088<I>// Specify the name of the PPD file we want to generate...</I>
1089<a href='ref-ppdcfile.html#PCFileName'>PCFileName</a> "foojet2k.ppd"
1090</pre>
1091
1092<P><A HREF="#LISTING5">Listing 5</A> shows a variation of the first example with
1093an added <TT>Duplex</TT> option and installable option for the duplexer,
1094<TT>OptionDuplex</TT>. A constraint is added at the end to specify that any
1095choice of the <TT>Duplex</TT> option that is not <TT>None</TT> is incompatible
1096with the "Duplexer Installed" option set to "Not Installed"
1097(<TT>False</TT>):</P>
1098
1099<pre class='example'>
1100<a href='ref-ppdcfile.html#UIConstraints'>UIConstraints</a> "*Duplex *OptionDuplexer False"
1101</pre>
1102
1103<h4>Enhanced Constraints</h4>
1104
1105<p>CUPS 1.4 supports constraints between 2 or more options using the
1106<TT>Attribute</TT> directive. <TT>cupsUIConstraints</TT> attributes define
1107the constraints, while <TT>cupsUIResolver</TT> attributes define option changes
1108to resolve constraints. For example, we can specify the previous duplex
1109constraint with a resolver that turns off duplexing with the following two
1110lines:</p>
1111
1112<pre class='example'>
1113<a href='ref-ppdcfile.html#Attribute'>Attribute</a> cupsUIConstraints DuplexOff "*Duplex *OptionDuplexer False"
1114<a href='ref-ppdcfile.html#Attribute'>Attribute</a> cupsUIResolver DuplexOff "*Duplex None"
1115</pre>
1116
1117<h2 class='title'><a name='LOCALIZATION'>Localization</a></h2>
1118
1119<p>The PPD compiler provides localization of PPD files in different languages
1120through <i>message catalog</i> files in the GNU gettext or Apple .strings
1121formats. Each user text string and several key PPD attribute values such as
1122<tt>LanguageVersion</tt> and <tt>LanguageEncoding</tt> are looked up in the
1123corresponding message catalog and the translated text is substituted in the
1124generated PPD files. One message catalog file can be used by multiple driver
1125information files, and each file contains a single language translation.</p>
1126
1127<h3><a name='PPDPO'>The ppdpo Utility</a></h3>
1128
1129<p>While CUPS includes localizations of all standard media sizes and options in
1130several languages, your driver information files may provide their own media
1131sizes and options that need to be localized. CUPS provides a utility program to
1132aid in the localization of drivers called <a
1133href='man-ppdpo.html'><tt>ppdpo(1)</tt></a>. The <tt>ppdpo</tt> program creates
1134or updates a message catalog file based upon one or more driver information
1135files. New messages are added with the word "TRANSLATE" added to the front of
1136the translation string to make locating new strings for translation easier. The
1137program accepts the message catalog filename and one or more driver information
1138files.</p>
1139
1140<p>For example, run the following command to create a new German message catalog
1141called <var>de.po</var> for all of the driver information files in the current
1142directory:</p>
1143
1144<pre class='command'>
1145ppdpo -o de.po *.drv
1146</pre>
1147
1148<p>If the file <var>de.po</var> already exists, <tt>ppdpo</tt> will update the
1149contents of the file with any new messages that need to be translated. To create
1150an Apple .strings file instead, specify the output filename with a .strings
1151extension, for example:</p>
1152
1153<pre class='command'>
1154ppdpo -o de.strings *.drv
1155</pre>
1156
1157<h3><a name='PPDC_CATALOG'>Using Message Catalogs with the PPD Compiler</a></h3>
1158
1159<p>Once you have created a message catalog, use the <a
1160href='ref-ppdcfile.html#_po'><tt>#po</tt></a> directive to declare it in each
1161driver information file. For example, to declare the German message catalog for
1162a driver use:</p>
1163
1164<pre class='example'>
1165<a href='ref-ppdcfile.html#_po'>#po</a> de "de.po"  // German
1166</pre>
1167
1168<p>In fact, you can use the <tt>#po</tt> directive as many times as needed:</p>
1169
1170<pre class='example'>
1171<a href='ref-ppdcfile.html#_po'>#po</a> de "de.po"  // German
1172<a href='ref-ppdcfile.html#_po'>#po</a> es "es.po"  // Spanish
1173<a href='ref-ppdcfile.html#_po'>#po</a> fr "fr.po"  // French
1174<a href='ref-ppdcfile.html#_po'>#po</a> it "it.po"  // Italian
1175<a href='ref-ppdcfile.html#_po'>#po</a> ja "ja.po"  // Japanese
1176</pre>
1177
1178<p>The filename ("de.po", etc.) can be relative to the location of the driver
1179information file or an absolute path. Once defined, the PPD compiler will
1180automatically generate a globalized PPD for every language declared in your
1181driver information file. To generate a single-language PPD file, simply use the
1182<tt>-l</tt> option to list the corresponding locale, for example:</p>
1183
1184<pre class='command'>
1185ppdc -l de -d ppd/de mydrivers.drv
1186</pre>
1187
1188<p>to generate German PPD files.</p>
1189</div>
1190</body>
1191</html>
1192