]> git.ipfire.org Git - thirdparty/cups.git/blame - doc/help/postscript-driver.html
Import CUPS v2.0b1
[thirdparty/cups.git] / doc / help / postscript-driver.html
CommitLineData
745129be 1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
8b450588 2<html>
28b9d139 3<!-- SECTION: Programming -->
8b450588 4<head>
0268488e
MS
5 <title>Developing PostScript Printer Drivers </title>
6 <meta name="keywords" content="Programming">
7 <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
8 <meta name="creator" content="Mini-XML v2.7">
8b450588
MS
9<style type="text/css"><!--
10BODY {
11 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
12}
13
14H1, H2, H3, H4, H5, H6, P, TD, TH {
15 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
16}
17
18KBD {
19 font-family: monaco, courier, monospace;
20 font-weight: bold;
21}
22
23PRE {
24 font-family: monaco, courier, monospace;
25}
26
27PRE.command {
10d09e33 28 border: dotted thin #7f7f7f;
8b450588 29 margin-left: 36pt;
10d09e33 30 padding: 10px;
8b450588
MS
31}
32
f11a948a
MS
33P.compact {
34 margin: 0;
35}
36
8b450588
MS
37P.example {
38 font-style: italic;
39 margin-left: 36pt;
40}
1a18c85c
MS
41
42DL.man DD {
43 margin-left: 5em;
44}
45
46DL.man DT {
47 margin-left: 0;
48}
49
50PRE.man {
51 margin: 0;
52}
53
8b450588
MS
54PRE.example {
55 background: #eeeeee;
56 border: dotted thin #999999;
57 margin-left: 36pt;
178cb736 58 padding: 10pt;
8b450588
MS
59}
60
61PRE.command EM, PRE.example EM {
62 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
63}
64
65P.command {
66 font-family: monaco, courier, monospace;
67 margin-left: 36pt;
68}
69
70P.formula {
71 font-style: italic;
72 margin-left: 36pt;
73}
74
75BLOCKQUOTE {
178cb736 76 background: #eeeeee;
8b450588
MS
77 border: solid thin #999999;
78 padding: 10pt;
79}
80
81A IMG {
82 border: none;
83}
84
85A:link:hover IMG {
86 background: #f0f0f0;
87 border-radius: 10px;
88 -moz-border-radius: 10px;
89}
90
91A:link, A:visited {
1a18c85c 92 font-weight: inherit;
8b450588
MS
93 text-decoration: none;
94}
95
96A:link:hover, A:visited:hover, A:active {
97 text-decoration: underline;
98}
99
100SUB, SUP {
101 font-size: 50%;
102}
103
104TR.data, TD.data, TR.data TD {
105 margin-top: 10pt;
106 padding: 5pt;
107 border-bottom: solid 1pt #999999;
108}
109
110TR.data TH {
111 border-bottom: solid 1pt #999999;
112 padding-top: 10pt;
113 padding-left: 5pt;
114 text-align: left;
115}
116
117DIV.table TABLE {
118 border: solid thin #999999;
119 border-collapse: collapse;
120 border-spacing: 0;
121 margin-left: auto;
122 margin-right: auto;
123}
124
125DIV.table CAPTION {
126 caption-side: top;
127 font-size: 120%;
128 font-style: italic;
129 font-weight: bold;
130 margin-left: auto;
131 margin-right: auto;
132}
133
134DIV.table TABLE TD {
135 border: solid thin #cccccc;
136 padding-top: 5pt;
137}
138
139DIV.table TABLE TH {
140 background: #cccccc;
141 border: none;
142 border-bottom: solid thin #999999;
143}
144
145DIV.figure TABLE {
146 margin-left: auto;
147 margin-right: auto;
148}
149
150DIV.figure CAPTION {
151 caption-side: bottom;
152 font-size: 120%;
153 font-style: italic;
154 font-weight: bold;
155 margin-left: auto;
156 margin-right: auto;
157}
158
159TH.label {
160 text-align: right;
161 vertical-align: top;
162}
163
164TH.sublabel {
165 text-align: right;
166 font-weight: normal;
167}
168
169HR {
170 border: solid thin;
171}
172
173SPAN.info {
174 background: black;
175 border: thin solid black;
176 color: white;
177 font-size: 80%;
178 font-style: italic;
179 font-weight: bold;
180 white-space: nowrap;
181}
182
183H2 SPAN.info, H3 SPAN.info, H4 SPAN.info {
184 float: right;
185 font-size: 100%;
186}
187
178cb736
MS
188H1.title {
189}
190
8b450588
MS
191H2.title, H3.title {
192 border-bottom: solid 2pt #000000;
193}
194
195DIV.indent, TABLE.indent {
196 margin-top: 2em;
197 margin-left: auto;
198 margin-right: auto;
199 width: 90%;
200}
201
202TABLE.indent {
203 border-collapse: collapse;
204}
205
206TABLE.indent TD, TABLE.indent TH {
207 padding: 0;
208}
209
210TABLE.list {
211 border-collapse: collapse;
212 margin-left: auto;
213 margin-right: auto;
214 width: 90%;
215}
216
217TABLE.list TH {
218 background: white;
219 border-bottom: solid thin #cccccc;
220 color: #444444;
221 padding-top: 10pt;
222 padding-left: 5pt;
223 text-align: left;
224 vertical-align: bottom;
225 white-space: nowrap;
226}
227
228TABLE.list TH A {
229 color: #4444cc;
230}
231
232TABLE.list TD {
233 border-bottom: solid thin #eeeeee;
234 padding-top: 5pt;
235 padding-left: 5pt;
236}
237
238TABLE.list TR:nth-child(even) {
239 background: #f8f8f8;
240}
241
242TABLE.list TR:nth-child(odd) {
243 background: #f4f4f4;
244}
245
246DT {
247 margin-left: 36pt;
248 margin-top: 12pt;
249}
250
251DD {
252 margin-left: 54pt;
253}
254
255DL.category DT {
256 font-weight: bold;
257}
258
259P.summary {
260 margin-left: 36pt;
261 font-family: monaco, courier, monospace;
262}
263
264DIV.summary TABLE {
265 border: solid thin #999999;
266 border-collapse: collapse;
267 border-spacing: 0;
268 margin: 10px;
269}
270
271DIV.summary TABLE TD, DIV.summary TABLE TH {
272 border: solid thin #999999;
273 padding: 5px;
274 text-align: left;
275 vertical-align: top;
276}
277
278DIV.summary TABLE THEAD TH {
279 background: #eeeeee;
280}
281
282/* API documentation styles... */
283div.body h1 {
284 margin: 0;
285}
286div.body h2 {
287 margin-top: 1.5em;
288}
289div.body h3, div.body h4, div.body h5 {
290 margin-bottom: 0.5em;
291 margin-top: 1.5em;
292}
293.class, .enumeration, .function, .struct, .typedef, .union {
294 border-bottom: solid thin #999999;
295 margin-bottom: 0;
296 margin-top: 2em;
297}
298.description {
299 margin-top: 0.5em;
300}
301code, p.code, pre, ul.code li {
302 font-family: monaco, courier, monospace;
303 font-size: 90%;
304}
305ul.code, ul.contents, ul.subcontents {
306 list-style-type: none;
307 margin: 0;
308 padding-left: 0;
309}
310ul.code li {
311 margin: 0;
312}
313ul.contents > li {
314 margin-top: 1em;
315}
316ul.contents li ul.code, ul.contents li ul.subcontents {
317 padding-left: 2em;
318}
319div.body dl {
320 margin-left: 0;
321 margin-top: 0;
322}
323div.body dt {
324 font-style: italic;
325 margin-left: 0;
326 margin-top: 0;
327}
328div.body dd {
329 margin-bottom: 0.5em;
330}
331
332/* This is just for the HTML files generated with the framedhelp target */
333div.contents {
334 background: #e8e8e8;
335 border: solid thin black;
336 padding: 10px;
337}
338div.contents h1 {
339 font-size: 110%;
340}
341div.contents h2 {
342 font-size: 100%;
343}
344div.contents ul.contents {
345 font-size: 80%;
346}
347div.contents ul.subcontents li {
348 margin-left: 1em;
349 text-indent: -1em;
350}
351--></style>
352</head>
353<body>
354<div class='body'>
10d09e33
MS
355<!--
356 "$Id$"
357
358 PostScript printer driver documentation for CUPS.
359
f3c17241 360 Copyright 2007-2012 by Apple Inc.
10d09e33
MS
361 Copyright 1997-2007 by Easy Software Products.
362
363 These coded instructions, statements, and computer programs are the
364 property of Apple Inc. and are protected by Federal copyright
365 law. Distribution and use rights are outlined in the file "LICENSE.txt"
366 which should have been included with this file. If this file is
367 file is missing or damaged, see the license at "http://www.cups.org/".
368-->
369
178cb736
MS
370<h1 class='title'>Developing PostScript Printer Drivers</h1>
371
f3c17241 372<p>This document describes how to develop printer drivers for PostScript printers. Topics include: <a href='#BASICS'>printer driver basics</a>, <a href='#CREATE'>creating new PPD files</a>, <a href='#IMPORT'>importing existing PPD files</a>, <a href='#FILTERS'>using custom filters</a>, <a href='#COLOR'>implementing color management</a>, and <a href='#MACOSX'>adding OS X features</a>.</p>
28b9d139
MS
373
374<div class='summary'><table summary='General Information'>
375<tbody>
376<tr>
377 <th>See Also</th>
378 <td>Programming: <a href='raster-driver.html'>Developing Raster Printer Drivers</a><br>
379 Programming: <a href='api-filter.html'>Filter and Backend Programming</a><br>
380 Programming: <a href='ppd-compiler.html'>Introduction to the PPD Compiler</a><br>
381 Programming: <a href='api-raster.html'>Raster API</a><br>
382 References: <a href='ref-ppdcfile.html'>PPD Compiler Driver Information File Reference</a><br>
383 Specifications: <a href='spec-ppd.html'>CUPS PPD Extensions</a></td>
384</tr>
385</tbody>
386</table></div>
8b450588
MS
387<h2 class="title">Contents</h2>
388<ul class="contents">
389<li><a href="#BASICS">Printer Driver Basics</a></li>
390<li><a href="#CREATING">Creating New PPD Files</a><ul class="subcontents">
0268488e 391 <li><a href="#IMPORT">Importing Existing PPD Files</a></li>
8b450588
MS
392</ul></li>
393<li><a href="#FILTERS">Using Custom Filters</a></li>
394<li><a href="#COLOR">Implementing Color Management</a></li>
f3c17241 395<li><a href="#MACOSX">Adding OS X Features</a></li>
0268488e 396</ul>
28b9d139
MS
397<h2 class='title'><a name='BASICS'>Printer Driver Basics</a></h2>
398
399<p>A CUPS PostScript printer driver consists of a PostScript Printer Description (PPD) file that describes the features and capabilities of the device, zero or more <em>filter</em> programs that prepare print data for the device, and zero or more support files for color management, online help, and so forth. The PPD file includes references to all of the filters and support files used by the driver.</p>
400
401<p>Every time a user prints something the scheduler program, <a href='man-cupsd.html'>cupsd(8)</a>, determines the format of the print job and the programs required to convert that job into something the printer understands. CUPS includes filter programs for many common formats, for example to convert Portable Document Format (PDF) files into device-independent PostScript, and then from device-independent PostScript to device-dependent PostScript. <a href='#FIGURE_1'>Figure 1</a> shows the data flow of a typical print job.</p>
402
403<div class='figure'><table summary='PostScript Filter Chain'>
404<caption>Figure 1: <a name='FIGURE_1'>PostScript Filter Chain</a></caption>
b0f6947b 405<tr><td><img src='../images/cups-postscript-chain.png' width='700' height='150' alt='PostScript Filter Chain'></td></tr>
28b9d139
MS
406</table></div>
407
408<p>The optional PostScript filter can be provided to add printer-specific commands to the PostScript output that cannot be represented in the PPD file or to reorganize the output for special printer features. Typically this is used to support advanced job management or finishing functions on the printer. CUPS includes a generic PostScript filter that handles all PPD-defined commands.</p>
409
410<p>The optional port monitor handles interface-specific protocol or encoding issues. For example, many PostScript printers support the Binary Communications Protocol (BCP) and Tagged Binary Communications Protocol (TBCP) to allow applications to print 8-bit ("binary") PostScript jobs. CUPS includes port monitors for BCP and TBCP, and you can supply your own port monitors as needed.</p>
411
412<p>The backend handles communications with the printer, sending print data from the last filter to the printer and relaying back-channel data from the printer to the upstream filters. CUPS includes backend programs for common direct-connect interfaces and network protocols, and you can provide your own backend to support custom interfaces and protocols.</p>
413
414<p>The scheduler also supports a special "command" file format for sending maintenance commands and status queries to a printer or printer driver. Command print jobs typically use a single command filter program defined in the PPD file to generate the appropriate printer commands and handle any responses from the printer. <a href='#FIGURE_2'>Figure 2</a> shows the data flow of a typical command job.</p>
415
416<div class='figure'><table summary='Command Filter Chain'>
417<caption>Figure 2: <a name='FIGURE_2'>Command Filter Chain</a></caption>
b0f6947b 418<tr><td><img src='../images/cups-command-chain.png' width='575' height='150' alt='Command Filter Chain'></td></tr>
28b9d139
MS
419</table></div>
420
421<p>PostScript printer drivers typically do not require their own command filter since CUPS includes a generic PostScript command filter that supports all of the standard functions using PPD-defined commands.</p>
422
423
424<h2 class='title'><a name='CREATING'>Creating New PPD Files</a></h2>
425
426<p>We recommend using the CUPS PPD compiler, <a href='man-ppdc.html'>ppdc(1)</a>, to create new PPD files since it manages many of the tedious (and error-prone!) details of paper sizes and localization for you. It also allows you to easily support multiple devices from a single source file. For more information see the "<a href='ppd-compiler.html'>Introduction to the PPD Compiler</a>" document. <a href='#LISTING_1'>Listing 1</a> shows a driver information file for a black-and-white PostScript printer.</p>
427
428<p class='example'>Listing 1: <a name='LISTING_1'>"examples/postscript.drv"</a></p>
429
430<pre class='example'>
431// Include standard font and media definitions
432<a href='ref-ppdcfile.html#_include'>#include</a> &lt;font.defs&gt;
433<a href='ref-ppdcfile.html#_include'>#include</a> &lt;media.defs&gt;
434
435// Specify this is a PostScript printer driver
436<a href='ref-ppdcfile.html#DriverType'>DriverType</a> ps
437
438// List the fonts that are supported, in this case all standard fonts
439<a href='ref-ppdcfile.html#Font'>Font</a> *
440
441// Manufacturer, model name, and version
442<a href='ref-ppdcfile.html#Manufacturer'>Manufacturer</a> "Foo"
443<a href='ref-ppdcfile.html#ModelName'>ModelName</a> "Foo LaserProofer 2000"
444<a href='ref-ppdcfile.html#Version'>Version</a> 1.0
445
446// PostScript printer attributes
447<a href='ref-ppdcfile.html#Attribute'>Attribute</a> DefaultColorSpace "" Gray
448<a href='ref-ppdcfile.html#Attribute'>Attribute</a> LandscapeOrientation "" Minus90
449<a href='ref-ppdcfile.html#Attribute'>Attribute</a> LanguageLevel "" "3"
450<a href='ref-ppdcfile.html#Attribute'>Attribute</a> Product "" "(Foo LaserProofer 2000)"
451<a href='ref-ppdcfile.html#Attribute'>Attribute</a> PSVersion "" "(3010) 0"
452<a href='ref-ppdcfile.html#Attribute'>Attribute</a> TTRasterizer "" Type42
453
454// Supported page sizes
455*<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> Letter
456<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> Legal
457<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> A4
458
459// Query command for page size
460<a href='ref-ppdcfile.html#Attribute'>Attribute</a> "?PageSize" "" "
461 save
462 currentpagedevice /PageSize get aload pop
463 2 copy gt {exch} if (Unknown)
464 23 dict
465 dup [612 792] (Letter) put
466 dup [612 1008] (Legal) put
467 dup [595 842] (A4) put
f3c17241 468 {exch aload pop 4 index sub abs 5 le exch
28b9d139
MS
469 5 index sub abs 5 le and
470 {exch pop exit} {pop} ifelse
471 } bind forall = flush pop pop
472 restore"
473
474// Specify the name of the PPD file we want to generate
475<a href='ref-ppdcfile.html#PCFileName'>PCFileName</a> "fooproof.ppd"
476</pre>
477
478<h3>Required Attributes</h3>
479
480<p>PostScript drivers require the attributes listed in <a href='#TABLE_1'>Table 1</a>. If not specified, the defaults for CUPS drivers are used. A typical PostScript driver information file would include the following attributes:</p>
481
482<pre class='example'>
483<a href='ref-ppdcfile.html#Attribute'>Attribute</a> DefaultColorSpace "" Gray
484<a href='ref-ppdcfile.html#Attribute'>Attribute</a> LandscapeOrientation "" Minus90
485<a href='ref-ppdcfile.html#Attribute'>Attribute</a> LanguageLevel "" "3"
486<a href='ref-ppdcfile.html#Attribute'>Attribute</a> Product "" "(Foo LaserProofer 2000)"
487<a href='ref-ppdcfile.html#Attribute'>Attribute</a> PSVersion "" "(3010) 0"
488<a href='ref-ppdcfile.html#Attribute'>Attribute</a> TTRasterizer "" Type42
489</pre>
490
491<div class='table'><table summary='Required PostScript Printer Driver Attributes'>
492<caption>Table 1: <a name='TABLE_1'>Required PostScript Printer Driver Attributes</a></caption>
493<thead>
494<tr>
495 <th>Attribute</th>
496 <th>Description</th>
497</tr>
498</thead>
499<tbody>
500<tr>
501 <td><tt>DefaultColorSpace</tt></td>
502 <td>The default colorspace:
503 <tt>Gray</tt>, <tt>RGB</tt>, <tt>CMY</tt>, or
504 <tt>CMYK</tt>. If not specified, then <tt>RGB</tt> is
505 assumed.</td>
506</tr>
507<tr>
508 <td><tt>LandscapeOrientation</tt></td>
509 <td>The preferred landscape
510 orientation: <tt>Plus90</tt>, <tt>Minus90</tt>, or
511 <tt>Any</tt>. If not specified, <tt>Plus90</tt> is
512 assumed.</td>
513</tr>
514<tr>
515 <td><tt>LanguageLevel</tt></td>
516 <td>The PostScript language
517 level supported by the device: 1, 2, or 3. If not
518 specified, 2 is assumed.</td>
519</tr>
520<tr>
521 <td><tt>Product</tt></td>
522 <td>The string returned by
523 the PostScript <tt>product</tt> operator, which
524 <i>must</i> include parenthesis to conform with
525 PostScript syntax rules for strings. Multiple
526 <tt>Product</tt> attributes may be specified to support
527 multiple products with the same PPD file. If not
528 specified, "(ESP Ghostscript)" and "(GNU Ghostscript)"
529 are assumed.</td>
530</tr>
531<tr>
532 <td><tt>PSVersion</tt></td>
533 <td>The PostScript
534 interpreter version numbers as returned by the
535 <tt>version</tt> and <tt>revision</tt> operators. The
536 required format is "(version) revision". Multiple
537 <tt>PSVersion</tt> attributes may be specified to
538 support multiple interpreter version numbers. If not
539 specified, "(3010) 705" and "(3010) 707" are
540 assumed.</td>
541</tr>
542<tr>
543 <td><tt>TTRasterizer</tt></td>
544 <td>The type of TrueType
545 font rasterizer supported by the device, if any. The
546 supported values are <tt>None</tt>, <tt>Accept68k</tt>,
547 <tt>Type42</tt>, and <tt>TrueImage</tt>. If not
548 specified, <tt>None</tt> is assumed.</td>
549</tr>
550</table></div>
551
552<h3>Query Commands</h3>
553
554<p>Most PostScript printer PPD files include query commands (<tt>?PageSize</tt>, etc.) that allow applications to query the printer for its current settings and configuration. Query commands are included in driver information files as attributes. For example, the example in <a href='#LISTING_1'>Listing 1</a> uses the following definition for the <tt>PageSize</tt> query command:</p>
555
556<pre class='example'>
557<a href='ref-ppdcfile.html#Attribute'>Attribute</a> "?PageSize" "" "
558 save
559 currentpagedevice /PageSize get aload pop
560 2 copy gt {exch} if (Unknown)
561 23 dict
562 dup [612 792] (Letter) put
563 dup [612 1008] (Legal) put
564 dup [595 842] (A4) put
f3c17241 565 {exch aload pop 4 index sub abs 5 le exch
28b9d139
MS
566 5 index sub abs 5 le and
567 {exch pop exit} {pop} ifelse
568 } bind forall = flush pop pop
569 restore"
570</pre>
571
572<p>Query commands can span multiple lines, however no single line may contain more than 255 characters.</p>
573
574<h3><a name='IMPORT'>Importing Existing PPD Files</a></h3>
575
576<P>CUPS includes a utility called <a href='man-ppdi.html'>ppdi(1)</a>
577which allows you to import existing PPD files into the driver information file
578format used by the PPD compiler <a href='man-ppdc.html'>ppdc(1)</a>. Once
579imported, you can modify, localize, and regenerate the PPD files easily. Type
580the following command to import the PPD file <VAR>mydevice.ppd</VAR> into the
581driver information file <VAR>mydevice.drv</VAR>:</P>
582
583<pre class='command'>
584ppdi -o mydevice.drv mydevice.ppd
585</pre>
586
587<P>If you have a whole directory of PPD files that you would like to import,
588you can list multiple filenames or use shell wildcards to import more than one
589PPD file on the command-line:</P>
590
591<pre class='command'>
592ppdi -o mydevice.drv mydevice1.ppd mydevice2.ppd
593ppdi -o mydevice.drv *.ppd
594</pre>
595
596<P>If the driver information file already exists, the new PPD
597file entries are appended to the end of the file. Each PPD file
598is placed in its own group of curly braces within the driver
599information file.</P>
600
601
602<h2 class='title'><a name='FILTERS'>Using Custom Filters</a></h2>
603
604<p>Normally a PostScript printer driver will not utilize any additional print filters. For drivers that provide additional filters such as a CUPS command file filter for doing printer maintenance, you must also list the following <tt>Filter</tt> directive to handle printing PostScript files:</p>
605
606<pre class='example'>
607<a href='ref-ppdcfile.html#Filter'>Filter</a> application/vnd.cups-postscript 0 -
608</pre>
609
e4572d57
MS
610<h3>Custom Command Filters</h3>
611
612<p>The <tt>application/vnd.cups-command</tt> file type is used for CUPS command files. Use the following <tt>Filter</tt> directive to handle CUPS command files:</p>
613
614<pre class='example'>
615<a href='ref-ppdcfile.html#Filter'>Filter</a> application/vnd.cups-command 100 /path/to/command/filter
616</pre>
617
618<p>To use the standard PostScript command filter, specify <var>commandtops</var> as the path to the command filter.</p>
619
620<h3>Custom PDF Filters</h3>
621
622<p>The <tt>application/pdf</tt> file type is used for unfiltered PDF files while the <tt>application/vnd.cups-pdf</tt> file type is used for filtered PDF files. Use the following <tt>Filter</tt> directive to handle filtered PDF files:</p>
623
624<pre class='example'>
625<a href='ref-ppdcfile.html#Filter'>Filter</a> application/vnd.cups-pdf 100 /path/to/pdf/filter
626</pre>
627
628<p>For unfiltered PDF files, use:</p>
629
630<pre class='example'>
631<a href='ref-ppdcfile.html#Filter'>Filter</a> application/pdf 100 /path/to/pdf/filter
632</pre>
633
634<p>Custom PDF filters that accept filtered data do not need to perform number-up processing and other types of page imposition, while those that accept unfiltered data MUST do the number-up processing themselves.</p>
635
636<h3>Custom PostScript Filters</h3>
637
638<p>The <tt>application/vnd.cups-postscript</tt> file type is used for filtered PostScript files. Use the following <tt>Filter</tt> directive to handle PostScript files:</p>
639
640<pre class='example'>
641<a href='ref-ppdcfile.html#Filter'>Filter</a> application/vnd.cups-postscript 100 /path/to/postscript/filter
642</pre>
643
28b9d139
MS
644
645<h2 class='title'><a name='COLOR'>Implementing Color Management</a></h2>
646
178cb736 647<p>CUPS uses ICC color profiles to provide more accurate color reproduction. The <a href='spec-ppd.html#cupsICCProfile'><tt>cupsICCProfile</tt></a> attribute defines the color profiles that are available for a given printer, for example:</p>
28b9d139 648
178cb736
MS
649<pre class='example'>
650<a href='ref-ppdcfile.html#Attribute'>Attribute</a> cupsICCProfile "ColorModel.MediaType.Resolution/Description" /path/to/ICC/profile
651</pre>
28b9d139 652
178cb736
MS
653<p>where "ColorModel.MediaType.Resolution" defines a selector based on the corresponding option selections. A simple driver might only define profiles for the color models that are supported, for example a printer supporting Gray and RGB might use:</p>
654
655<pre class='example'>
656<a href='ref-ppdcfile.html#Attribute'>Attribute</a> cupsICCProfile "Gray../Grayscale Profile" /path/to/ICC/gray-profile
657<a href='ref-ppdcfile.html#Attribute'>Attribute</a> cupsICCProfile "RGB../Full Color Profile" /path/to/ICC/rgb-profile
658</pre>
28b9d139 659
178cb736 660<p>The options used for profile selection can be customized using the <tt>cupsICCQualifier2</tt> and <tt>cupsICCQualifier3</tt> attributes.</p>
28b9d139
MS
661
662
f3c17241 663<h2 class='title'><a name='MACOSX'>Adding OS X Features</a></h2>
178cb736 664
f3c17241 665<p>OS X printer drivers can provide <a href='spec-ppd.html#MACOSX'>additional attributes</a> to specify additional option panes in the print dialog, an image of the printer, a help book, and option presets for the driver software:</p>
28b9d139 666
178cb736
MS
667<pre class='example'>
668<a href='ref-ppdcfile.html#Attribute'>Attribute</a> APDialogExtension "" /Library/Printers/Vendor/filename.plugin
669<a href='ref-ppdcfile.html#Attribute'>Attribute</a> APHelpBook "" /Library/Printers/Vendor/filename.bundle
670<a href='ref-ppdcfile.html#Attribute'>Attribute</a> APPrinterIconPath "" /Library/Printers/Vendor/filename.icns
671<a href='ref-ppdcfile.html#Attribute'>Attribute</a> APPrinterPreset "name/text" "*option choice ..."
672</pre>
8b450588 673</div>
28b9d139
MS
674</body>
675</html>