]> git.ipfire.org Git - thirdparty/cups.git/blame - doc/help/postscript-driver.html
Update all references to OS X to macOS.
[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">
8072030b 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}
ca6b43fc 41
240214ef
MS
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 {
ca6b43fc 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 355<!--
10d09e33
MS
356 PostScript printer driver documentation for CUPS.
357
f3c17241 358 Copyright 2007-2012 by Apple Inc.
10d09e33
MS
359 Copyright 1997-2007 by Easy Software Products.
360
361 These coded instructions, statements, and computer programs are the
362 property of Apple Inc. and are protected by Federal copyright
363 law. Distribution and use rights are outlined in the file "LICENSE.txt"
364 which should have been included with this file. If this file is
365 file is missing or damaged, see the license at "http://www.cups.org/".
366-->
367
178cb736
MS
368<h1 class='title'>Developing PostScript Printer Drivers</h1>
369
8072030b 370<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 macOS features</a>.</p>
28b9d139
MS
371
372<div class='summary'><table summary='General Information'>
373<tbody>
374<tr>
375 <th>See Also</th>
376 <td>Programming: <a href='raster-driver.html'>Developing Raster Printer Drivers</a><br>
377 Programming: <a href='api-filter.html'>Filter and Backend Programming</a><br>
378 Programming: <a href='ppd-compiler.html'>Introduction to the PPD Compiler</a><br>
379 Programming: <a href='api-raster.html'>Raster API</a><br>
380 References: <a href='ref-ppdcfile.html'>PPD Compiler Driver Information File Reference</a><br>
381 Specifications: <a href='spec-ppd.html'>CUPS PPD Extensions</a></td>
382</tr>
383</tbody>
384</table></div>
8b450588
MS
385<h2 class="title">Contents</h2>
386<ul class="contents">
387<li><a href="#BASICS">Printer Driver Basics</a></li>
388<li><a href="#CREATING">Creating New PPD Files</a><ul class="subcontents">
0268488e 389 <li><a href="#IMPORT">Importing Existing PPD Files</a></li>
8b450588
MS
390</ul></li>
391<li><a href="#FILTERS">Using Custom Filters</a></li>
392<li><a href="#COLOR">Implementing Color Management</a></li>
8072030b 393<li><a href="#MACOSX">Adding macOS Features</a></li>
0268488e 394</ul>
28b9d139
MS
395<h2 class='title'><a name='BASICS'>Printer Driver Basics</a></h2>
396
397<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>
398
399<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>
400
401<div class='figure'><table summary='PostScript Filter Chain'>
402<caption>Figure 1: <a name='FIGURE_1'>PostScript Filter Chain</a></caption>
b0f6947b 403<tr><td><img src='../images/cups-postscript-chain.png' width='700' height='150' alt='PostScript Filter Chain'></td></tr>
28b9d139
MS
404</table></div>
405
406<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>
407
408<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>
409
410<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>
411
412<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>
413
414<div class='figure'><table summary='Command Filter Chain'>
415<caption>Figure 2: <a name='FIGURE_2'>Command Filter Chain</a></caption>
b0f6947b 416<tr><td><img src='../images/cups-command-chain.png' width='575' height='150' alt='Command Filter Chain'></td></tr>
28b9d139
MS
417</table></div>
418
419<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>
420
421
422<h2 class='title'><a name='CREATING'>Creating New PPD Files</a></h2>
423
424<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>
425
426<p class='example'>Listing 1: <a name='LISTING_1'>"examples/postscript.drv"</a></p>
427
428<pre class='example'>
429// Include standard font and media definitions
430<a href='ref-ppdcfile.html#_include'>#include</a> &lt;font.defs&gt;
431<a href='ref-ppdcfile.html#_include'>#include</a> &lt;media.defs&gt;
432
433// Specify this is a PostScript printer driver
434<a href='ref-ppdcfile.html#DriverType'>DriverType</a> ps
435
436// List the fonts that are supported, in this case all standard fonts
437<a href='ref-ppdcfile.html#Font'>Font</a> *
438
439// Manufacturer, model name, and version
440<a href='ref-ppdcfile.html#Manufacturer'>Manufacturer</a> "Foo"
441<a href='ref-ppdcfile.html#ModelName'>ModelName</a> "Foo LaserProofer 2000"
442<a href='ref-ppdcfile.html#Version'>Version</a> 1.0
443
444// PostScript printer attributes
445<a href='ref-ppdcfile.html#Attribute'>Attribute</a> DefaultColorSpace "" Gray
446<a href='ref-ppdcfile.html#Attribute'>Attribute</a> LandscapeOrientation "" Minus90
447<a href='ref-ppdcfile.html#Attribute'>Attribute</a> LanguageLevel "" "3"
448<a href='ref-ppdcfile.html#Attribute'>Attribute</a> Product "" "(Foo LaserProofer 2000)"
449<a href='ref-ppdcfile.html#Attribute'>Attribute</a> PSVersion "" "(3010) 0"
450<a href='ref-ppdcfile.html#Attribute'>Attribute</a> TTRasterizer "" Type42
451
452// Supported page sizes
453*<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> Letter
454<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> Legal
455<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> A4
456
457// Query command for page size
458<a href='ref-ppdcfile.html#Attribute'>Attribute</a> "?PageSize" "" "
459 save
460 currentpagedevice /PageSize get aload pop
461 2 copy gt {exch} if (Unknown)
462 23 dict
463 dup [612 792] (Letter) put
464 dup [612 1008] (Legal) put
465 dup [595 842] (A4) put
f3c17241 466 {exch aload pop 4 index sub abs 5 le exch
28b9d139
MS
467 5 index sub abs 5 le and
468 {exch pop exit} {pop} ifelse
469 } bind forall = flush pop pop
470 restore"
471
472// Specify the name of the PPD file we want to generate
473<a href='ref-ppdcfile.html#PCFileName'>PCFileName</a> "fooproof.ppd"
474</pre>
475
476<h3>Required Attributes</h3>
477
478<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>
479
480<pre class='example'>
481<a href='ref-ppdcfile.html#Attribute'>Attribute</a> DefaultColorSpace "" Gray
482<a href='ref-ppdcfile.html#Attribute'>Attribute</a> LandscapeOrientation "" Minus90
483<a href='ref-ppdcfile.html#Attribute'>Attribute</a> LanguageLevel "" "3"
484<a href='ref-ppdcfile.html#Attribute'>Attribute</a> Product "" "(Foo LaserProofer 2000)"
485<a href='ref-ppdcfile.html#Attribute'>Attribute</a> PSVersion "" "(3010) 0"
486<a href='ref-ppdcfile.html#Attribute'>Attribute</a> TTRasterizer "" Type42
487</pre>
488
489<div class='table'><table summary='Required PostScript Printer Driver Attributes'>
490<caption>Table 1: <a name='TABLE_1'>Required PostScript Printer Driver Attributes</a></caption>
491<thead>
492<tr>
493 <th>Attribute</th>
494 <th>Description</th>
495</tr>
496</thead>
497<tbody>
498<tr>
499 <td><tt>DefaultColorSpace</tt></td>
500 <td>The default colorspace:
501 <tt>Gray</tt>, <tt>RGB</tt>, <tt>CMY</tt>, or
502 <tt>CMYK</tt>. If not specified, then <tt>RGB</tt> is
503 assumed.</td>
504</tr>
505<tr>
506 <td><tt>LandscapeOrientation</tt></td>
507 <td>The preferred landscape
508 orientation: <tt>Plus90</tt>, <tt>Minus90</tt>, or
509 <tt>Any</tt>. If not specified, <tt>Plus90</tt> is
510 assumed.</td>
511</tr>
512<tr>
513 <td><tt>LanguageLevel</tt></td>
514 <td>The PostScript language
515 level supported by the device: 1, 2, or 3. If not
516 specified, 2 is assumed.</td>
517</tr>
518<tr>
519 <td><tt>Product</tt></td>
520 <td>The string returned by
521 the PostScript <tt>product</tt> operator, which
522 <i>must</i> include parenthesis to conform with
523 PostScript syntax rules for strings. Multiple
524 <tt>Product</tt> attributes may be specified to support
525 multiple products with the same PPD file. If not
526 specified, "(ESP Ghostscript)" and "(GNU Ghostscript)"
527 are assumed.</td>
528</tr>
529<tr>
530 <td><tt>PSVersion</tt></td>
531 <td>The PostScript
532 interpreter version numbers as returned by the
533 <tt>version</tt> and <tt>revision</tt> operators. The
534 required format is "(version) revision". Multiple
535 <tt>PSVersion</tt> attributes may be specified to
536 support multiple interpreter version numbers. If not
537 specified, "(3010) 705" and "(3010) 707" are
538 assumed.</td>
539</tr>
540<tr>
541 <td><tt>TTRasterizer</tt></td>
542 <td>The type of TrueType
543 font rasterizer supported by the device, if any. The
544 supported values are <tt>None</tt>, <tt>Accept68k</tt>,
545 <tt>Type42</tt>, and <tt>TrueImage</tt>. If not
546 specified, <tt>None</tt> is assumed.</td>
547</tr>
548</table></div>
549
550<h3>Query Commands</h3>
551
552<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>
553
554<pre class='example'>
555<a href='ref-ppdcfile.html#Attribute'>Attribute</a> "?PageSize" "" "
556 save
557 currentpagedevice /PageSize get aload pop
558 2 copy gt {exch} if (Unknown)
559 23 dict
560 dup [612 792] (Letter) put
561 dup [612 1008] (Legal) put
562 dup [595 842] (A4) put
f3c17241 563 {exch aload pop 4 index sub abs 5 le exch
28b9d139
MS
564 5 index sub abs 5 le and
565 {exch pop exit} {pop} ifelse
566 } bind forall = flush pop pop
567 restore"
568</pre>
569
570<p>Query commands can span multiple lines, however no single line may contain more than 255 characters.</p>
571
572<h3><a name='IMPORT'>Importing Existing PPD Files</a></h3>
573
574<P>CUPS includes a utility called <a href='man-ppdi.html'>ppdi(1)</a>
575which allows you to import existing PPD files into the driver information file
576format used by the PPD compiler <a href='man-ppdc.html'>ppdc(1)</a>. Once
577imported, you can modify, localize, and regenerate the PPD files easily. Type
578the following command to import the PPD file <VAR>mydevice.ppd</VAR> into the
579driver information file <VAR>mydevice.drv</VAR>:</P>
580
581<pre class='command'>
582ppdi -o mydevice.drv mydevice.ppd
583</pre>
584
585<P>If you have a whole directory of PPD files that you would like to import,
586you can list multiple filenames or use shell wildcards to import more than one
587PPD file on the command-line:</P>
588
589<pre class='command'>
590ppdi -o mydevice.drv mydevice1.ppd mydevice2.ppd
591ppdi -o mydevice.drv *.ppd
592</pre>
593
594<P>If the driver information file already exists, the new PPD
595file entries are appended to the end of the file. Each PPD file
596is placed in its own group of curly braces within the driver
597information file.</P>
598
599
600<h2 class='title'><a name='FILTERS'>Using Custom Filters</a></h2>
601
602<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>
603
604<pre class='example'>
605<a href='ref-ppdcfile.html#Filter'>Filter</a> application/vnd.cups-postscript 0 -
606</pre>
607
e4572d57
MS
608<h3>Custom Command Filters</h3>
609
610<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>
611
612<pre class='example'>
613<a href='ref-ppdcfile.html#Filter'>Filter</a> application/vnd.cups-command 100 /path/to/command/filter
614</pre>
615
616<p>To use the standard PostScript command filter, specify <var>commandtops</var> as the path to the command filter.</p>
617
618<h3>Custom PDF Filters</h3>
619
620<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>
621
622<pre class='example'>
623<a href='ref-ppdcfile.html#Filter'>Filter</a> application/vnd.cups-pdf 100 /path/to/pdf/filter
624</pre>
625
626<p>For unfiltered PDF files, use:</p>
627
628<pre class='example'>
629<a href='ref-ppdcfile.html#Filter'>Filter</a> application/pdf 100 /path/to/pdf/filter
630</pre>
631
632<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>
633
634<h3>Custom PostScript Filters</h3>
635
636<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>
637
638<pre class='example'>
639<a href='ref-ppdcfile.html#Filter'>Filter</a> application/vnd.cups-postscript 100 /path/to/postscript/filter
640</pre>
641
28b9d139
MS
642
643<h2 class='title'><a name='COLOR'>Implementing Color Management</a></h2>
644
178cb736 645<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 646
178cb736
MS
647<pre class='example'>
648<a href='ref-ppdcfile.html#Attribute'>Attribute</a> cupsICCProfile "ColorModel.MediaType.Resolution/Description" /path/to/ICC/profile
649</pre>
28b9d139 650
178cb736
MS
651<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>
652
653<pre class='example'>
654<a href='ref-ppdcfile.html#Attribute'>Attribute</a> cupsICCProfile "Gray../Grayscale Profile" /path/to/ICC/gray-profile
655<a href='ref-ppdcfile.html#Attribute'>Attribute</a> cupsICCProfile "RGB../Full Color Profile" /path/to/ICC/rgb-profile
656</pre>
28b9d139 657
178cb736 658<p>The options used for profile selection can be customized using the <tt>cupsICCQualifier2</tt> and <tt>cupsICCQualifier3</tt> attributes.</p>
28b9d139
MS
659
660
8072030b 661<h2 class='title'><a name='MACOSX'>Adding macOS Features</a></h2>
178cb736 662
8072030b 663<p>macOS 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 664
178cb736
MS
665<pre class='example'>
666<a href='ref-ppdcfile.html#Attribute'>Attribute</a> APDialogExtension "" /Library/Printers/Vendor/filename.plugin
667<a href='ref-ppdcfile.html#Attribute'>Attribute</a> APHelpBook "" /Library/Printers/Vendor/filename.bundle
668<a href='ref-ppdcfile.html#Attribute'>Attribute</a> APPrinterIconPath "" /Library/Printers/Vendor/filename.icns
669<a href='ref-ppdcfile.html#Attribute'>Attribute</a> APPrinterPreset "name/text" "*option choice ..."
670</pre>
8b450588 671</div>
28b9d139
MS
672</body>
673</html>