]> git.ipfire.org Git - thirdparty/cups.git/blame - doc/help/raster-driver.html
Changelog.
[thirdparty/cups.git] / doc / help / raster-driver.html
CommitLineData
abacc52b 1<!doctype html>
8b450588 2<html>
e4572d57 3<!-- SECTION: Programming -->
abacc52b
MS
4 <head>
5 <title>Developing Raster 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}
e4572d57 29
699fe020
MS
30BLOCKQUOTE {
31 border-left: solid 2px #777;
32 margin: 1em 0;
33 padding: 10px;
34}
35
36BLOCKQUOTE OL LI {
37 margin-left: -1em;
38}
39
40PRE.command, PRE.example {
41 background: #eee;
42 margin: 0 36pt;
10d09e33 43 padding: 10px;
8b450588
MS
44}
45
f11a948a
MS
46P.compact {
47 margin: 0;
48}
49
8b450588
MS
50P.example {
51 font-style: italic;
52 margin-left: 36pt;
53}
ca6b43fc 54
240214ef
MS
55DL.man DD {
56 margin-left: 5em;
57}
58
59DL.man DT {
60 margin-left: 0;
61}
62
63PRE.man {
64 margin: 0;
65}
66
8b450588
MS
67PRE.command EM, PRE.example EM {
68 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
69}
70
71P.command {
72 font-family: monaco, courier, monospace;
73 margin-left: 36pt;
74}
75
76P.formula {
77 font-style: italic;
78 margin-left: 36pt;
79}
80
8b450588
MS
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;
699fe020 136 padding: 5pt 10pt 0;
8b450588
MS
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 {
699fe020
MS
284 font-size: 250%;
285 font-weight: bold;
8b450588
MS
286 margin: 0;
287}
288div.body h2 {
699fe020 289 font-size: 250%;
8b450588
MS
290 margin-top: 1.5em;
291}
699fe020
MS
292div.body h3 {
293 font-size: 150%;
8b450588
MS
294 margin-bottom: 0.5em;
295 margin-top: 1.5em;
296}
699fe020
MS
297div.body h4 {
298 font-size: 110%;
299 margin-bottom: 0.5em;
300 margin-top: 1.5em;
301}
302div.body h5 {
303 font-size: 100%;
304 margin-bottom: 0.5em;
305 margin-top: 1.5em;
306}
307div.contents {
308 background: #e8e8e8;
309 border: solid thin black;
310 padding: 10px;
311}
312div.contents h1 {
313 font-size: 110%;
314}
315div.contents h2 {
316 font-size: 100%;
317}
318div.contents ul.contents {
319 font-size: 80%;
320}
321.class {
322 border-bottom: solid 2px gray;
323}
324.constants {
8b450588
MS
325}
326.description {
327 margin-top: 0.5em;
328}
699fe020
MS
329.discussion {
330}
331.enumeration {
332 border-bottom: solid 2px gray;
333}
334.function {
335 border-bottom: solid 2px gray;
336 margin-bottom: 0;
337}
338.members {
339}
340.method {
341}
342.parameters {
343}
344.returnvalue {
345}
346.struct {
347 border-bottom: solid 2px gray;
348}
349.typedef {
350 border-bottom: solid 2px gray;
351}
352.union {
353 border-bottom: solid 2px gray;
354}
355.variable {
356}
357h1, h2, h3, h4, h5, h6 {
358 page-break-inside: avoid;
359}
360blockquote {
361 border: solid thin gray;
362 box-shadow: 3px 3px 5px rgba(0,0,0,0.5);
363 padding: 0px 10px;
364 page-break-inside: avoid;
365}
366p code, li code, p.code, pre, ul.code li {
367 background: rgba(127,127,127,0.1);
368 border: thin dotted gray;
369 font-family: monospace;
8b450588 370 font-size: 90%;
699fe020
MS
371 hyphens: manual;
372 -webkit-hyphens: manual;
373 page-break-inside: avoid;
374}
375p.code, pre, ul.code li {
376 padding: 10px;
377}
378p code, li code {
379 padding: 2px 5px;
380}
381a:link, a:visited {
382 text-decoration: none;
383}
384span.info {
385 background: black;
386 border: solid thin black;
387 color: white;
388 font-size: 80%;
389 font-style: italic;
390 font-weight: bold;
391 white-space: nowrap;
392}
393h3 span.info, h4 span.info {
394 border-top-left-radius: 10px;
395 border-top-right-radius: 10px;
396 float: right;
397 padding: 3px 6px;
8b450588
MS
398}
399ul.code, ul.contents, ul.subcontents {
400 list-style-type: none;
401 margin: 0;
402 padding-left: 0;
403}
404ul.code li {
405 margin: 0;
406}
407ul.contents > li {
408 margin-top: 1em;
409}
410ul.contents li ul.code, ul.contents li ul.subcontents {
411 padding-left: 2em;
412}
699fe020
MS
413table.list {
414 border-collapse: collapse;
415 width: 100%;
416}
417table.list tr:nth-child(even) {
418 background: rgba(127,127,127,0.1);]n}
419table.list th {
420 border-right: 2px solid gray;
421 font-family: monospace;
422 padding: 5px 10px 5px 2px;
423 text-align: right;
424 vertical-align: top;
8b450588 425}
699fe020
MS
426table.list td {
427 padding: 5px 2px 5px 10px;
428 text-align: left;
429 vertical-align: top;
8b450588 430}
699fe020 431h1.title {
8b450588 432}
699fe020
MS
433h2.title {
434 border-bottom: solid 2px black;
8b450588 435}
699fe020
MS
436h3.title {
437 border-bottom: solid 2px black;
8b450588
MS
438}
439--></style>
abacc52b
MS
440 </head>
441 <body>
10d09e33 442<!--
10d09e33
MS
443 Raster printer driver documentation for CUPS.
444
f3c17241 445 Copyright 2007-2012 by Apple Inc.
10d09e33
MS
446 Copyright 1997-2007 by Easy Software Products.
447
448 These coded instructions, statements, and computer programs are the
449 property of Apple Inc. and are protected by Federal copyright
450 law. Distribution and use rights are outlined in the file "LICENSE.txt"
451 which should have been included with this file. If this file is
452 file is missing or damaged, see the license at "http://www.cups.org/".
453-->
454
178cb736
MS
455<h1 class='title'>Developing Raster Printer Drivers</h1>
456
8072030b 457<p>This document describes how to develop printer drivers for raster printers. Topics include: <a href='#BASICS'>printer driver basics</a>, <a href='#CREATE'>creating new PPD files</a>, <a href='#FILTERS'>using filters</a>, <a href='#COLOR'>implementing color management</a>, and <a href='#MACOSX'>adding macOS features</a>.</p>
e4572d57
MS
458
459<div class='summary'><table summary='General Information'>
460<tbody>
461<tr>
462 <th>See Also</th>
463 <td>Programming: <a href='postscript-driver.html'>Developing PostScript Printer Drivers</a><br>
464 Programming: <a href='api-filter.html'>Filter and Backend Programming</a><br>
465 Programming: <a href='ppd-compiler.html'>Introduction to the PPD Compiler</a><br>
466 Programming: <a href='api-raster.html'>Raster API</a><br>
467 References: <a href='ref-ppdcfile.html'>PPD Compiler Driver Information File Reference</a><br>
468 Specifications: <a href='spec-ppd.html'>CUPS PPD Extensions</a></td>
469</tr>
470</tbody>
471</table></div>
abacc52b
MS
472 <div class="contents">
473 <h2 class="title">Contents</h2>
474 <ul class="contents">
475 <li><a href="#BASICS">Printer Driver Basics</a></li>
476 <li><a href="#CREATING">Creating New PPD Files</a></li>
477 <li><a href="#FILTERS">Using Filters</a></li>
478 <li><a href="#COLOR">Implementing Color Management</a></li>
479 <li><a href="#MACOSX">Adding macOS Features</a></li>
480 </ul>
481 </div>
482 <div class="body">
e4572d57
MS
483<h2 class='title'><a name='BASICS'>Printer Driver Basics</a></h2>
484
485<p>A CUPS raster printer driver consists of a PostScript Printer Description (PPD) file that describes the features and capabilities of the device, one 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>
486
487<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 CUPS raster data. <a href='#FIGURE_1'>Figure 1</a> shows the data flow of a typical print job.</p>
488
489<div class='figure'><table summary='Raster Filter Chain'>
490<caption>Figure 1: <a name='FIGURE_1'>Raster Filter Chain</a></caption>
b0f6947b 491<tr><td><img src='../images/cups-raster-chain.png' width='700' height='150' alt='Raster Filter Chain'></td></tr>
e4572d57
MS
492</table></div>
493
494<p>The raster filter converts CUPS raster data into a format the printer understands, for example HP-PCL. CUPS includes several sample raster filters supporting standard page description languages (PDLs). <a href='#TABLE_1'>Table 1</a> shows the raster filters that are bundled with CUPS and the languages they support.</p>
495
496<div class='table'><table summary='Standard CUPS Raster Filters'>
497<caption>Table 1: <a name='TABLE_1'>Standard CUPS Raster Filters</a></caption>
498<thead>
499<tr><th>Filter</th><th>PDLs</th><th>ppdc DriverType</th><th>ppdc #include file</th></tr>
500</thead>
501<tbody>
502<tr><td>rastertoepson</td><td>ESC/P, ESC/P2</td><td>epson</td><td>epson.h</td></tr>
503<tr><td>rastertoescpx</td><td>ESC/P, ESC/P2, EPSON Remote Mode</td><td>escp</td><td>escp.h</td></tr>
504<tr><td>rastertohp</td><td>HP-PCL3, HP-PCL5</td><td>hp</td><td>hp.h</td></tr>
505<tr><td>rastertolabel</td><td>CPCL, Dymo, EPL1, EPL2, Intellitech PCL, ZPL</td><td>label</td><td>label.h</td></tr>
506<tr><td>rastertopclx</td><td>HP-RTL, HP-PCL3, HP-PCL3GUI, HP-PCL5, HP-PCL5c, HP-PCL5e</td><td>pcl</td><td>pcl.h</td></tr>
507</tbody>
508</table></div>
509
510<p>The optional port monitor handles interface-specific protocol or encoding issues. For example, some raster printers use the 1284.4 communications protocol.</p>
511
512<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>
513
514<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>
515
516<div class='figure'><table summary='Command Filter Chain'>
517<caption>Figure 2: <a name='FIGURE_2'>Command Filter Chain</a></caption>
b0f6947b 518<tr><td><img src='../images/cups-command-chain.png' width='575' height='150' alt='Command Filter Chain'></td></tr>
e4572d57
MS
519</table></div>
520
521<p>Raster printer drivers must provide their own command filter.</p>
522
523
524<h2 class='title'><a name='CREATING'>Creating New PPD Files</a></h2>
525
526<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 several similar black-and-white HP-PCL5 laser printers.</p>
527
528<p class='example'>Listing 1: <a name='LISTING_1'>"examples/laserjet-basic.drv"</a></p>
529
530<pre class='example'>
531<I>// Include standard font and media definitions</I>
532<a href='ref-ppdcfile.html#_include'>#include</a> &lt;font.defs&gt;
533<a href='ref-ppdcfile.html#_include'>#include</a> &lt;media.defs&gt;
534
535<I>// Include HP-PCL driver definitions</I>
536<a href='ref-ppdcfile.html#_include'>#include</a> &lt;pcl.h&gt;
537
538<I>// Specify that this driver uses the HP-PCL driver...</I>
539<a href='ref-ppdcfile.html#DriverType'>DriverType</a> pcl
540
541<I>// Specify the driver options via the model number...</I>
542<a href='ref-ppdcfile.html#ModelNumber'>ModelNumber</a> ($PCL_PAPER_SIZE $PCL_PJL $PCL_PJL_RESOLUTION)
543
544<I>// List the fonts that are supported, in this case all standard fonts...</I>
545<a href='ref-ppdcfile.html#Font'>Font</a> *
546
547<I>// Manufacturer and driver version</I>
548<a href='ref-ppdcfile.html#Manufacturer'>Manufacturer</a> "HP"
549<a href='ref-ppdcfile.html#Version'>Version</a> 1.0
550
551<I>// Supported page sizes and their margins</I>
552<a href='ref-ppdcfile.html#HWMargins'>HWMargins</a> 18 12 18 12
553*<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> Letter
554<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> Legal
555<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> Executive
556<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> Monarch
557<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> Statement
558<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> FanFoldGermanLegal
559
560<a href='ref-ppdcfile.html#HWMargins'>HWMargins</a> 18 12.72 18 12.72
561<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> Env10
562
563<a href='ref-ppdcfile.html#HWMargins'>HWMargins</a> 9.72 12 9.72 12
564<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> A4
565<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> A5
566<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> B5
567<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> EnvC5
568<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> EnvDL
569<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> EnvISOB5
570<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> Postcard
571<a href='ref-ppdcfile.html#MediaSize'>MediaSize</a> DoublePostcard
572
573<I>// Only black-and-white output with mode 3 compression...</I>
574<a href='ref-ppdcfile.html#ColorModel'>ColorModel</a> Gray k chunky 3
575
576<I>// Supported resolutions</I>
577<a href='ref-ppdcfile.html#Resolution'>Resolution</a> - 1 0 0 0 "300dpi/300 DPI"
578*<a href='ref-ppdcfile.html#Resolution'>Resolution</a> - 8 0 0 0 "600dpi/600 DPI"
579
580<I>// Supported input slots</I>
581*<a href='ref-ppdcfile.html#InputSlot'>InputSlot</a> 7 "Auto/Automatic Selection"
582<a href='ref-ppdcfile.html#InputSlot'>InputSlot</a> 2 "Manual/Tray 1 - Manual Feed"
583<a href='ref-ppdcfile.html#InputSlot'>InputSlot</a> 4 "Upper/Tray 1"
584<a href='ref-ppdcfile.html#InputSlot'>InputSlot</a> 1 "Lower/Tray 2"
585<a href='ref-ppdcfile.html#InputSlot'>InputSlot</a> 5 "LargeCapacity/Tray 3"
586
587<I>// Tray 3 is an option...</I>
588<a href='ref-ppdcfile.html#Installable'>Installable</a> "OptionLargeCapacity/Tray 3 Installed"
589<a href='ref-ppdcfile.html#UIConstraints'>UIConstraints</a> "*OptionLargeCapacity False *InputSlot LargeCapacity"
590
591{
592 <I>// HP LaserJet 2100 Series</I>
593 <a href='ref-ppdcfile.html#Throughput'>Throughput</a> 10
594 <a href='ref-ppdcfile.html#ModelName'>ModelName</a> "LaserJet 2100 Series"
595 <a href='ref-ppdcfile.html#PCFileName'>PCFileName</a> "hpljt211.ppd"
596}
597
598{
599 <I>// LaserJet 2200 and 2300 series have duplexer option...</I>
600 <a href='ref-ppdcfile.html#Duplex'>Duplex</a> normal
601 <a href='ref-ppdcfile.html#Installable'>Installable</a> "OptionDuplex/Duplexer Installed"
602 <a href='ref-ppdcfile.html#UIConstraints'>UIConstraints</a> "*OptionDuplex False *Duplex"
603
604 {
605 <I>// HP LaserJet 2200 Series</I>
606 <a href='ref-ppdcfile.html#Throughput'>Throughput</a> 19
607 <a href='ref-ppdcfile.html#ModelName'>ModelName</a> "LaserJet 2200 Series"
608 <a href='ref-ppdcfile.html#PCFileName'>PCFileName</a> "hpljt221.ppd"
609 }
610
611 {
612 <I>// HP LaserJet 2300 Series</I>
613 <a href='ref-ppdcfile.html#Throughput'>Throughput</a> 25
614 <a href='ref-ppdcfile.html#ModelName'>ModelName</a> "LaserJet 2300 Series"
615 <a href='ref-ppdcfile.html#PCFileName'>PCFileName</a> "hpljt231.ppd"
616 }
617}
618</pre>
619
620
621<h2 class='title'><a name='FILTERS'>Using Filters</a></h2>
622
623<p>The standard CUPS raster filters can be specified using the
624<a href='ref-ppdcfile.html#DriverType'><tt>DriverType</tt></a> directive, for example:</p>
625
626<pre class='example'>
627<I>// Specify that this driver uses the HP-PCL driver...</I>
628<a href='ref-ppdcfile.html#DriverType'>DriverType</a> pcl
629</pre>
630
631<p><a href='#TABLE_1'>Table 1</a> shows the driver types for each of the standard CUPS raster filters. For drivers that do not use the standard raster filters, the "custom" type is used with <a href='ref-ppdcfile.html#Filter'><tt>Filter</tt></a> directives:</p>
632
633<pre class='example'>
634<a href='ref-ppdcfile.html#DriverType'>DriverType</a> custom
635<a href='ref-ppdcfile.html#Filter'>Filter</a> application/vnd.cups-raster 100 /path/to/raster/filter
636<a href='ref-ppdcfile.html#Filter'>Filter</a> application/vnd.cups-command 100 /path/to/command/filter
637</pre>
638
639
640<h2 class='title'><a name='COLOR'>Implementing Color Management</a></h2>
641
178cb736 642<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>
e4572d57 643
178cb736
MS
644<pre class='example'>
645<a href='ref-ppdcfile.html#Attribute'>Attribute</a> cupsICCProfile "ColorModel.MediaType.Resolution/Description" /path/to/ICC/profile
646</pre>
e4572d57 647
178cb736
MS
648<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>
649
650<pre class='example'>
651<a href='ref-ppdcfile.html#Attribute'>Attribute</a> cupsICCProfile "Gray../Grayscale Profile" /path/to/ICC/gray-profile
652<a href='ref-ppdcfile.html#Attribute'>Attribute</a> cupsICCProfile "RGB../Full Color Profile" /path/to/ICC/rgb-profile
653</pre>
654
655<p>The options used for profile selection can be customized using the <tt>cupsICCQualifier2</tt> and <tt>cupsICCQualifier3</tt> attributes.</p>
e4572d57 656
8072030b 657<h3><span class='info'>Since macOS 10.5</span>Custom Color Matching Support</h3>
e4572d57 658
8072030b 659<p>macOS printer drivers that are based on an existing standard RGB colorspace can tell the system to use the corresponding colorspace instead of an arbitrary ICC color profile when doing color management. The <a href='#APCustom'><tt>APSupportsCustomColorMatching</tt></a> and <tt>APDefaultCustomColorMatchingProfile</tt> attributes can be used to enable this mode:</p>
178cb736
MS
660
661<pre class='example'>
662<a href='ref-ppdcfile.html#Attribute'>Attribute</a> APSupportsCustomColorMatching "" true
663<a href='ref-ppdcfile.html#Attribute'>Attribute</a> APDefaultCustomColorMatchingProfile "" sRGB
664</pre>
e4572d57 665
e4572d57 666
8072030b 667<h2 class='title'><a name='MACOSX'>Adding macOS Features</a></h2>
178cb736 668
8072030b 669<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>
178cb736
MS
670
671<pre class='example'>
672<a href='ref-ppdcfile.html#Attribute'>Attribute</a> APDialogExtension "" /Library/Printers/Vendor/filename.plugin
673<a href='ref-ppdcfile.html#Attribute'>Attribute</a> APHelpBook "" /Library/Printers/Vendor/filename.bundle
674<a href='ref-ppdcfile.html#Attribute'>Attribute</a> APPrinterIconPath "" /Library/Printers/Vendor/filename.icns
675<a href='ref-ppdcfile.html#Attribute'>Attribute</a> APPrinterPreset "name/text" "*option choice ..."
676</pre>
abacc52b
MS
677 </div>
678 </body>
e4572d57 679</html>