]> git.ipfire.org Git - thirdparty/cups.git/blame - doc/help/postscript-driver.html
Documentation updates.
[thirdparty/cups.git] / doc / help / postscript-driver.html
CommitLineData
abacc52b 1<!doctype html>
8b450588 2<html>
28b9d139 3<!-- SECTION: Programming -->
abacc52b
MS
4 <head>
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.11">
9 <meta name="author" content="Unknown">
10 <meta name="copyright" content="Unknown">
53af7f21 11 <meta name="version" content="0.0">
abacc52b 12 <style type="text/css"><!--
8b450588
MS
13BODY {
14 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
15}
16
17H1, H2, H3, H4, H5, H6, P, TD, TH {
18 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
19}
20
21KBD {
22 font-family: monaco, courier, monospace;
23 font-weight: bold;
24}
25
26PRE {
27 font-family: monaco, courier, monospace;
28}
29
30PRE.command {
10d09e33 31 border: dotted thin #7f7f7f;
8b450588 32 margin-left: 36pt;
10d09e33 33 padding: 10px;
8b450588
MS
34}
35
f11a948a
MS
36P.compact {
37 margin: 0;
38}
39
8b450588
MS
40P.example {
41 font-style: italic;
42 margin-left: 36pt;
43}
ca6b43fc 44
240214ef
MS
45DL.man DD {
46 margin-left: 5em;
47}
48
49DL.man DT {
50 margin-left: 0;
51}
52
53PRE.man {
54 margin: 0;
55}
56
8b450588
MS
57PRE.example {
58 background: #eeeeee;
59 border: dotted thin #999999;
60 margin-left: 36pt;
178cb736 61 padding: 10pt;
8b450588
MS
62}
63
64PRE.command EM, PRE.example EM {
65 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
66}
67
68P.command {
69 font-family: monaco, courier, monospace;
70 margin-left: 36pt;
71}
72
73P.formula {
74 font-style: italic;
75 margin-left: 36pt;
76}
77
78BLOCKQUOTE {
178cb736 79 background: #eeeeee;
8b450588
MS
80 border: solid thin #999999;
81 padding: 10pt;
82}
83
84A IMG {
85 border: none;
86}
87
88A:link:hover IMG {
89 background: #f0f0f0;
90 border-radius: 10px;
91 -moz-border-radius: 10px;
92}
93
94A:link, A:visited {
ca6b43fc 95 font-weight: inherit;
8b450588
MS
96 text-decoration: none;
97}
98
99A:link:hover, A:visited:hover, A:active {
100 text-decoration: underline;
101}
102
103SUB, SUP {
104 font-size: 50%;
105}
106
107TR.data, TD.data, TR.data TD {
108 margin-top: 10pt;
109 padding: 5pt;
110 border-bottom: solid 1pt #999999;
111}
112
113TR.data TH {
114 border-bottom: solid 1pt #999999;
115 padding-top: 10pt;
116 padding-left: 5pt;
117 text-align: left;
118}
119
120DIV.table TABLE {
121 border: solid thin #999999;
122 border-collapse: collapse;
123 border-spacing: 0;
124 margin-left: auto;
125 margin-right: auto;
126}
127
128DIV.table CAPTION {
129 caption-side: top;
130 font-size: 120%;
131 font-style: italic;
132 font-weight: bold;
133 margin-left: auto;
134 margin-right: auto;
135}
136
137DIV.table TABLE TD {
138 border: solid thin #cccccc;
139 padding-top: 5pt;
140}
141
142DIV.table TABLE TH {
143 background: #cccccc;
144 border: none;
145 border-bottom: solid thin #999999;
146}
147
148DIV.figure TABLE {
149 margin-left: auto;
150 margin-right: auto;
151}
152
153DIV.figure CAPTION {
154 caption-side: bottom;
155 font-size: 120%;
156 font-style: italic;
157 font-weight: bold;
158 margin-left: auto;
159 margin-right: auto;
160}
161
162TH.label {
163 text-align: right;
164 vertical-align: top;
165}
166
167TH.sublabel {
168 text-align: right;
169 font-weight: normal;
170}
171
172HR {
173 border: solid thin;
174}
175
176SPAN.info {
177 background: black;
178 border: thin solid black;
179 color: white;
180 font-size: 80%;
181 font-style: italic;
182 font-weight: bold;
183 white-space: nowrap;
184}
185
186H2 SPAN.info, H3 SPAN.info, H4 SPAN.info {
187 float: right;
188 font-size: 100%;
189}
190
178cb736
MS
191H1.title {
192}
193
8b450588
MS
194H2.title, H3.title {
195 border-bottom: solid 2pt #000000;
196}
197
198DIV.indent, TABLE.indent {
199 margin-top: 2em;
200 margin-left: auto;
201 margin-right: auto;
202 width: 90%;
203}
204
205TABLE.indent {
206 border-collapse: collapse;
207}
208
209TABLE.indent TD, TABLE.indent TH {
210 padding: 0;
211}
212
213TABLE.list {
214 border-collapse: collapse;
215 margin-left: auto;
216 margin-right: auto;
217 width: 90%;
218}
219
220TABLE.list TH {
221 background: white;
222 border-bottom: solid thin #cccccc;
223 color: #444444;
224 padding-top: 10pt;
225 padding-left: 5pt;
226 text-align: left;
227 vertical-align: bottom;
228 white-space: nowrap;
229}
230
231TABLE.list TH A {
232 color: #4444cc;
233}
234
235TABLE.list TD {
236 border-bottom: solid thin #eeeeee;
237 padding-top: 5pt;
238 padding-left: 5pt;
239}
240
241TABLE.list TR:nth-child(even) {
242 background: #f8f8f8;
243}
244
245TABLE.list TR:nth-child(odd) {
246 background: #f4f4f4;
247}
248
249DT {
250 margin-left: 36pt;
251 margin-top: 12pt;
252}
253
254DD {
255 margin-left: 54pt;
256}
257
258DL.category DT {
259 font-weight: bold;
260}
261
262P.summary {
263 margin-left: 36pt;
264 font-family: monaco, courier, monospace;
265}
266
267DIV.summary TABLE {
268 border: solid thin #999999;
269 border-collapse: collapse;
270 border-spacing: 0;
271 margin: 10px;
272}
273
274DIV.summary TABLE TD, DIV.summary TABLE TH {
275 border: solid thin #999999;
276 padding: 5px;
277 text-align: left;
278 vertical-align: top;
279}
280
281DIV.summary TABLE THEAD TH {
282 background: #eeeeee;
283}
284
285/* API documentation styles... */
286div.body h1 {
287 margin: 0;
288}
289div.body h2 {
290 margin-top: 1.5em;
291}
292div.body h3, div.body h4, div.body h5 {
293 margin-bottom: 0.5em;
294 margin-top: 1.5em;
295}
296.class, .enumeration, .function, .struct, .typedef, .union {
297 border-bottom: solid thin #999999;
298 margin-bottom: 0;
299 margin-top: 2em;
300}
301.description {
302 margin-top: 0.5em;
303}
304code, p.code, pre, ul.code li {
305 font-family: monaco, courier, monospace;
306 font-size: 90%;
307}
308ul.code, ul.contents, ul.subcontents {
309 list-style-type: none;
310 margin: 0;
311 padding-left: 0;
312}
313ul.code li {
314 margin: 0;
315}
316ul.contents > li {
317 margin-top: 1em;
318}
319ul.contents li ul.code, ul.contents li ul.subcontents {
320 padding-left: 2em;
321}
322div.body dl {
323 margin-left: 0;
324 margin-top: 0;
325}
326div.body dt {
327 font-style: italic;
328 margin-left: 0;
329 margin-top: 0;
330}
331div.body dd {
332 margin-bottom: 0.5em;
333}
334
335/* This is just for the HTML files generated with the framedhelp target */
336div.contents {
337 background: #e8e8e8;
338 border: solid thin black;
339 padding: 10px;
340}
341div.contents h1 {
342 font-size: 110%;
343}
344div.contents h2 {
345 font-size: 100%;
346}
347div.contents ul.contents {
348 font-size: 80%;
349}
350div.contents ul.subcontents li {
351 margin-left: 1em;
352 text-indent: -1em;
353}
354--></style>
abacc52b
MS
355 </head>
356 <body>
10d09e33 357<!--
10d09e33
MS
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
8072030b 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 macOS 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>
abacc52b
MS
387 <div class="contents">
388 <h2 class="title">Contents</h2>
389 <ul class="contents">
390 <li><a href="#BASICS">Printer Driver Basics</a></li>
391 <li><a href="#CREATING">Creating New PPD Files</a><ul class="subcontents">
392 <li><a href="#IMPORT">Importing Existing PPD Files</a></li>
393 </ul></li>
394 <li><a href="#FILTERS">Using Custom Filters</a></li>
395 <li><a href="#COLOR">Implementing Color Management</a></li>
396 <li><a href="#MACOSX">Adding macOS Features</a></li>
397 </ul>
398 </div>
399 <div class="body">
28b9d139
MS
400<h2 class='title'><a name='BASICS'>Printer Driver Basics</a></h2>
401
402<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>
403
404<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>
405
406<div class='figure'><table summary='PostScript Filter Chain'>
407<caption>Figure 1: <a name='FIGURE_1'>PostScript Filter Chain</a></caption>
b0f6947b 408<tr><td><img src='../images/cups-postscript-chain.png' width='700' height='150' alt='PostScript Filter Chain'></td></tr>
28b9d139
MS
409</table></div>
410
411<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>
412
413<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>
414
415<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>
416
417<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>
418
419<div class='figure'><table summary='Command Filter Chain'>
420<caption>Figure 2: <a name='FIGURE_2'>Command Filter Chain</a></caption>
b0f6947b 421<tr><td><img src='../images/cups-command-chain.png' width='575' height='150' alt='Command Filter Chain'></td></tr>
28b9d139
MS
422</table></div>
423
424<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>
425
426
427<h2 class='title'><a name='CREATING'>Creating New PPD Files</a></h2>
428
429<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>
430
431<p class='example'>Listing 1: <a name='LISTING_1'>"examples/postscript.drv"</a></p>
432
433<pre class='example'>
434// Include standard font and media definitions
435<a href='ref-ppdcfile.html#_include'>#include</a> &lt;font.defs&gt;
436<a href='ref-ppdcfile.html#_include'>#include</a> &lt;media.defs&gt;
437
438// Specify this is a PostScript printer driver
439<a href='ref-ppdcfile.html#DriverType'>DriverType</a> ps
440
441// List the fonts that are supported, in this case all standard fonts
442<a href='ref-ppdcfile.html#Font'>Font</a> *
443
444// Manufacturer, model name, and version
445<a href='ref-ppdcfile.html#Manufacturer'>Manufacturer</a> "Foo"
446<a href='ref-ppdcfile.html#ModelName'>ModelName</a> "Foo LaserProofer 2000"
447<a href='ref-ppdcfile.html#Version'>Version</a> 1.0
448
449// PostScript printer attributes
450<a href='ref-ppdcfile.html#Attribute'>Attribute</a> DefaultColorSpace "" Gray
451<a href='ref-ppdcfile.html#Attribute'>Attribute</a> LandscapeOrientation "" Minus90
452<a href='ref-ppdcfile.html#Attribute'>Attribute</a> LanguageLevel "" "3"
453<a href='ref-ppdcfile.html#Attribute'>Attribute</a> Product "" "(Foo LaserProofer 2000)"
454<a href='ref-ppdcfile.html#Attribute'>Attribute</a> PSVersion "" "(3010) 0"
455<a href='ref-ppdcfile.html#Attribute'>Attribute</a> TTRasterizer "" Type42
456
457// Supported page sizes
458*<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> Letter
459<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> Legal
460<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> A4
461
462// Query command for page size
463<a href='ref-ppdcfile.html#Attribute'>Attribute</a> "?PageSize" "" "
464 save
465 currentpagedevice /PageSize get aload pop
466 2 copy gt {exch} if (Unknown)
467 23 dict
468 dup [612 792] (Letter) put
469 dup [612 1008] (Legal) put
470 dup [595 842] (A4) put
f3c17241 471 {exch aload pop 4 index sub abs 5 le exch
28b9d139
MS
472 5 index sub abs 5 le and
473 {exch pop exit} {pop} ifelse
474 } bind forall = flush pop pop
475 restore"
476
477// Specify the name of the PPD file we want to generate
478<a href='ref-ppdcfile.html#PCFileName'>PCFileName</a> "fooproof.ppd"
479</pre>
480
481<h3>Required Attributes</h3>
482
483<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>
484
485<pre class='example'>
486<a href='ref-ppdcfile.html#Attribute'>Attribute</a> DefaultColorSpace "" Gray
487<a href='ref-ppdcfile.html#Attribute'>Attribute</a> LandscapeOrientation "" Minus90
488<a href='ref-ppdcfile.html#Attribute'>Attribute</a> LanguageLevel "" "3"
489<a href='ref-ppdcfile.html#Attribute'>Attribute</a> Product "" "(Foo LaserProofer 2000)"
490<a href='ref-ppdcfile.html#Attribute'>Attribute</a> PSVersion "" "(3010) 0"
491<a href='ref-ppdcfile.html#Attribute'>Attribute</a> TTRasterizer "" Type42
492</pre>
493
494<div class='table'><table summary='Required PostScript Printer Driver Attributes'>
495<caption>Table 1: <a name='TABLE_1'>Required PostScript Printer Driver Attributes</a></caption>
496<thead>
497<tr>
498 <th>Attribute</th>
499 <th>Description</th>
500</tr>
501</thead>
502<tbody>
503<tr>
504 <td><tt>DefaultColorSpace</tt></td>
505 <td>The default colorspace:
506 <tt>Gray</tt>, <tt>RGB</tt>, <tt>CMY</tt>, or
507 <tt>CMYK</tt>. If not specified, then <tt>RGB</tt> is
508 assumed.</td>
509</tr>
510<tr>
511 <td><tt>LandscapeOrientation</tt></td>
512 <td>The preferred landscape
513 orientation: <tt>Plus90</tt>, <tt>Minus90</tt>, or
514 <tt>Any</tt>. If not specified, <tt>Plus90</tt> is
515 assumed.</td>
516</tr>
517<tr>
518 <td><tt>LanguageLevel</tt></td>
519 <td>The PostScript language
520 level supported by the device: 1, 2, or 3. If not
521 specified, 2 is assumed.</td>
522</tr>
523<tr>
524 <td><tt>Product</tt></td>
525 <td>The string returned by
526 the PostScript <tt>product</tt> operator, which
527 <i>must</i> include parenthesis to conform with
528 PostScript syntax rules for strings. Multiple
529 <tt>Product</tt> attributes may be specified to support
530 multiple products with the same PPD file. If not
531 specified, "(ESP Ghostscript)" and "(GNU Ghostscript)"
532 are assumed.</td>
533</tr>
534<tr>
535 <td><tt>PSVersion</tt></td>
536 <td>The PostScript
537 interpreter version numbers as returned by the
538 <tt>version</tt> and <tt>revision</tt> operators. The
539 required format is "(version) revision". Multiple
540 <tt>PSVersion</tt> attributes may be specified to
541 support multiple interpreter version numbers. If not
542 specified, "(3010) 705" and "(3010) 707" are
543 assumed.</td>
544</tr>
545<tr>
546 <td><tt>TTRasterizer</tt></td>
547 <td>The type of TrueType
548 font rasterizer supported by the device, if any. The
549 supported values are <tt>None</tt>, <tt>Accept68k</tt>,
550 <tt>Type42</tt>, and <tt>TrueImage</tt>. If not
551 specified, <tt>None</tt> is assumed.</td>
552</tr>
553</table></div>
554
555<h3>Query Commands</h3>
556
557<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>
558
559<pre class='example'>
560<a href='ref-ppdcfile.html#Attribute'>Attribute</a> "?PageSize" "" "
561 save
562 currentpagedevice /PageSize get aload pop
563 2 copy gt {exch} if (Unknown)
564 23 dict
565 dup [612 792] (Letter) put
566 dup [612 1008] (Legal) put
567 dup [595 842] (A4) put
f3c17241 568 {exch aload pop 4 index sub abs 5 le exch
28b9d139
MS
569 5 index sub abs 5 le and
570 {exch pop exit} {pop} ifelse
571 } bind forall = flush pop pop
572 restore"
573</pre>
574
575<p>Query commands can span multiple lines, however no single line may contain more than 255 characters.</p>
576
577<h3><a name='IMPORT'>Importing Existing PPD Files</a></h3>
578
579<P>CUPS includes a utility called <a href='man-ppdi.html'>ppdi(1)</a>
580which allows you to import existing PPD files into the driver information file
581format used by the PPD compiler <a href='man-ppdc.html'>ppdc(1)</a>. Once
582imported, you can modify, localize, and regenerate the PPD files easily. Type
583the following command to import the PPD file <VAR>mydevice.ppd</VAR> into the
584driver information file <VAR>mydevice.drv</VAR>:</P>
585
586<pre class='command'>
587ppdi -o mydevice.drv mydevice.ppd
588</pre>
589
590<P>If you have a whole directory of PPD files that you would like to import,
591you can list multiple filenames or use shell wildcards to import more than one
592PPD file on the command-line:</P>
593
594<pre class='command'>
595ppdi -o mydevice.drv mydevice1.ppd mydevice2.ppd
596ppdi -o mydevice.drv *.ppd
597</pre>
598
599<P>If the driver information file already exists, the new PPD
600file entries are appended to the end of the file. Each PPD file
601is placed in its own group of curly braces within the driver
602information file.</P>
603
604
605<h2 class='title'><a name='FILTERS'>Using Custom Filters</a></h2>
606
607<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>
608
609<pre class='example'>
610<a href='ref-ppdcfile.html#Filter'>Filter</a> application/vnd.cups-postscript 0 -
611</pre>
612
e4572d57
MS
613<h3>Custom Command Filters</h3>
614
615<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>
616
617<pre class='example'>
618<a href='ref-ppdcfile.html#Filter'>Filter</a> application/vnd.cups-command 100 /path/to/command/filter
619</pre>
620
621<p>To use the standard PostScript command filter, specify <var>commandtops</var> as the path to the command filter.</p>
622
623<h3>Custom PDF Filters</h3>
624
625<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>
626
627<pre class='example'>
628<a href='ref-ppdcfile.html#Filter'>Filter</a> application/vnd.cups-pdf 100 /path/to/pdf/filter
629</pre>
630
631<p>For unfiltered PDF files, use:</p>
632
633<pre class='example'>
634<a href='ref-ppdcfile.html#Filter'>Filter</a> application/pdf 100 /path/to/pdf/filter
635</pre>
636
637<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>
638
639<h3>Custom PostScript Filters</h3>
640
641<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>
642
643<pre class='example'>
644<a href='ref-ppdcfile.html#Filter'>Filter</a> application/vnd.cups-postscript 100 /path/to/postscript/filter
645</pre>
646
28b9d139
MS
647
648<h2 class='title'><a name='COLOR'>Implementing Color Management</a></h2>
649
178cb736 650<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 651
178cb736
MS
652<pre class='example'>
653<a href='ref-ppdcfile.html#Attribute'>Attribute</a> cupsICCProfile "ColorModel.MediaType.Resolution/Description" /path/to/ICC/profile
654</pre>
28b9d139 655
178cb736
MS
656<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>
657
658<pre class='example'>
659<a href='ref-ppdcfile.html#Attribute'>Attribute</a> cupsICCProfile "Gray../Grayscale Profile" /path/to/ICC/gray-profile
660<a href='ref-ppdcfile.html#Attribute'>Attribute</a> cupsICCProfile "RGB../Full Color Profile" /path/to/ICC/rgb-profile
661</pre>
28b9d139 662
178cb736 663<p>The options used for profile selection can be customized using the <tt>cupsICCQualifier2</tt> and <tt>cupsICCQualifier3</tt> attributes.</p>
28b9d139
MS
664
665
8072030b 666<h2 class='title'><a name='MACOSX'>Adding macOS Features</a></h2>
178cb736 667
8072030b 668<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 669
178cb736
MS
670<pre class='example'>
671<a href='ref-ppdcfile.html#Attribute'>Attribute</a> APDialogExtension "" /Library/Printers/Vendor/filename.plugin
672<a href='ref-ppdcfile.html#Attribute'>Attribute</a> APHelpBook "" /Library/Printers/Vendor/filename.bundle
673<a href='ref-ppdcfile.html#Attribute'>Attribute</a> APPrinterIconPath "" /Library/Printers/Vendor/filename.icns
674<a href='ref-ppdcfile.html#Attribute'>Attribute</a> APPrinterPreset "name/text" "*option choice ..."
675</pre>
abacc52b
MS
676 </div>
677 </body>
28b9d139 678</html>