]> git.ipfire.org Git - thirdparty/cups.git/blame - ppdc/foo.drv
Import CUPS v1.7.1
[thirdparty/cups.git] / ppdc / foo.drv
CommitLineData
ac884b6a 1//
61515785 2// "$Id: foo.drv 3247 2011-05-12 06:22:31Z msweet $"
ac884b6a 3//
321d8d57 4// PPD file compiler test data file for CUPS.
ac884b6a 5//
321d8d57 6// Copyright 2007-2011 by Apple Inc.
ac884b6a
MS
7// Copyright 1997-2003 by Easy Software Products.
8//
9// These coded instructions, statements, and computer programs are the
10// property of Apple Inc. and are protected by Federal copyright
11// law. Distribution and use rights are outlined in the file "LICENSE.txt"
12// which should have been included with this file. If this file is
13// file is missing or damaged, see the license at "http://www.cups.org/".
14//
15
16/*
17 * C-style comments are supported.
18 */
19
20//
21// C++-style comments are supported.
22//
23
24//
25// Include the common media size definitions...
26//
27// #include directives support both <name> to include a standard file
28// and "name" or just name without the quotes for a local file. Local
29// files resolve relative to the current file's path. Unlike C/C++,
30// #include <name> does not look in multiple directories, and
31// #include "name" does not look in the standard directory.
32//
33
34#include <media.defs>
35
36
37//
38// Include the CUPS raster definitions...
39//
40
41#include <raster.defs>
42
43
44//
45// Include the standard CUPS fonts...
46//
47
48#include <font.defs>
49
50
51//
52// Define variables using the #define directive. In this case we
53// are defining constants for the model number, which is used by
54// our imaginary rastertofoo filter to determine which model-specific
55// features to use/support.
56//
57
58#define MODEL_BW 0
59#define MODEL_COLOR 1
60
61#define MODEL_LASER 0
62#define MODEL_PHOTO 2
63
64
65//
66// Media sizes are defined using the #media directive. The order of
67// values is: size name/text, width, length.
68//
69// "Size name" is an alphanumeric string of up to 40 characters as
70// defined by the Adobe PPD specification.
71//
72// "Size text" is a text string of up to 80 characters as defined by
73// the Adobe PPD specification.
74//
75// "Width" and "length" are the width and length of the media size.
76// Numbers by themselves represent points (72 points = 1 inch). The
77// suffixes "cm", "ft", "in", "m", "mm", and "pt" are recognized to
78// specify centimeters, feet, inches, meters, millimeters, and points,
79// respectively.
80//
81
82#media "FooLetter/Foo Letter" 8in 10in
83#media "FooPhoto/Foo Photo" 200mm 300mm
84
85
86//
87// Message catalogs can be included using #po...
88//
89
90#po fr foo-fr.po
91
92
93//
94// Specify that the drivers use all of the standard base fonts...
95//
96
97Font *
98
99
100//
101// All copyright lines are put at the top of the PPD file in order
102// of their appearance. Copyright text can span multiple lines and
103// will be properly included in the PPD file with comment prefixes
104// on each line.
105//
106// First an MIT-style copyright/license notice...
107//
108
109Copyright "Copyright 2007 by Foo Industries."
110Copyright "
111Permission is granted for redistribution of this file as long as
112this copyright notice is intact and the contents of the file are
113not altered in any way from their original form.
114
115Permission is hereby granted, free of charge, to any person
116obtaining a copy of this software and associated documentation
117files (the \"Software\"), to deal in the Software without
118restriction, including without limitation the rights to use,
119copy, modify, merge, publish, distribute, sublicense, and/or
120sell copies of the Software, and to permit persons to whom the
121Software is furnished to do so, subject to the following
122conditions:
123
124The above copyright notice and this permission notice shall be
125included in all copies or substantial portions of the Software.
126
127THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,
128EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
129OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
130NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
131HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
132WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
133FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
134OTHER DEALINGS IN THE SOFTWARE.
135"
136
137//
138// Then a GPL notice...
139//
140
141Copyright "Copyright 2007 by Foo Industries."
142Copyright "
143This software is free software; you can redistribute it and/or
144modify it under the terms of the GNU General Public License as
145published by the Free Software Foundation; either version 2 of
146the License, or (at your option) any later version.
147
148This software is distributed in the hope that it will be useful,
149but WITHOUT ANY WARRANTY; without even the implied warranty of
150MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
151GNU General Public License for more details.
152
153You should have received a copy of the GNU General Public
154License along with this software; if not, write to the Free
155Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
156MA 02111 USA
157"
158
159
160//
161// All printer drivers must define the manufacturer, model, PC
162// filename, and version strings; since this test file contains
163// drivers for an imaginary manufacturer "Foo", all of the drivers
164// listed in this file share common manufacturer and version
165// strings.
166//
167
168Manufacturer "Foo"
169Version 1.0
170
171
172//
173// Printer drivers can access driver-specific attributes in a PPD
174// file; these attributes are specified using lines of the form:
175//
176// Attribute name selector value
177//
178// "Name" is the name of the attribute and should start with either
179// the "cups" prefix or the name of the vendor, e.g. "hpFoo",
180// "epsonBar", etc. The name can be any alphanumeric character (a-z,
181// A-Z, and 0-9) and cannot be a common prefix of another attribute,
182// e.g. "fooLines" and "fooLinesPerInch" cannot be in the same file.
183//
184// "Selector" is a selector string containing any characters except
185// colon (:). Typically this will be one or more keywords separated
186// by the forward slash (/), however the empty string ("") can be used
187// to omit the selector.
188//
189// "Value" is a quoted value string that can contain any printable
190// characters except the double quote ("). Hexadecimal numbers
191// inside angle brackets (<xx>) can be used to substitute escape
192// codes and other special characters.
193//
194
195Attribute fooOutputFormat "" "PCL"
196Attribute fooPJL Begin "<1B>%-12345X@PJL<0D0A>"
197Attribute fooPJL Enter/PCL "@PJL ENTER LANGUAGE=PCL<0D0A>"
198Attribute fooPJL End "<1B>%-12345X@PJL END JOB<0D0A>"
199
200//
201// Most printer drivers use filters; exceptions include PostScript
202// printers and PPD files for software RIPs.
203//
204// The format is:
205//
206// Filter mime-type cost program
207//
208// The "mime-type" field defines the MIME type that the filter program
209// accepts; for CUPS raster printer drivers, this will be
210// "application/vnd.cups-raster".
211//
212// The "cost" field defines the relative cost of the filter in terms of
213// both CPU and memory usage, and is used to limit the number of
214// simultaneous jobs in some configurations. Most raster filters should
215// have a cost of 100, unless the filter does no dithering - then a cost
216// of 33 is more appropriate.
217//
218// The "program" field defined the filter program to run; use the null
219// filter "-" to define a MIME type that the printer accepts directly.
220// If no path information is provided, then the program will be run
221// from the standard CUPS filter directory, usually
222// /usr/lib/cups/filter.
223//
224// When compiling PPD files for PostScript capable devices that use
225// additional filters, add a null filter for the MIME type
226// "application/vnd.cups-postscript" so that printer commands, user
227// job filters, and page markings can be added to the PostScript
228// output that is sent to the printer.
229//
230
231Filter application/vnd.cups-raster 100 rastertofoo
232
233
234//
235// Attributes are included thusly...
236//
237
238Attribute cupsIPPReason "com.foo-serious-error/A Serious Error" "http://foo.com/serious.html"
239
240
241//
242// Curley braces are used for grouping common data and for isolating
243// individual printer models. All data values are inherited *except*
244// for the PCFilename and ModelName strings.
245//
246
247{
248 //
249 // Define two printer drivers that support only the FooLetter and
250 // FooPhoto media size. One is color, the other is black-and-white.
251 //
252 // Both printers share two MediaSize definitions; the name listed
253 // after the MediaSize keyword must be one of the Adobe standard
254 // names listed in the PPD specification or any named size defined
255 // using the #media directive.
256 //
257 // Default options are indicated by placing an asterisk (*) before
258 // the keyword.
259 //
260 // For custom size and margin specification, see the next group of
261 // printer drivers.
262 //
263
264 MediaSize FooLetter
265 *MediaSize FooPhoto
266
267
268 //
269 // These imaginary printers support printing at 300, 600x300,
270 // and 600 DPI. We'll use the old-style Resolution convenience
271 // keyword which accepts the following parameters: colorspace/
272 // order, bits-per-color, row count, row feed, row step, and
273 // name/text.
274 //
275 // The name must be of the form NNNsuffix or NNNxMMMsuffix,
276 // where NNN and MMM represent the X and Y resolution in dots
277 // per inch.
278 //
279
280 Resolution - 8 0 0 0 "300dpi/300 DPI"
281 Resolution - 8 0 0 0 "600x300dpi/600 x 300 DPI"
282 *Resolution - 8 0 0 0 "600dpi/600 DPI"
283
284
285 //
286 // One printer is grayscale only, and the other does grayscale
287 // and color. Define the grayscale color model for both printers
288 // using the old-style ColorModel convenience keyword which
289 // accepts the name/text, colorspace, color order, and compression
290 // parameters.
291 //
292
293 ColorModel Gray/Grayscale w chunked 0
294
295
296 {
297 //
298 // The first sub-group contains the grayscale printer, which
299 // only needs the model name, PC filename, and model number
300 // values set...
301 //
302 // The ModelName keyword defines the string that is shown to
303 // the user.
304 //
305
306 ModelName "Mono Photo Printer"
307
308
309 //
310 // The ModelNumber keyword defines the cupsModelNumber
311 // attribute value. We use the "(name name)" notation
312 // to perform a bitwise OR of the #define'd constants.
313 //
314
315 ModelNumber ($MODEL_BW $MODEL_PHOTO)
316
317
318 //
319 // The PCFileName keyword defines the filename of the PPD
320 // file and should be 8 characters or less + the .ppd
321 // extension.
322 //
323
324 PCFileName "foogphot.ppd"
325 }
326
327
328 {
329 //
330 // The second sub-group contains the color printer, which
331 // needs another ColorModel definition along with the model
332 // name, PC filename, and model number values. For fun, we'll
333 // add some input slots (paper trays) as well.
334 //
335 // The ModelName keyword defines the string that is shown to
336 // the user.
337 //
338
339 ModelName "Color Photo Printer"
340
341
342 //
343 // The ModelNumber keyword defines the cupsModelNumber
344 // attribute value. We use the "(name name)" notation
345 // to perform a bitwise OR of the #define'd constants.
346 //
347
348 ModelNumber ($MODEL_COLOR $MODEL_PHOTO)
349
350
351 //
352 // The PCFileName keyword defines the filename of the PPD
353 // file and should be 8 characters or less + the .ppd
354 // extension.
355 //
356
357 PCFileName "foocphot.ppd"
358
359
360 //
361 // This printer does color printing, too, so add it and make
362 // RGB the default...
363 //
364
365 ColorDevice Yes
366
367 *ColorModel RGB/Color rgb chunked 0
368
369
370 //
371 // The old-style InputSlot keyword accepts tray definitions
372 // of the form:
373 //
374 // InputSlot position name/text
375 //
376
377 InputSlot 0 "Upper/Main Paper Tray"
378 InputSlot 1 "LargeCapacity/Large Paper Tray"
379 }
380}
381
382
383{
384 //
385 // Define two printer drivers that support two typical laser
386 // printers with custom page sizes. One is color, the other is
387 // black-and-white.
388 //
389 // Both printers share several MediaSize definitions and support
390 // custom page sizes from 3x5 to 13x19 inches.
391 //
392 // All US media sizes use hardware margins of 0.25 inches on the sides
393 // and 12 points (1/6th inch) at the top and bottom. European sizes
394 // and custom sizes use margins of 12 points all around.
395 //
396 // The order of the HWMargins numbers are left, bottom, right, and top.
397 // The current HWMargins values are used when defining each media size.
398 // The last HWMargins values are used for custom page size margins.
399 //
400
401 HWMargins 0.25in 12pt 0.25in 12pt
402
403 *MediaSize Letter
404 MediaSize Legal
405 MediaSize Tabloid
406 MediaSize TabloidExtra
407
408 HWMargins 12pt 12pt 12pt 12pt
409 MediaSize A4
410 MediaSize A3
411
412 //
413 // Specify that custom/variable paper sizes are supported, and the
414 // range of sizes that are supported...
415 //
416
417 VariablePaperSize Yes
418 MinSize 3in 5in
419 MaxSize 13in 19in
420
421
422 //
423 // These imaginary printers support printing at 600 and 1200 DPI.
424 // We'll use the new Option and Choice keywords to define the
425 // Resolution options...
426 //
427 // Option option-name option-text option-type
428 // Choice choice-name choice-text code
429 //
430 // "Option-type" is the type of option: boolean, pickone, or pickmany.
431 //
432
433 Option Resolution PickOne AnySetup 10
434 Choice "600dpi/600 DPI" "<</HWResolution[600 600]/cupsBitsPerColor 8>>setpagedevice"
435 Choice "1200dpi/1200 DPI" "<</HWResolution[1200 1200]/cupsBitsPerColor 8>>setpagedevice"
321d8d57 436
ac884b6a
MS
437
438 //
439 // One printer is grayscale only, and the other does grayscale
440 // and color. Define the grayscale color model for both printers
441 // using the new Option and Choice keywords.
442 //
443
444 Option "ColorModel/Color Mode" PickOne AnySetup 10
445 Choice Gray/Grayscale "<</cupsColorSpace $CUPS_CSPACE_W>>setpagedevice"
446
447
448 //
449 // Both printers provide two paper trays, which we'll define using
450 // the new Option and Choice keywords...
451 //
452
453 Option "InputSlot/Input Slot" PickOne AnySetup 10
454 Choice "Upper/Main Paper Tray" "<</MediaPosition 0>>setpagedevice"
455 Choice "LargeCapacity/Large Paper Tray" "<</MediaPosition 1>>setpagedevice"
456
457
458 //
459 // Both printers support duplexing...
460 //
461 // The Duplex keyword accepts values of "none" (no duplexing capability),
462 // "normal" (standard duplexing capability), and "flip" (auto-duplex that
463 // requires the back side to be flipped by the RIP...)
464 //
465
466 Duplex normal
467
468
469 {
470 //
471 // The first sub-group contains the grayscale printer, which
472 // only needs the model name, PC filename, and model number
473 // values set...
474 //
475 // The ModelName keyword defines the string that is shown to
476 // the user.
477 //
478
479 ModelName "Mono Laser Printer"
480
481
482 //
483 // The ModelNumber keyword defines the cupsModelNumber
484 // attribute value. We use the "(name name)" notation
485 // to perform a bitwise OR of the #define'd constants.
486 //
487
488 ModelNumber ($MODEL_BW $MODEL_LASER)
489
490
491 //
492 // The PCFileName keyword defines the filename of the PPD
493 // file and should be 8 characters or less + the .ppd
494 // extension.
495 //
496
497 PCFileName "fooglasr.ppd"
498 }
499
500
501 {
502 //
503 // The second sub-group contains the color printer, which
504 // needs another ColorModel definition along with the model
505 // name, PC filename, and model number values.
506 //
507 // The ModelName keyword defines the string that is shown to
508 // the user.
509 //
510
511 ModelName "Color Laser Printer"
512
513
514 //
515 // The ModelNumber keyword defines the cupsModelNumber
516 // attribute value. We use the "(name name)" notation
517 // to perform a bitwise OR of the #define'd constants.
518 //
519
520 ModelNumber ($MODEL_COLOR $MODEL_LASER)
521
522
523 //
524 // The PCFileName keyword defines the filename of the PPD
525 // file and should be 8 characters or less + the .ppd
526 // extension.
527 //
528
529 PCFileName "fooclasr.ppd"
530
531
532 //
533 // This printer does color printing, too, so add it and make
534 // RGB the default...
535 //
536
537 ColorDevice Yes
538
539 Option "ColorModel/Color Mode" PickOne AnySetup 10
540 *Choice RGB/Color "<</cupsColorSpace $CUPS_CSPACE_RGB>>setpagedevice"
541 }
542}
543
544
545//
61515785 546// End of "$Id: foo.drv 3247 2011-05-12 06:22:31Z msweet $".
ac884b6a 547//