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