File: README

package info (click to toggle)
foomatic-db 20120523-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 240,944 kB
  • sloc: xml: 231,115; sh: 153; makefile: 113; python: 8
file content (2862 lines) | stat: -rw-r--r-- 117,513 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862

Foomatic Database
=================


foomatic-db
-----------

The collected knowledge about printers, drivers, and driver options in
XML files, used by foomatic-db-engine to generate PPD files.

Till Kamppeter <till.kamppeter@gmail.com>

http://www.openprinting.org/

This README contains mainly info for developers. See the file USAGE if
you want to know how to use Foomatic.


Copying
-------

To most of this package the GPL applies (see http://www.gnu.org/),
exception are the PPD files in db/source/PPD, they can have different
licenses (mostly MIT), see the comments in the beginning of the PPD
files and the license texts in the corresponding driver XML files.


Bugs
----

If you spot a data error or any other bug, please report it on the
OpenPrinting bug tracking system:

http://bugs.linux-foundation.org/

Choose "OpenPrinting" as the product and "foomatic-db-engine" as the
component.


Intro
-----

This is the stable version of Foomatic. This version is also the base
of our database web interface on

http://www.openprinting.org/


Programs and important files from this package
----------------------------------------------

configure.ac

  The source from which GNU autoconf generates the "configure" script

acinclude.m4

  Additional macros for the "configure" script

make_configure

  Calls aclocal and autoconf to generate "configure" from "configure.ac" 
  and "acinclude.m4"

Makefile.in

  The template from which "configure" generates the Makefile

install-sh

  Helper script for "configure"

db/

  The XML database. See below.

xmlschema/*.xsd

  XML Schema files to verify the XML database entries. There is one for
  each XML file type (printer, driver, option) and an additional one (types.xsd)
  which is used by the first three.

  To verify XML files run

    xmllint --noout --schema xmlschema/<type>.xsd db/source/<type>/<file>.xml

  For example for a driver:

    xmllint --noout --schema xmlschema/driver.xsd db/source/driver/ljet4.xml

  For all printers use:

    xmllint --noout --schema xmlschema/printer.xsd db/source/printer/*.xml\

  Do this check whenever you create or edit XML files to assure that your
  XML file is correct.


Dependencies
------------

This package does not require anything else. It is needed by
foomatic-db-engine, the database engine of Foomatic. It is required to
use foomatic-db-engine 4.0.0 or newer, as it contains important bug
fixes and also support for nested composite options. Do not use this
database with older versions of Foomatic.

See the USAGE file for installation details.


About the database
------------------

The database is provided by this package, additional database entries
are in "foomatic-db-hpijs", other Foomatic XML files and PPDs are
supplied with the drivers. "foomatic-db-engine" is needed to make use
of the Foomatic XML data.

The database is located in one system directory, usually
/usr/share/foomatic, but it can be also at other places (Install this
package at first and after that foomatic-db-engine so that
foomatic-db-engine gets configured correctly automatically). In this
directory there is the following structure:

 db/                             - the database
 db/oldprinterids                - translation table for old numerical
				   printer IDs
 db/kitload.log                  - list of third-party "kit" files, logged
                                   by foomatic-kitload
 db/source/                      - "source" data, provided by humans, etc
 db/source/printer/<poid>.xml    - printer-specific data, one per printer id
 db/source/driver/<driver>.xml   - driver-specific data, one per driver name
 db/source/opt/<idx>.xml         - option data, one file per option
 db/source/PPD/                  - Ready-made PPD files, usually supplied by
                                   printer manufacturers for their PostScript
				   printers.

You can edit the files whenever you want and regenerate the affected
printer queues with foomatic-configure, there is no on-disk cache, the
data is always directly derived from the source files. So your changes
will be taken into account without any special steps.


Data
----

There are three main source datafiles (printers, drivers, and options;
annotated examples:


printer/HP-LaserJet_4000.xml
============================

# The printer file contains information specific to a particular
# printer.

<printer id="printer/HP-LaserJet_4000">

# Make and model are not internationalized.  There will eventually be
# an "alias" mechanism, but the need is different.

  <make>HP</make>
  <model>LaserJet 4000</model>

# According to the Adobe specifications for PPD files every PPD file
# must contain a unique DOS-compatible file name (the "*PCFileName"),
# a file name with an up to 8 characters log base name and an up to 3
# characters long extension, and upper and lower case letters being
# considered as equal. As every PPD file is for a printer/driver
# combo, we let the first 6 characters being provided by the printer
# entry:

  <pcmodel>HPLJ4K</pcmodel>

# The first two characters should be the manufacturer prefix as listed
# in Appendix D of Adobe's "PostScript Printer Description (PPD) File
# Format Specification Version 4.3", available on

# http://partners.adobe.com/public/developer/en/ps/5003.PPD_Spec_v4.3.pdf

# Various stuff about the machine

  <mechanism>

# Printer types can be <laser />, <led />, <inkjet />, <dotmatrix />,
# <impact />, <sublimation />, <transfer />, <thermal />. Other types
# we have to add to the CGI script on OpenPrinting to make the web
# interface displaying them properly.

    <laser/>

# At some point we can make color be less of a boolean flag and more
# of a section full of goodies.

    <!--not "color"-->
    <resolution>

# In theory this is a list.  In practice We've only got one per
# printer which is the maximum resolution the manufacturer claims for
# this printer. Do not put empty tags (like "<x></x>" or "<x />" here
# if the resolution is not known. Leave out the tags (or the whole
# <resolution> section).

      <dpi>
        <x>1200</x>
        <y>1200</y>
      </dpi>
    </resolution>

    <consumables>

# Information about ink, drums, etc.
# The comments are supposed to be qualitative ("Separate drum and
# toner cartridges")

      <comments>
        <en>toner</en>
      </comments>

# There can be <partno>12A1975</partno> elements with manufacturer
# part numbers for the various carts, etc it takes. Unfortunately,
# this is not made use of, one could make a consumable database with
# this for example.

      <!--one or more "partno" elements.-->
    </consumables>
  </mechanism>

  <url>http://www.pandi.hp.com/pandi-db/prod_info.show?model=C4118A&amp;name=LaserJet4000</url>

# The lang section.  In practice this will be only minimally useful;
# 
#  - Backends can pstops the ps down a level if needed
#  - Backends know if pjl options apply
#  - Backends can know if direct text printing will work
#
# Commonly used language tags: <pcl level="x" />, <escp2 />, <proprietary />

  <lang>
    <postscript level="2" />
    <pjl/>
    <text>
      <charset>us-ascii</charset>
    </text>
  </lang>

# The autodetection stuff

  <autodetect>

# There are three ways to auto-detect a printer, via the parallel port
# (<parallel>...</parallel>), the USB (<usb>...</usb>), or SNMP
# (TCP/Socket-connected printer, <snmp>...</snmp>). Through these
# interfaces the printers report back an IEEE-1284-complient ID string
# from which the fields "MFG" (<manufacturer>...</manufacturer>),
# "MDL" (<model>...</model>), "DES" (<description>...</description>),
# and "CMD" (<commandset>...</commandset>) are used. The string itself
# can be put between <ieee1284>...</ieee1284> tags, but all items
# which are not constant for all printers of this model, as the serial
# number ("SERN:...;") and the device status ("VSTATUS:...;") have to
# be removed here. As the ID string is usually the same for all
# detection methods, one can put the entries between
# <general>...</general> tags, then the <parallel>...</parallel>,
# <usb>...</usb>, and <snmp>...</snmp> are only used for
# differences to the data between the <general>...</general> tags. A
# complete entry could look like:
#
#  <autodetect>
#    <general>
#      <ieee1284>MFG:HEWLETT-PACKARD;MDL:DESKJET 600;CMD:MLC,PCL,PML;CLASS:PRINTER;DESCRIPTION:Hewlett-Packard DeskJet 600;</ieee1284>
#      <commandset>MLC,PCL,PML</commandset>
#      <description>Hewlett-Packard DeskJet 600</description>
#      <manufacturer>HEWLETT-PACKARD</manufacturer>
#      <model>DESKJET 600</model>
#    </general>
#  </autodetect>
#

# If you use CUPS, you get the device IDs of all locally connected
# (USB, parallel) printers and of printers in the local network by
# running:

lpinfo -l -m

# On Linux you find this info for the parallel ports (/dev/lp<N>, <N>
# = 0, 1, 2, ...) in the files
#
#   /proc/sys/dev/parport/parport<N>/autoprobe*
#
# for the USB under Linux it is more complicated, easiest is to use a little
# Perl script, called "getusbprinterid.pl":
# You need to find the IOCTL call value to pass to the perl ioctl function.
# Here is a little C program that does this. This is easier than trying to
# use p2h and convert the *.h files to perl.

# --------------------------------------------------------------------------
#  /*
#       print the IOCTL call value for printer information
#  */
#  #include <stdio.h>
#  #include <sys/ioctl.h>
#  /* From the /usr/src/linux<version>/drivers/usb/printer.c */
#  #define DRIVER_VERSION "v0.11"
#  #define DRIVER_AUTHOR "Michael Gee, Pavel Machek, Vojtech Pavlik, Randy Dunlap, Pete Zaitcev, David Paschal"
#  #define DRIVER_DESC "USB Printer Device Class driver"
#  
#  #define USBLP_BUF_SIZE      8192
#  #define DEVICE_ID_SIZE      1024
#  
#  /* ioctls: */
#  #define LPGETSTATUS     0x060b      /* same as in drivers/char/lp.c */
#  #define IOCNR_GET_DEVICE_ID     1
#  #define IOCNR_GET_PROTOCOLS     2
#  #define IOCNR_SET_PROTOCOL      3
#  #define IOCNR_HP_SET_CHANNEL        4
#  #define IOCNR_GET_BUS_ADDRESS       5
#  #define IOCNR_GET_VID_PID       6
#  /* Get device_id string: */
#  #define LPIOC_GET_DEVICE_ID(len) _IOC(_IOC_READ, 'P', IOCNR_GET_DEVICE_ID, len)
#  /* The following ioctls were added for http://hpoj.sourceforge.net */
#  /* (HPOJ is replaced by HPLIP, http://hplipopensource.com/): */
#  /* Get two-int array:
#  * [0]=current protocol (1=7/1/1, 2=7/1/2, 3=7/1/3),
#  * [1]=supported protocol mask (mask&(1<<n)!=0 means 7/1/n supported): */
#  #define LPIOC_GET_PROTOCOLS(len) _IOC(_IOC_READ, 'P', IOCNR_GET_PROTOCOLS, len)
#  /* Set protocol (arg: 1=7/1/1, 2=7/1/2, 3=7/1/3): */
#  #define LPIOC_SET_PROTOCOL _IOC(_IOC_WRITE, 'P', IOCNR_SET_PROTOCOL, 0)
#  /* Set channel number (HP Vendor-specific command): */
#  #define LPIOC_HP_SET_CHANNEL _IOC(_IOC_WRITE, 'P', IOCNR_HP_SET_CHANNEL, 0)
#  /* Get two-int array: [0]=bus number, [1]=device address: */
#  #define LPIOC_GET_BUS_ADDRESS(len) _IOC(_IOC_READ, 'P', IOCNR_GET_BUS_ADDRESS, len)
#  /* Get two-int array: [0]=vendor ID, [1]=product ID: */
#  #define LPIOC_GET_VID_PID(len) _IOC(_IOC_READ, 'P', IOCNR_GET_VID_PID, len)
#  
#  
#  int main( int argc, char *argv, char *envp[] )
#  {
#   int len = 1024;
#   int v;
#   /* _IOC(), _IOC_READ as defined in /usr/include/asm/ioctl.h
# LPIOC_GET_DEVICE_ID(len) = _IOC(_IOC_READ, 'P', IOCNR_GET_DEVICE_ID, len)
#   */
#   v = LPIOC_GET_DEVICE_ID(len);          printf("$LPIOC_GET_DEVICE_ID = 0x%08x;\n", v );
#   v = LPIOC_GET_BUS_ADDRESS(len);        printf("$LPIOC_GET_BUS_ADDRESS = 0x%08x;\n", v );
#   v = LPIOC_GET_VID_PID(len);            printf("$LPIOC_GET_VID_PID = 0x%08x;\n", v );
#   return(0);
#  }
#  
#     
# save this to a file, say getv.c, compile and run it, and you get an output
$ like this:
#  $LPIOC_GET_DEVICE_ID = 0x84005001;
#  $LPIOC_GET_BUS_ADDRESS = 0x84005005;
#  $LPIOC_GET_VID_PID = 0x84005006;



# Here is the getusbprinterid.pl PERL program to get the usb information
#    
#	!/usr/bin/perl
#	open FILE, "$ARGV[0]" or die "cannot open $ARGV[0]";
#	my $result;
#	# len = 1024
#	# LPIOC_GET_DEVICE_ID(len) = _IOC(_IOC_READ, 'P', IOCNR_GET_DEVICE_ID, len)
#	# _IOC(), _IOC_READ as defined in /usr/include/asm/ioctl.h
#	$LPIOC_GET_DEVICE_ID = 0x84005001;
#	$LPIOC_GET_BUS_ADDRESS = 0x84005005;
#	$LPIOC_GET_VID_PID = 0x84005006;
#	
#	ioctl(FILE, $LPIOC_GET_DEVICE_ID , $result) or die;
#	# Cut resulting string to its real length
#	my $length = ord(substr($result, 1, 1)) + (ord(substr($result, 0, 1)) << 8);
#	$result = substr($result, 2, $length-2);
#	# Remove non-printable characters
#	$result =~ tr/[\x0-\x1f]/\./;
#	print "DeviceID $result\n";
#	
#	$result = pack("LL",0);
#	ioctl(FILE, $LPIOC_GET_BUS_ADDRESS , $result) or die;
#	my( $v1, $v2 ) = unpack("LL", $result );
#	print "Bus '$v1', Device '$v2'\n";
#	
#	$result = pack("LL",0);
#	ioctl(FILE, $LPIOC_GET_VID_PID, $result) or die;
#	my( $v1, $v2 ) = unpack("LL", $result );
#	print "Vendor '$v1', Product '$v2'\n";
#	
#	close FILE;
#	
#    
# --------------------------------------------------------------------------

# Running the program with "perl getusbprinterid.pl /dev/usb/lp0" returns the
# ID string of the device on /dev/usb/lp0.
# For example: perl getusbprinter.pl /dev/usb/lp0  
#  DeviceID MFG:Hewlett-Packard;CMD:PJL,MLC,PCL,PCLXL,POSTSCRIPT;MDL:\
#    HP LaserJet 2200;CLS:PRINTER;DES:Hewlett-Packard LaserJet 2200;\
#    MEM:8MB;OPTRAY:250Sheets
#  Bus '2', Device '2'
#  Vendor '1008', Product '535'
#
# (lines broken for clarity)


    <!--no known parport probe information-->
  </autodetect>

# Our grading system.  It's US-style letter grades A, B, D, and F,
# which the website shows as "Perfectly", "Mostly", "Partially" and
# "Paperweight" .
# THERE IS NO `C'!!!

  <functionality>A</functionality>

# Arguably, the scores should live with the printer/driver association
# and not on the printer, but then it's a big hassle to figure out if
# a printer works... So the score is the one reached with the driver
# working best, the "recommended" driver.

# There's a spot for this "recommended" driver, usually the driver
# which gives the maximum output quality. It is for user information
# on the web site, but newbie-friendly printer setup GUIs should use
# it, too. system-config-printer, printer setup tool of Fedora/Red
# Hat, Ubuntu, and Mandriva Linux makes use of it, also the former
# printerdrake of Mandriva Linux.

  <driver>Postscript-HP</driver>

# The following optional section describes with which drivers this
# printer works. A valid printer/driver pair can be defined by either
# adding the printer to the driver's printer list (the way how it
# worked all the time) but also by adding the driver to the printer's
# driver list. This way a printer can get associated with a driver for
# which there is no driver XML file and a driver can list a supported
# printer which is not in the printer XML database. For providing a
# PPD file both printer and driver XML files must exist, but it is not
# important in which of the two the printer/driver relationship is
# defined.

# The driver list in the printer XML files was introduced for once
# defining links to ready-made PPD files (relative paths without "/",
# "http:", "https:", or "ftp:" in the beginning are relative to
# $libdir/db/source/, absolute links can point to external sites, as
# for example the site of a printer manufacturer, but they must always
# provide the non-interactive download of the PPD file, for example
# via "wget") and second, listing the supported drivers for
# visitor-contributed printer entries (from web input form). The
# comments section is for adding comments specific to the
# printer/driver combo. As it is human-readable it is
# internationalized. Each driver entry here must have a driver ID. PPD
# file link and comment are optional.

  <drivers>
    <driver>
      <id>Postscript-HP</id>
      <ppd>PPD/HP/HP_LaserJet_4000_Series.ppd</ppd>
      <comments><en>...</en></comments>
    </driver>
  </drivers>


# The <unverified /> tag marks entries which are entered by visitors
# via the printer input form on the OpenPrinting web site. It does not
# appear in approved entries (= all entries in the BZR repository of
# the foomatic-db package).

  <!--not "unverified"-->

# If there is a web site with additional interesting info about this
# printer, it can be mentioned in the entry by putting it between
# <contrib_url>...</contrib_url> tags,

  <!--no "contrib_url"-->

# The regular notes section.  The allowed tags are: <p>, <a
# href="foobar"> </a> and many other simple tags (<b>, <i>, <tt>,
# ...). Note that to distinguish what is XML and what is the embedded
# HTML, the following replacements have to be made:
#
#   < --> &lt;
#   > --> &gt;
#   " --> &quot;
#   ' --> &apos;
#   & --> &amp;
#

  <comments>
    <en>
    I don&apos;t believe this:&lt;p&gt;

    &lt;i&gt;1200x1200 dpi only possible with Windows drivers,
    600x600 can be reached w/o particular software.
    The difference is visible, but only slightly, so
    the Functionality got &quot;Mostly&quot;&lt;p&gt;&lt;/i&gt;&lt;p&gt;

    Do the following:&lt;p&gt;

    Set the resolution on the front panel to &quot;Prores 1200&quot;, not
    to &quot;Fastres 1200&quot;. When you use CUPS with HPs PPD file, turn
    off &quot;Fastres 1200&quot; in the printer configuration
    options.&lt;p&gt;

    Try the generic PostScript PPD file which comes with KUPS 1.0 or newer.
    </en>
  </comments>
</printer>


driver/md2k.xml
===============

The driver files contain information about drivers.  There are a few
things, but the two biggies are the prototype and the printers list

<driver id="driver/md2k">
 <name>md2k</name>

# According to the Adobe specifications for PPD files every PPD file
# must contain a unique DOS-compatible file name (the "*PCFileName"),
# a file name with an up to 8 characters log base name and an up to 3
# characters long extension, and upper and lower case letters being
# considered as equal. As every PPD file is for a printer/driver combo,
# we let the last 2 characters being provided by the driver entry:

 <pcdriver>M2</pcdriver>

# The drivers listed by the OpenPrinting database are usually not
# developed by OpenPrinting.  Most free software printer drivers come
# from independent projects, initiated by peopke who want to get their
# printers to work under Linux, some other drivers come from the
# printer manufacturers. So even if OpenPrinting hosts a downloadable
# package of the driver the development of the driver is not part of
# OpenPrinting. Therefore every driver entry has to contain a
# reference to the developers of the driver, where the driver can be
# actually downloaded. The appropriate link goes into the <url> tag:

 <url>http://plaza26.mbn.or.jp/~higamasa/gdevmd2k/</url>

# The driver XML files can contain the following tags to describe the
# driver's properties, so that a user can easily find the driver which
# is most suitable for him. The properties are shown in the gray
# driver info boxes on the OpenPrinting web site and they are also
# supposed to be shown by printer setup tools when they offer to
# download a driver from OpenPrinting. It is especially important to
# supply them if a downloadable driver package or PPD files are
# supplied.

# Supplier's name, internationalization (with <en>...</en><de>...</de>...)
# optional

#   <supplier>SpliX project</supplier>

# Does the driver come from the printer's manufacturer or from a third
# party. The third form tells also the manufacturer names of the
# printers which are from the manufacturer which developed the
# driver. If there are also printers from other manufacturers
# supported (like for the PCL driver HPIJS) then the OpenPrinting web
# site does not show this driver as manufacturer-supplied on the pages
# of the printers of other manufacturers.

#   <thirdpartysupplied />   OR   <manufacturersupplied />   OR
#   <manufacturersupplied>HP|Apollo</manufacturersupplied>

# License name. Here should be put the common short name or
# abbreviation if the license is one of the common free software
# licenses. Otherwise it should contain something short and
# descriptive, for non-free drivers simply "Commercial". The license
# name can be internationalized with language tags
# (<en>...</en><de>...</de>...).

#   <license>GPL</license>

# The license text does not need to be supplied for common free
# software licenses. It should be supplied if:
#
#  - The license is not free (<nonfreesoftware /> tag set)
#  - The driver has patent issues (<patents /> tag set, describe the
#    patent issues here in that case)
#  - The license of the driver is free but none of the common licenses
#    (<nonfreesoftware /> tag not set)

#   <licensetext>
#    <en>
#      ...
#    </en>
#   </licensetext>

# License texts can also be linked from external sites:

#   <licensetext>
#    <en url="http://www.laserstar.com/licenses/en/gl-series-eula.txt" />
#    <de url="http://www.laserstar.com/licenses/de/gl-series-eula.txt" />
#    ...
#   </licensetext>

# License texts have to be given always as plain text, UTF-8-encoded.

# Mark with this tag whether the driver is non-free software

#   <nonfreesoftware />

# All driver entries without this tag are considered to be free
# software.

# This tag tells whether there are any patent issues with the driver

#   <patents />

# The absence of the tag tells that the driver is free of patent
# issues.

# If a driver entry provides a <licensetext> and is <nonfreesoftware
# /> or with <patents /> printer setup tools which download this
# driver are supposed to present the license text and ask the user
# whether he agrees with it.

# Printer manufacturers could want to package their drivers for
# different market regions (Europe, Asia/Pacific, Americas, ...) as
# the markets demand different capabilities of printer drivers and
# different user-settable options (CJK-language-related stufff for
# example). So there could even be two different driver flavors for
# the same printer but adapted to different regions. To express these
# driver properties there are special tags.

# For each flavor of the driver a separate driver entry (driver XML
# file) has to be supplied. There is no requirement of certain
# properties of the driver flavors to be equal or not. Especially the
# printer lists can contain printers which are not in all flavors, for
# example if printers are only sold in certain regions. To mark which
# entries are belonging together one adds a group tag to each XML
# file, with the same group name, but the name must be different to
# the names of all already existing groups. A locales tag contains all
# language/country codes for which the driver flavor is intended:

#   <group>epson-inkjet</group>
#   <locales>de en_UK en_IE fr_FR es_ES</locales>

# The codes in the locales tags should be different for the group
# members, to allow to automatically select the most suitable flavor
# if the detected printer is supported by more than one flavor.

# For downloadable drivers support contacts should be given, so that
# users get informed before they do the download and do not complain
# at their OS distribution vendor if the driver downloaded from
# OpenPrinting does not work. The human-readable string for the
# support contact can be internationalized with language tags
# (<en>...</en><de>...</de>...).

#   <supportcontacts>
#    <supportcontact level="voluntary" url="http://sourceforge.net/forum/?group_id=175815">SpliX forum at SourceForge</supportcontact>
#    <supportcontact level="commercial" url="http://www.laserstar.com/support/">LaserStar Support</supportcontact>
#   </supportcontacts>

# This is an internationalized short description of the driver,
# typically one line, to be used in the gray driver info boxes, in the
# driver overview list, and also by printer setup tools. If a driver
# entry is for a development version of a driver, tell it here, as the
# long description is not shown everywhere.

#   <shortdescription>
#    <en>
#     Driver for Samsung SPL2 (ML-1710, ...) and SPLc (CLP-500, ...) laser
#     printers
#    </en>
#   </shortdescription>

# If there are downloadable packages for this driver entry on the
# OpenPrinting web site, a <packages> section has to be supplied. This
# tag tells which package files on the OpenPrinting web server belong
# to this driver or on which external server to find packages for this
# driver. It also allows assigning files or locations to different
# components of this driver and to assign scopes to them. Scopes can
# be: "general", "gui", "printer", "scanner", "fax", ... Uses the
# "general" scope if packages are not split. Wild cards are the same
# as used for file masks in the shell (NOT regular expressions). They
# must match both Debian and RPM package file names. Note that between
# file name and version number is a "-" for RPMs and a "_" for Debian
# packages.

#   <packages>
#    <package scope="general">*splix[_-]1.[0-9].[0-9]*</package>
#   </packages>

# It is possible to give absolute paths which can point to external
# sites, as for example the site of a printer manufacturer, so that
# the package can be hosted there but auto-downloaded via
# OpenPrinting. Important is that these packages are auto-downloadable
# LSB packages and that a non-interactive download is provided (should
# also work with utilities like "wget"). Licenses which the users have
# to agree on have to get supplied in the driver XML file. Printer
# setup tools are supposed to ask the user for agreeing if the driver
# is marked as non-free or with patent issues.

# Example for packages provided by an external site:

#   <packages>
#    <package scope="general" fingerprint="http://download.example.com/printerdrivers/gpg/key-fingerprint.txt">http://download.example.com/printerdrivers/RPMS/i486/*laserstar*;http://download.example.com/printerdrivers/RPMS/x86_64/*laserstar*;http://download.example.com/printerdrivers/debian/dists/lsb3.2/main/binary-i386/*laserstar*;http://download.example.com/printerdrivers/debian/dists/lsb3.2/main/binary-amd64/*laserstar*</package>
#   </packages>

# Note that more than one mask can be supplied separating them with
# semicolons (";").

# The masks with absolute paths must match all package files, of all
# architectures (usually i386/i486 and amd64/x86_64) and all package
# systems (RPM and Debian). Use more than one mask if needed. On your
# server each directory with package files inside must be browsable,
# so that a client can expand the wildcards. In addition the packages
# itself need to be readable for everyone so that they can get
# downloaded.

# Note also that the packages on the external server must be in
# regular package repositories, so that automatic updates with the
# package manager tools provided by the user's Linux distribution
# (currently apt, yum, and zypper) can be performed. The configuration
# data for the local tools is derived from the actual file locations,
# which get determined by the masks.

# Important is also that with paths (absolute starting with "http://",
# "https://", or "ftp://" and relative simply having at least a slash
# somewhere) wildcards can only be used after the last slash ("/"). So
# wildcards are only allowed for the file name and not for the
# directory names.

# If the packages are signed, all packages of the same <package> entry
# should be signed with the same key and the key should be registered
# on the key server network. The key fingerprint should be made
# available as a text file on the web site of the driver issuer and
# the site should be with an SSL certificate which has been signed by
# an official registrar. The "fingerprint=..." parameter should then
# provide the link to the file with the key fingerprint. The link must
# be an "https://..." URL and point to a file on a server of the
# driver issuer. Packages must be signed for fully automatic upload by
# default on Linux distributions. See also

# https://www.linuxfoundation.org/collaborate/workgroups/openprinting/writingandpackagingprinterdrivers

# The <functionality> section should make it easier for a user to
# compare different drivers by giving some technical properties and
# ratings (0...100) for common document types, system load, and
# execution speed. The higher the number, the better the driver
# performs here. It is not required to supply all items. Items can be
# left out or can stay empty. <functionality> sections of the same
# format can also be used in the <printer> entries in the <printers>
# list, to describe exceptions for particular printers. If an item is
# left out or empty there, the appropriate item in the general
# <functionality> section is used, so only the items which are
# different for the given printer need to be listed.

#   <functionality>
#    <maxresx>1200</maxresx>
#    <maxresy>1200</maxresy>
#    <color />   OR   <monochrome />
#    <text>100</text>
#    <lineart>100</lineart>
#    <graphics>100</graphics>
#    <photo>80</photo>
#    <load>50</load>
#    <speed>90</speed>
#   </functionality>

# Not all tags are required here, if the valur for a tag is not known,
# the tag has to be left out. Do not put empty tags (like
# "<text></text>" or "<text />" here.

# The <execution> section describes everything needed to execute the
# driver.

 <execution>

# Sometimes it is possible that a driver depends on another driver,
# for example a manufacturer publishes a core driver which is
# completely free software and supports most of their printer. In
# addition, he publishes closed-source plugins for the core driver to
# support additional printers where they cannot open the driver code
# for IP reasons. He wants to link in all his driver packages for
# automatic download with the <packages> tags. To make everything work
# correctly he creates one driver entry for the core driver and one
# for each plugin. The printers which do not need the plugin get
# listed as supported by the core driver, the printers needing a
# plugin are listed as supported by the plugin. To avoid that then
# only a plugin gets automatically downloaded one adds a <requires>
# tag to each entry of a plugin, to the beginning of the <execution>
# section:

#    <requires version="&gt;= 5.0.1">gutenprint</requires>
#    <requires version="&gt;= 2.7.10">hpijs</requires>
 
# The version attribute is optional, without, every version is
# accepted. Optional relationships (>=, <=, =, <, >) allow to not only
# accept the given version. The '>ยด and '<' have to be replaced by the
# appropriate XML entities, as described earlier here for other text
# in the XML files. More than one <requires> tag is allowed.

# Driver types are 
#
#  <ghostscript /> : The driver code is compiled into Ghostscript
#
#  <ijs /> :         IJS plug-in. These are raster drivers which connect
#                    to the IJS interface of the renderer, usually of 
#                    Ghostscript but also of pdftoijs or others. The
#                    interface is based on pipes and is bi-directional.
#                    It makes the driver independent of the renderer.
#
#  <cups /> :	     CUPS Raster driver. The raster driver standard
#                    introduced by CUPS. The renderer generates the CUPS
#		     Raster format, a bitmap format optimized for printing,
#		     and it gets piped into the driver.
#
#  <opvp /> :        OpenPrinting Vector driver. DLL and IPC interface for
#                    plugging printer drivers into the renderer. This is
#                    the only solution of mudular printer drivers for high-
#                    level graphics (vector) PDLs.
#
#  <uniprint /> :    A uniprint driver, consisting of one or more .upp
#                    files for Ghostscript.
#
#  <filter /> :      The driver code is a separate executable and the 
#                    driver does not fit into the groups listed above, 
#                    usually either a filter which converts generic 
#                    bitmap output of Ghostscript to the printer's 
#                    language, or a wrapper around Ghostscript.
#
#  <postscript /> :  A driver which has PostScript as output (for 
#                    PostScript printers). It usually does not call
#                    Ghostscript but only applies the user's option
#                    settings to the data stream. But Ghostscript can
#                    be called here, too, as for downgrading to a lower
#                    PostScript level or for handling PDF input.
#
# The driver type only provides information for the web pages (or
# driver auto-download facilities of printer setup tools), it is not
# used when generating PPD files.

   <ghostscript />

# The driver's <execution> section can also contain a
#
# <nopjl />
#
# which suppresses the usage of PJL options (options which send PJL
# commands to the printer). This is done with drivers where the driver
# itself already produces a PJL header and where the PJL options
# defined for the supported printers would badly interfere. In most
# cases this is not needed, as foomatic-rip merges the PJL headers of
# the driver and of the PJL options.

# And the driver's <execution> section can also contain a
#
# <nopageaccounting />
#
# This suppresses the inserting of page accounting code (for CUPS)
# into the PostScript data stream. Some drivers lead to unexpected
# behavior with that. Especially for the generic PostScript drivers
# (which do not use Ghostscript in most cases) the accounting code
# should not be inserted.

# The prototype defines what command the backends run to drive this
# printer. It must take at least PostScript, preferably both PDF and
# PostScript on stdin and generate the printer's native language on
# stdout. Various %A, %B, etc substitution "spots" are specified; this
# is where substition options will be placed.

  <prototype>gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE -sDEVICE=md2k%A%Z -sOutputFile=- -</prototype>
 </execution>
 <comments>
  <en>
    Part of the gdevmd2k-0.2a package by Shinya Umino.  The web page and
    documentation are in Japanese.
    &lt;a href="/clippings/MD5000-translation.txt"&gt;Here&lt;/a&gt;
    is an English translation of the driver's web page, and &lt;a
    href="/clippings/alpsmd.txt"&gt;here&lt;/a&gt; is the README from the
    driver package.
  </en>
 </comments>

# if there is only a <prototype> and not a <prototype_pdf> entry,
# foomatic-rip will feed both PostScript and PDF into the command line
# defined with <prototype>, otherwise for PostScript input the
# <prototype> command line is used and for PDF input the
# <prototype_pdf> command line. Both are defined the same way and the
# same command line snippets are inserted from the option settings.

# If there is only a <prototype> defined, PDF will only be fed in if
# the command line begins with "gs " (this means Ghostscript is called
# and Ghostscript understands both PostScript and PDF) and there are
# no options based on inserting active PostScript code into the input
# data stream. Otherwise foomatic-rip converts PDF input to PostScript
# at first and feeds the PostScript through the command line.

# The printer list is a simple list of printers that this driver works
# with. Alternatively, one can tell that a given printer works with a
# given driver also by a <drivers> list in the printer's XML file (see
# above).

 <printers>
  <printer>
   <id>printer/Alps-MD-1000</id><!-- Alps MD-1000 -->
  </printer>
  <printer>
   <id>printer/Alps-MD-1300</id><!-- Alps MD-1300 -->
  </printer>
  <printer>
   <id>printer/Alps-MD-2000</id><!-- Alps MD-2000 -->
  </printer>
  <printer>
   <id>printer/Alps-MD-4000</id><!-- Alps MD-4000 -->
  </printer>
 </printers>
</driver>

# In the printer list it is also possible to place comments or
# exceptions in the driver's functionality (see above) specific to a
# certain printer/driver pair:

#  <printer>
#   <id>printer/HP-LaserJet_4050</id><!-- HP LaserJet 4050 -->
#   <comments>
#    <en>to 1200dpi</en>
#   </comments>
#   <functionality>
#    <monochrome />
#   </functionality>
#  </printer>

# Note that printer/driver relationships can also be expressed by
# adding the driver to the <drivers> lists of the appropriate printer
# XML files.


source/opt/2.xml
================

# Every option exists independently from printers or drivers, because
# they might apply to arbitrary combinations of printers and/or
# drivers.  In practice, some drivers have wholly unique options
# (gutenprint for example), while others (lots of generic basic
# Ghostscript drivers, for example) share some options.

<option type="enum" id="opt/2">

# Options are of a type "enum", "bool", "int", "float", "string", or
# "password", options have an ID.  The id is also the filename.

# The shortname is a spaceless short name for the thing.  It must not
# contain / or : (otherwise it will not be handled correctly in PPD
# files). It should be one of the standard Adobe PPD option names if
# apropriate

  <arg_shortname>

# Various things here, and all <comments>, are internationalized.
# They take the usual posix locale codes in the form xx[_YY], where xx
# is a two-letter iso language code, and YY is two-letter country code
# to distinguish differing national dialects.
#
# Generally the national dialects won't be very common or necessary
# here.  The backends currently require that <en> content be provided.

   <en>PageSize</en><!-- backends only know <en> shortnames! -->
  </arg_shortname>

# The longname is a short phrase describing the thing in more detail
# GUI tools usually show longnames

  <arg_longname>
   <en>Page Size</en>
  </arg_longname>

# The <comments> are used to form documentation.  In theory these can
# become man pages or the like. Example:

#   <comments>
#    <en>
#     This option allows the user to get a lighter or darker printout, but
#     keeping totally black areas black and not making white areas gray.
#    </en>
#   </comments>

  <!-- A multilingual <comments> block can appear here, too;
       it should be treated as documentation for the user. -->

# The execution section describe how the backend should execute this
# option. The order and spot apply to the *driver*'s prototype for
# <arg_substitution /> (once called commandline) style options, or
# just the order applies for <arg_postscript /> and <arg_pjl />
# options. The order and the <arg_section> go into the "*OrderDependency"
# line of the appropriate option entry in the PPD file, for this example
# one would get

#    *OrderDependency: 100 DocumentSetup *PageSize

# When no <arg_section> is given, "AnySetup" is used as a default.

# For <arg_substitution /> options the <arg_proto> is inserted into
# the driver's command line, at the spot (e. g. "%A") whose letter is
# given between the <arg_spot>...</arg_spot> tags, the <arg_proto> of
# an <arg_postscript /> option is a snippet of PostScript code which
# is inserted into the PostScript data stream of the job, for
# DSC-conforming PostScript into the section specified with
# <arg_section>, otherwise in the beginning. The <arg_proto> lines of
# <arg_pjl /> options are PJL commands which are sent to the printer
# before the output of the driver's command line is sent. Because this
# only works reliably when the driver output does not have its own PJL
# command header, these options are ignored when the driver's XML file
# is marked with a <nopjl /> tag in its <execution> section. Drivers
# which produce their own PJL and therefore are marked with <nopjl />
# are for example "hpijs" and "hl1250". There is also the
# <arg_composite /> execution style for composite options, see the
# "Composite Options" section below. The user's value gets put into
# the <arg_proto>'s %s location. 

# The <arg_group>...</arg_group> tags put the option into the PPD
# option group named here. In many PPD-based GUIs ("kprinter", "xpp",
# OpenOffice.org, ...) every group is shown as a tab or a tree branch
# containing the member options of this group. You can also specify
# subgroups. Then you have to use a "group path" similar to directory
# paths, with the group and subgroup names separated by slashes
# (<arg_group>General/Paper</arg_group> is the "Paper" subgroup in the
# "General" group). Subgroups are not recommended as there is no GUI
# supporting them. If an option is member of a composite option (See
# "Composite Options" section below), the <arg_group>...</arg_group>
# tags will be ignored.

  <arg_execution>
   <arg_group>General</arg_group>
   <arg_order>100</arg_order>
   <arg_section>DocumentSetup</arg_section>
   <arg_spot>Z</arg_spot>
   <arg_postscript />
   <arg_proto>&lt;&lt;/PageSize[%s]/ImagingBBox null&gt;&gt;setpagedevice</arg_proto>
  </arg_execution>

# The constraints define what printer/driver combinations this option
# applies to.  The *most specific* constraint rules the day; it's
# "sense" says whether or not the option is "in".  The winning
# constraint also provides the default value used when this option
# applies to that printer and driver.

# Constraint elements are: driver, make, model.  The driver is the
# driver name, or not present to apply to any driver.  The make is the
# printer make, or not present to apply to any printer make.  The
# model is the driver model, or not present to apply to any printer.
# Instead of make/model, you can also specify <printer>id</printer>.

# IMPORTANT: The make and model must match the one in the printer xml
# definition, and everywhere else in the other options. One needs to
# write a utility to change printer names sensibly.

# It is illegal to have a model with no make.

# It is illegal to have none of make/model/driver.

# It is illegal to have *no* constraints, or at least such options are
# never used.

# For enum options, the defval is the id of the enum_val that is the
# default.  For other option types, it is the actual default value
# (ie, a number, or 1 or 0 for boolean, etc).

  <constraints>
     <constraint sense="true">
      <driver>sj48</driver>
      <arg_defval>ev/1</arg_defval>
     </constraint>
     <constraint sense="true">
      <driver>r4081</driver>
      <arg_defval>ev/1</arg_defval>
     </constraint>
# A gajillion constraints deleted
  </constraints>
  <enum_vals>
   <enum_val id="ev/1">
    <ev_longname>
     <en>US Letter</en>
    </ev_longname>
    <!-- A multilingual <comments> block can appear here, too;
         it should be treated as documentation for the user. -->
    <ev_shortname>
     <en>Letter</en>
     <!-- Until someone tells me how to learn the user locale in 
          backends, the shortname must be monolingual in <en>! -->
    </ev_shortname>

# If present, the driverval is what gets substituted in for the %s in
# the option's prototype.  This way the user-visible stuff can be
# anything.

    <ev_driverval>612 792</ev_driverval>

# This enum_val has no constraints.  It *is* OK for enum_vals to
# have no constraints; they are assumed to apply unless
# constrained otherwise.

   </enum_val>
   <enum_val id="ev/115">
    <ev_longname>
     <en>A3</en>
    </ev_longname>
    <!-- A multilingual <comments> block can appear here, too;
         it should be treated as documentation for the user. -->
    <ev_shortname>
     <en>A3</en>
     <!-- Until someone tells me how to learn the user locale in 
          backends, the shortname must be monolingual in <en>! -->
    </ev_shortname>
    <ev_driverval>842 1191</ev_driverval>

# Here are some example constraints for an enum_val.  The A3 size
# paper doesn't fit on lots of printers, so there are various
# constraints to make the right thing happen.

    <constraints>
     <constraint sense="true">
      <driver>ml85p</driver>
      <arg_defval>na</arg_defval>
     </constraint>
     <constraint sense="true">
      <make>HP</make>
      <model>DeskJet 1000C</model>
      <driver>pnm2ppa</driver>
      <arg_defval>na</arg_defval>
     </constraint>
     <constraint sense="false">
      <make>HP</make>
      <model>DeskJet 820C</model>
      <driver>pnm2ppa</driver>
      <arg_defval>na</arg_defval>
     </constraint>

     # lots more...

    </constraints>
   </enum_val>
  </enum_vals>
</option>

# To allow custom page sizes to be used one has add a choice with the
# "<ev_shortname>" being "Custom" to the "PageSize" option (example
# below). This choice will be treated as the custom page size. When
# the user selects this choice, he has to provide the width and the
# height of the page in addition. These values are converted into
# PostScript points (1/72 inches) and inserted into placeholders in
# the "<ev_driverval>" of this choice. The "<ev_driverval>" should
# contain a placeholder "%0" for the page width and "%1" for the page
# height. Alternatively the "<ev_driverval>" can contain two zeros
# ("0") from which the first will be replaced by the page width and
# the second by the page height. Then one gets Adobe-compliant entries
# for the custom page size in the PPD files and one can set a custom
# page size with the following commands:

# CUPS: lpr -P huge -o PageSize=Custom.500x750cm bigposter.ps
# LPRng: lpr -P huge -Z PageSize=Custom.500x750cm bigposter.ps
# GNUlpr: lpr -P huge -o PageSize=Custom.500x750cm bigposter.ps
# LPD: lpr -P huge -JPageSize=Custom.500x750cm bigposter.ps
# PPR (RIP): ppr -P huge -F "*PageSize Custom" --ripopts 500x750cm
#          bigposter.ps
# PPR (Int.): ppr -P huge -F "*PageSize Custom" -i 500x750cm bigposter.ps
# PDQ: pdq -P huge -oPageSize_Custom -aPageWidth=500
#          -aPageHeight=750 -oPageSizeUnit_cm bigposter.ps
# No spooler: foomatic-rip -P huge -o PageSize=Custom.500x750cm
#	   bigposter.ps

# Here is an example for a custom page size setting:

#   <enum_val id="ev/PageSize-Custom">
#    <ev_longname>
#     <en>Custom size</en>
#    </ev_longname>
#    <!-- A multilingual <comments> block can appear here, too;
#         it should be treated as documentation for the user. -->
#    <ev_shortname>
#     <en>Custom</en>
#     <!-- Until someone tells me how to learn the user locale in 
#          backends, the shortname must be monolingual in <en>! -->
#    </ev_shortname>
#    <ev_driverval>%0 %1</ev_driverval>
#   </enum_val>

# The entry

#    <ev_driverval>0 0</ev_driverval>

# would have the same effect as the <ev_driverval> of the example.

# For numerical (int, float) and bool options there is no <enum_vals>
# section. Instead of this section numerical options have tags to
# specify minimum and maximum value:

#  <arg_max>10.0</arg_max>
#  <arg_min>0.0</arg_min>

# For the %s in the <arg_proto> a number, either the user's choice
# when he has specified this option or the default value is
# inserted. Only numbers between the minimum and the maximum and in
# case of int options only integer numbers are allowed.

# Bool options can be set or not be set. There <arg_proto> will be
# inserted if they are set, nothing if they are not set. A %s in the
# <arg_proto> is not allowed, there is nothing to insert for it. As
# <arg_defval> in the option's constraints one can use 0 for not
# setting the option by default or 1 for setting it by default.

# Bool options need the specification of a name for the case when they
# are not set. This will be used by GUIs and in PPD files:

#  <arg_shortname_false>
#    <en>CorrectBlack</en><!-- Backends only know <en> shortnames! -->
#  </arg_shortname_false>

# This name should not contain spaces, ":", or "/".

# See below for string, password, and composite options.


Composite Options
-----------------

This is an option type to make it easier for users to choose the best
settings for a certain printing task, even if the driver has very many
options. The idea is to have an enumerated choice option which does
not directly modify something in the driver's command line but sets
several of the other options.

One example is the "PrintoutMode" option which will be made available
for all printer/driver combos which have at least one option regarding
the printout quality or document type. 

The possible choices should be the same for every printer and driver,
so that users (especially newbies) can bring their printers in the
right mode by choosing one easy to understand item from a menu instead
of having to switch several cryptic driver options. For now the
choices are the following:

   Command line  GUI                Intention
   -----------------------------------------------------------------------
   Draft         Draft              Very fast, ink/toner-saving printout
   Normal        Normal             Quick standard quality printout
   High          High Quality       High quality for plain paper
   VeryHigh      Very High Quality  Highest quality for plain/inkjet paper
   Photo         Photo              Highest quality for photo paper

These choices can also have one of the following modifiers:

   Modifier      Intention
   -----------------------------------------------------------------------
   .Gray         Grayscale printing on a color printer
   .Mono         Monochrome printing (no grayscales, black or white)

Examples:

   Command line   GUI                      Comment
   ---------------------------------------------------------------------
   High.Gray      High Quality Grayscale
   Photo          Photo                    Color photos on color printer
   VeryHigh.Mono  Very High Quality Monochrome  Really black text in
                                           highest quality on inkjet
                                           printer, not suitable for
                                           halftone images.
   Normal         Normal                   Standard color in 300/360 dpi
                                           on normal paper, grayscale
                                           on black-and-white printers

Not all choices/combinations of basic choices and modifiers must be
present. Often modes are simply not available on certain
printer/driver combos, as "Photo" on most lasers. It is highly
recommended to have "Normal" available, though (and having this the
default).

The GUI names can have additional remarks in parantheses, for example
when manual intervention (other cartridge, photo paper) is needed.

To add such an option to the database, one only needs to add an option
XML file like the one below into the db/source/opt directory of the
database. The file db/source/opt/pcl3-PrintoutMode.xml could look
like this:

--------------------------------------------------------------------------
<option type="enum" id="opt/pcl3-PrintoutMode">
  <!-- A multilingual <comments> block can appear here, too;
       it should be treated as documentation for the user. -->
  <arg_longname>
   <en>Printout Mode</en>
  </arg_longname>
  <arg_shortname>
   <en>PrintoutMode</en><!-- backends only know <en> shortnames! -->
  </arg_shortname>
  <arg_execution>
   <arg_order>10</arg_order>
   <arg_section>AnySetup</arg_section>
   <arg_spot>A</arg_spot>
   <arg_composite />
   <!-- <arg_proto></arg_proto> -->
  </arg_execution>
  <constraints>
     <constraint sense="true">
      <driver>pcl3</driver>
      <arg_defval>ev/pcl3-PrintoutMode-Normal</arg_defval>
     </constraint>
  </constraints>
  <enum_vals>
   <enum_val id="ev/pcl3-PrintoutMode-Draft">
    <ev_longname>
     <en>Draft</en>
    </ev_longname>
    <!-- A multilingual <comments> block can appear here, too;
         it should be treated as documentation for the user. -->
    <ev_shortname>
     <en>Draft</en>
     <!-- Until someone tells me how to learn the user locale in
          backends, the shortname must be monolingual in <en>! -->
    </ev_shortname>
    <ev_driverval>MediaType=Plain Resolution=150 Quality=Draft IntensityRendering=Halftones Passes=1</ev_driverval>
   </enum_val>
   <enum_val id="ev/pcl3-PrintoutMode-Normal">
    <ev_longname>
     <en>Normal</en>
    </ev_longname>
    <!-- A multilingual <comments> block can appear here, too;
         it should be treated as documentation for the user. -->
    <ev_shortname>
     <en>Normal</en>
     <!-- Until someone tells me how to learn the user locale in
          backends, the shortname must be monolingual in <en>! -->
    </ev_shortname>
    <ev_driverval>MediaType=Plain Resolution=300 Quality=Normal IntensityRendering=Halftones Passes=1</ev_driverval>
   </enum_val>
   <enum_val id="ev/pcl3-PrintoutMode-High">
    <ev_longname>
     <en>High</en>
    </ev_longname>
    <!-- A multilingual <comments> block can appear here, too;
         it should be treated as documentation for the user. -->
    <ev_shortname>
     <en>High</en>
     <!-- Until someone tells me how to learn the user locale in
          backends, the shortname must be monolingual in <en>! -->
    </ev_shortname>
    <ev_driverval>MediaType=Plain Resolution=600 Quality=Presentation IntensityRendering=FloydSteinberg Passes=4</ev_driverval>
   </enum_val>
   <enum_val id="ev/pcl3-PrintoutMode-Photo">
    <ev_longname>
     <en>Photo (on photo paper)</en>
    </ev_longname>
    <!-- A multilingual <comments> block can appear here, too;
         it should be treated as documentation for the user. -->
    <ev_shortname>
     <en>Photo</en>
     <!-- Until someone tells me how to learn the user locale in
          backends, the shortname must be monolingual in <en>! -->
    </ev_shortname>
    <ev_driverval>MediaType=Premium Resolution=600 Quality=Presentation IntensityRendering=FloydSteinberg Passes=4</ev_driverval>
   </enum_val>
  </enum_vals>
</option>
--------------------------------------------------------------------------

The shown option is only an example, it is neither in the BZR
repository nore will it work with all printers which use the "pcl3"
driver. You can paste it into a file (make the <ev_driverval>s being
one line, the items separated by spaces) and copy it to db/source/opt/
to try it out.

The "<arg_composite />" tag for the execution style specifies it as a
composite option. The <arg_spot> and <arg_proto> are meaningless in a
composite option and the "<ev_driverval>"s contain a space-separated
list of all settings of which the pre-made configuration represented
by this choice consists. Every choice of the composite option must set
EXACTLY THE SAME individual options. In no choice it is allowed to
leave out one of them. These individual options are the member options
of the composite option. Not all options of a driver/printer combo
need to be member options of the composite option. It is not allowed
to have one option being member of more than one composite option. The
composite option must be an enumerated choice option, the member
options must be enumerated choice or boolean options. Member options
can even be composite options, so composite options can be nested.

It is enough to add a composite option as shown. The PPD generator
(getppd() in lib/Foomatic/DB.pm, package "foomatic-db-engine") will
take care of the rest. It will

   - Order all member options into a group (PPD group, see "Option
     Grouping" below) named after the composite option.

   - Add to every member option the choice "Controlled by '<name of
     the composite option>'" and make this choice the default. If this
     is chosen, the composite option will set the value for this
     member, depending on what value is chosen for the composite
     option. If the user chooses something else than "Controlled by
     '<name of the composite option>'" the member option does not obey
     the setting given by the composite option. So the advanced user
     can also set the member options individually.

   - If necessary the <arg_order> and <arg_section> of the composite
     option is replaced by other values in the PPD file, so that the
     composite option will be stuffed into the PostScript data stream
     always before all its member options. Do not give "0" as the
     order number to any of the member options.

A composite option can also span only one (but not zero) member
option. This is for example done with the "PrintoutMode" option of the
HPIJS driver ("foomatic-db-hpijs" package). This driver has only one
option for setting resolution and quality, but this option has
sometimes many choices with rather cryptic names. The "PrintoutMode"
maps to the most important choices with the above-mentioned names, and
in addition, these names are the same as of the "PrintoutMode" options
of other drivers, so the user finds the important printing modes more
easily.

The facility of composite options can also be used for other things
than for a "PrintoutMode" option, for example a finisher could be
controlled by a composite option (to have the most common finishing
tasks as "Bound booklet", "Stapled booklet", "Letter in envelope",
...).


Forced Composite Options
------------------------

Forced composite options are very similar to composite options, but the
user cannot set the individual member options, but only the composite
option (the user is forced to use the composite option). This allows
options acting at two or more places.

Example: A printer driver is a filter which converts a generic bitmap
produced by Ghostscript to the printer's native format. The command
line for converting PostScript to the printer's language could look like this

gs -q -dBATCH -dSAFER -dNOPAUSE -sDEVICE=bitcmyk -r600 -sOutputFile=-
- | filter -size=<width>x<height>

where <width> and <height> is the page size in points (1/72
inches). In addition, Ghostscript needs to know the page size. For
this one usually puts the following PostScript code into the
PostScript input file:

<</PageSize[<width> <height>]/ImagingBBox null>>setpagedevice

where <width> and <height> is again the page size in points. So we
need two options for setting the page size, one PostScript option to
set the page size for Ghostscript and one command line option to set
the page size for the filter. The user would have to change both when
he wants to print on another paper size, and it does not make sense to
have different settings for the two. So one could make the "PageSize"
option a composite option of the two, but then the GUI exposes an ugly
"PageSize" group with the two individual options. To avoid this, one
uses a forced composite option ("Forced" because the user is forced to
use the composite option, the individual member options are not
accessible).

Assuming that the name of the PostScript option for the page size is
"GSPageSize", the name of the page size option for the filter is
"filterPageSize" and both have the choices "A4", "Letter", and
"Legal", the forced composite option named "PageSize" would look as
follows:

--------------------------------------------------------------------------
<option type="enum" id="opt/filter-PageSize">
  <!-- A multilingual <comments> block can appear here, too;
       it should be treated as documentation for the user. -->
  <arg_longname>
   <en>Page Size</en>
  </arg_longname>
  <arg_shortname>
   <en>PageSize</en><!-- backends only know <en> shortnames! -->
  </arg_shortname>
  <arg_execution>
   <arg_order>10</arg_order>
   <arg_section>AnySetup</arg_section>
   <arg_spot>A</arg_spot>
   <arg_forced_composite />
  </arg_execution>
  <constraints>
     <constraint sense="true">
      <driver>filter</driver>
      <arg_defval>ev/filter-PageSize-Letter</arg_defval>
     </constraint>
  </constraints>
  <enum_vals>
   <enum_val id="ev/filter-PageSize-Letter">
    <ev_longname>
     <en>Letter</en>
    </ev_longname>
    <!-- A multilingual <comments> block can appear here, too;
         it should be treated as documentation for the user. -->
    <ev_shortname>
     <en>Letter</en>
     <!-- Until someone tells me how to learn the user locale in
          backends, the shortname must be monolingual in <en>! -->
    </ev_shortname>
    <ev_driverval>GSPageSize=Letter filterPageSize=Letter</ev_driverval>
   </enum_val>
   <enum_val id="ev/filter-PageSize-Legal">
    <ev_longname>
     <en>Legal</en>
    </ev_longname>
    <!-- A multilingual <comments> block can appear here, too;
         it should be treated as documentation for the user. -->
    <ev_shortname>
     <en>Legal</en>
     <!-- Until someone tells me how to learn the user locale in
          backends, the shortname must be monolingual in <en>! -->
    </ev_shortname>
    <ev_driverval>GSPageSize=Legal filterPageSize=Legal</ev_driverval>
   </enum_val>
   <enum_val id="ev/filter-PageSize-A4">
    <ev_longname>
     <en>A4</en>
    </ev_longname>
    <!-- A multilingual <comments> block can appear here, too;
         it should be treated as documentation for the user. -->
    <ev_shortname>
     <en>A4</en>
     <!-- Until someone tells me how to learn the user locale in
          backends, the shortname must be monolingual in <en>! -->
    </ev_shortname>
    <ev_driverval>GSPageSize=A4 filterPageSize=A4</ev_driverval>
   </enum_val>
  </enum_vals>
</option>
--------------------------------------------------------------------------

This looks exactly like a usual composite option and works also the
same way. The only difference is that instead of an "<arg_composite
/>" tag "<arg_forced_composite />" is used. If the PPD generator finds
such an option, it hides the member options by only using
"*Foomatic..." keywords to describe them, not any standard PPD
keywords as "*OpenUI...", "*OrderDependency...", ... This way
PPD-aware graphical frontends do not see the member options but
foomatic-rip has all information from them to run the driver
correctly.


String and Password Options
---------------------------

These options allow the user to supply nearly arbitrary strings
(within limits of length, characters and structure) to the printer
driver, for example names of color calibration files, fax numbers,
passwords for confidential jobs, ... Frequently needed strings can be
added as enumerated choices, so a frontend can show the option as a
combo-box. The enumerated choices are also used for frontends which
only support options as defined by the PPD spec. So having enumerated
choices is highly recommended for most of these options.

In the XML database string and password options look similar to
enumerated choice options. The differences are the option types
"string" or "password" and the additional tags to restrict the
possible strings.

The "<arg_maxlength>" tags give a length limit, it should once not
allow strings longer than around 100 characters, as otherwise
foomatic-configure could generate a line longer than the allowed 255
characters in the PPD file when setting the default value, and second,
which is very important, it should not allow strings which are too
long for the printer filter or driver so that buffer overflows cannot
occur. Not using the "<arg_maxlength>" tags makes arbitrary long
strings to be accepted, this is not recommended.

With "<arg_allowedchars>" the accepted strings can be restricted to
contain only the characters given in the list. This restrictions does
not only avoid that the filter chokes on a wrong option, it serves
mainly for security reasons, for example to avoid a string like "|| rm
-rf * ||" for a command line option. So if the option prototype does
not quote the string, command delimiter characters, I/O re-directors,
and shell special characters (";", "|", "&", "<", ">", "*", "?", "[",
"]", "{", "}", "(", ")", "$", "\", "'", """) should not be allowed. If
the string is quoted by the option prototype, the closing quote
character and the backslash should not be allowed, so that one cannot
escape from the quoting. The allowed characters are checked by a
"/^[...]*$/" expression in the Perl scripts, so ranges with "-", a
list of forbidden characters with a leading "^", or special characters
as "\w", "\d", "\x07", ...  are allowed. To allow a backslash, one has
to escape it by using two backslashes ("\\"). To allow a "-" it must
be in the end of the list to not make it defining a range and for a
"^" must be placed at any other place than the beginning of the string
if it should be explicitly allowed.

"<arg_allowedregexp>" allows also to restrict the structure of the
string, as it defines an arbitrary Perl regular expression (see "man
perlre") which has to be matched by the string. This serves also for
having only strings which are usable by the filter and which do not
destroy the command line structure. With this one can for example
forbid a backslash as the last character to avoid escaping the closing
quote of the option prototype. Regular expressions are applied via a
'/.../' expression in the Perl scripts. To apply the pattern matching
modifiers "i", "m", "s", or "x" (as "/.../i" for case-insensitive
matching) begin the regular expression with "(?<modifiers>)" (as
"(?i)..." for case-insensitive matching).

It is highly recommended to use at least one of "<arg_allowedchars>"
and "<arg_allowedregexp>", as otherwise all characters are allowed in
the user-supplied string and so a malicious user can execute arbitrary
shell or PostScript commands. If both tags are used, both conditions
have to be fulfilled.

Note that for the character lists and regular expressions in the XML
files the following character substitutions have to be done:

   < --> &lt;
   > --> &gt;
   " --> &quot;
   ' --> &apos;
   & --> &amp;

Here is an example for an option to supply the file name for an ICC
profile for the "foo2zjs" driver (this option is neither in the CVS
for the Foomatic database nor tested with this driver):

--------------------------------------------------------------------------
<option type="string" id="opt/foo2zjs-ICM">
    <comments>
	<en>
	This option controls which .ICM file to use for color correction.
	ICM files are stored in the directory /usr/share/foo2zjs/icm/.
	</en>
    </comments>
    <arg_longname> <en>ICM Color Profile</en> </arg_longname>
    <arg_shortname> <en>ICM</en> </arg_shortname>
    <arg_execution>
	<arg_group>Adjustment</arg_group>
	<arg_order>300</arg_order>
	<arg_spot>A</arg_spot>
	<arg_required />
	<arg_substitution />
	<arg_proto>-G%s </arg_proto>
    </arg_execution>
    <arg_maxlength>127</arg_maxlength>
    <arg_allowedchars>A-Za-z0-9\._/-</arg_allowedchars>
    <arg_allowedregexp>(?&lt;!\/)$</arg_allowedregexp>
    <constraints>
	<constraint sense="true">
	    <driver>foo2zjs</driver>
	    <arg_defval>ev/foo2zjs-ICM-none</arg_defval>
	</constraint>
	<constraint sense="true">
	    <make>Minolta</make>
	    <model>magicolor 2300 DL</model>
	    <driver>foo2zjs</driver>
	    <arg_defval>ev/foo2zjs-ICM-DL2312</arg_defval>
	</constraint>
	<constraint sense="true">
	    <make>Minolta</make>
	    <model>magicolor 2200 DL</model>
	    <driver>foo2zjs</driver>
	    <arg_defval>ev/foo2zjs-ICM-DL2200RGB</arg_defval>
	</constraint>
    </constraints>
    <enum_vals>
	<enum_val id="ev/foo2zjs-ICM-none">
	    <ev_longname> <en>No ICM color correction</en> </ev_longname>
	    <ev_shortname> <en>None</en> </ev_shortname>
	    <ev_driverval></ev_driverval>
	</enum_val>
	<enum_val id="ev/foo2zjs-ICM-DL2312">
	    <ev_longname> <en>File DL2312.icm</en> </ev_longname>
	    <ev_shortname> <en>DL2312</en> </ev_shortname>
	    <ev_driverval>DL2312.icm</ev_driverval>
	    <constraints>
	        <constraint sense="false">
	    	    <make>HP</make> <model>LaserJet 1000</model>
	        </constraint>
	    </constraints>
	</enum_val>
	<enum_val id="ev/foo2zjs-ICM-DL2324">
	    <ev_longname> <en>File DL2324.icm</en> </ev_longname>
	    <ev_shortname> <en>DL2324</en> </ev_shortname>
	    <ev_driverval>DL2324.icm</ev_driverval>
	    <constraints>
	        <constraint sense="false">
	    	    <make>HP</make> <model>LaserJet 1000</model>
	        </constraint>
	    </constraints>
	</enum_val>

	...

    </enum_vals>
</option>
--------------------------------------------------------------------------

This option allows to choose either one of the given file names,
either by using the "<ev_shortname>"s or the "<ev_driverval>"s, or one
can give every arbitrary other file name with a maximum length of 127
characters, only containing letters, digits, periods, underscores,
dashes, and slashes, and not having a slash in the end (no
directories). Note that in Perl the period must be escaped by a
backslash to be taken literally, otherwise it stands for an arbitrary
character. The regular expression for blocking out strings ending with
a slash is "(?<!\/)$" (see "man perlre", search for "(?"). Here the
slash is quoted by a backslash. In the XML file the "<" is replaced by
"&lt;" so that the XML structure does not get broken. foomatic-rip
translates this back before applying the regular expression.

To be able to offer strings as an enumerated choice which are not
allowed as an option name in a PPD file, the "<ev_shortname>" may
differ from the "<ev_driverval>", the string inserted at the "%s"
place holder in the "<arg_proto>" is always the "<ev_driverval>",
independent whether the user supplies the "<ev_driverval>" directly or
the "<ev_shortname>". In this example both

   lpr -o ICM= file.ps

and

   lpr -o ICM=None file.ps

supply an empty string as the value of the ICM option.

For the default value there must be an enumerated choice, if there is
none, the PPD generator will create one. So this entry is allowed
(this option is only an example, it is not in the CVS of the Foomatic
database):

--------------------------------------------------------------------------
<option type="password" id="opt/Password">
  <!-- A multilingual <comments> block can appear here, too;
       it should be treated as documentation for the user. -->
  <arg_longname>
   <en>Password (for confidential jobs)</en>
  </arg_longname>
  <arg_shortname>
   <en>Password</en><!-- backends only know <en> shortnames! -->
  </arg_shortname>
  <arg_execution>
   <arg_group>General</arg_group>
   <arg_order>100</arg_order>
   <arg_spot>B</arg_spot>
   <arg_substitution />
   <arg_proto> --pass=%s</arg_proto>
  </arg_execution>
  <arg_maxlength>30</arg_maxlength>
  <arg_allowedchars>A-Za-z0-9\.,_\+\=\:-/</arg_allowedchars>
  <constraints>
     <constraint sense='true'>
      <driver>mydriver</driver>
      <arg_defval></arg_defval>
     </constraint>
  </constraints>
</option>
--------------------------------------------------------------------------

The default value is an empty string here. So the PPD generator will
add a choice for the empty string.

Normally, automatically added choices get the same "<ev_shortname>" as
the string itself, but if the string is not allowed as an option name
in a PPD file, the "<ev_shortname>" will be modified. For an empty
string (as in the example above) "None" will be used and all
characters except numbers, letters, and underscores ("_") will be
replaced by underscores.

The option types "string" and "password" are treated exactly the same
way by the PPD generator and by foomatic-rip, the different names
are only for frontends to know whether the input field should display
the typed characters or asterisks on the screen.


CUPS Custom Options
-------------------

CUPS defines several extensions to the PPD specifications to support
the functionality of modern printers:

http://www.cups.org/documentation.php/doc-1.4/spec-ppd.html

There are extensions for so-called "Custom Options" where instead of
given enumerated choices freely choosable custom values can be
supplied. As Foomatic's numerical, string, and password options can be
implemented as CUPS custom options in the PPDs as well, the PPD
generator does both implementations in the PPDs. There are the
"*Foomatic..." keywords generated, as before, but also the CUPS PPD
extension, consisting of the keywords "*Custom<option>" and
"*ParamCustom<option>" keywords. This way GUIs which are aware of
CUPS' custom options give full access to Foomatic's numerical, string,
and password options.

foomatic-rip understands also PPD files now which describe custom
options only by the CUPS extension and not with "*Foomatic..."
keywords.

Allowed characters and regular expressions for string and password
options cannot be described by CUPS PPD extensions. So CUPS-aware GUIs
will allow input of strings which do not match these restrictions, but
foomatic-rip will let the option fall back to the default value in
such a case. This way the security is assured.


Option Grouping
---------------

All options should be put in groups (with the tags
"<arg_group>...</arg_group>" in the "<arg_execution>" section of the
option XML files, see above). This way many GUIs sort the options into
tabs or tree branches according to the groups. This way one gets only
the most important options on the first tab and not so often needed
ones on additional tabs. This also overrides the automatic option
grouping of CUPS (Groups "General" and "Extra").

It is recommended to have the options in groups as follows (plus
perhaps special groups, but not one group for every option):

General

  Here go options which are most used on a job-by-job basis, as the
  options for paper type, size, and tray, ink type, duplex, ... and
  all options affecting the printout quality, as resolution,
  dithering, ... and especially "PrintoutMode". If a "PrintoutMode"
  option is present, all quality-related options covered by the
  "PrintoutMode" option go into the automatically created
  "PrintoutMode" group (see above). And this is intended, these
  options are now usually controlled by "PrintoutMode" and so they are
  not the most important options for the first tab any more.

  Do not put color/brightness/gamma, ... options here, they go to
  "Adjustment".

  Options typically to go here are:

    o PageSize
    o InputSlot
    o MediaType
    o InkType
    o Duplex
    o PrintoutMode
    o Resolution
    o REt
    o Dither
    o FastRes
    o Economode
    o ...

  All options mentioned after "PrintoutMode" will usually be used as
  member options for "PrintoutMode", they are only in this group when
  there is no "PrintoutMode" option.

PrintoutMode

  This group only exists if there is a "PrintoutMode" option, because
  it is generated by this option. It contains the member options of
  "PrintoutMode". Typical candidates are

    o Resolution
    o REt
    o Dither
    o FastRes
    o Economode
    o ...

  They do not need an "<arg_group>PrintoutMode</arg_group>" line, they
  are put into this group automatically. You should better put an
  "<arg_group>General</arg_group>" line into these options, so that
  they go into the "General" group when there is a printer/driver
  combo for which no "PrintoutMode" option applies.

Adjustment

  Options for correcting the appearance of colors, contrast, ..., for
  head alignment, ... etc. Here most numerical options will go, but
  also things like "Density", also if it is an enumerated choice
  option. Typical candidates are:

    o Gamma
    o Brightness
    o Contrast
    o Density
    o Saturation
    o Cyan
    o Magenta
    o Yellow
    o ...

Finishing

  If a printer has a stapler, folder, cutter, envelope packer, or
  similar devices to do additional processing on the ready printout,
  the options to control this stuff go into this group. Examples:

    o Stapling
    o Binding
    o Cutting
    o Booklet
    o ...

Miscellaneous

  Options which do not fit into the mentioned groups and for which it
  is not worth to make a special group.


Unprintable margins
-------------------

On most printers you cannot print arbitrarily close to the borders of
the paper. You usually will have margins of certain width on which you
cannot print. For filters and application programs to know about these
margins PPD files have "*ImageableArea" lines which define the
positions of the lower, the upper, the left, and the right borders of
the area on which the printer can print. There is one line for each
paper size listed in the "*PageSize" option.

To conveniently generate these lines one can use the following XML
structure in the Foomatic database entries:

--------------------------------------------------------------------------
<margins>
     <general>
       <!-- The margins here are valid for every paper size for -->
       <!-- which there is no "exception" section -->
       <!-- ---------- -->
       <!-- possible units: -->
       <!-- pt, in, mm, cm,
       <!-- dotsNNNdpi (NNN: resolution in which dots are counted) -->
       <!-- if "unit" not present, default unit is pt -->
       <!-- ---------- -->
       <!-- if a margin is not present, default width is used -->
       <!-- ---------- -->
       <!-- a missing "general" section assumes the default borders as the -->
       <!-- general borders and "pt" as the default unit for -->
       <!-- "exceptions". -->
       <!-- ---------- -->
       <!-- Default margin widths: 1/4 inch left/right, 1/2 inch top/bottom -->
       <unit>pt</unit>
       <top>9</top>
       <bottom>36</bottom>
       <left>18</left>
       <right>18</right>
     </general>
     <exception PageSize="Photo4x6TearoffTab">
       <!-- if one or more of "unit", "top", "bottom", "left", -->
       <!-- "right" is missing, the appropriate item of the "general" -->
       <!-- section is used -->
       <top>0</top>
       <left>0</left>
       <right>0</right>
     </exception>
     <exception PageSize="A4">
       <!-- It is also possible to give absolute values in PostScript -->
       <!-- coordinates where the origin is the lower left corner. To -->
       <!-- do so, the <absolute /> tag has to be added, otherwise -->
       <!-- the values are the widths of the unprintable margins -->
       <absolute />
       <left>10</left>
       <right>585</right>
     </exception>
     <exception PageSize="...">
       ...
     </exception>
     ...
<margins>
--------------------------------------------------------------------------

This structure is allowed in printer entries in the "<mechanism>" 
section and in driver entries in the "<execution>" section or inside a 
"<printer>" entry of the driver's printer list. In the "<execution>" 
section of a driver entry the margins are valid for all printers used 
with this driver, in a "<printer>" entry they apply only to the given 
printer/driver combo.

The shown example could be for the HP PhotoSmart 7150/7350, which does 
full-bleed only on HP's special photo paper with an 0.5 inch wide 
tear-off tab on the lower border (and some other paper sizes used in the 
photo tray). On all other paper sizes the printer leaves white borders 
of half an inch at the top and at the bottom and a quarter of an inch on 
the left and right hand side (1 inch are 72 pt). In addition, the page 
size "A4" allows to print up to 10 points to the left and the right borders.

At first we give the general borders ("<general>" section) where we 
choose the unit "pt" (PostScript points) for the numbers. These borders 
are valid for all paper sizes which are not explicitly mentioned with an 
"<exception ...>" section. For our printers one of the exceptions is the 
4x6 photo paper with the tear-off tab (including the tab the paper is 
4x6.5 inches large). here the printer prints up to the left, right, and 
top borders. Therefore we have margins of zero here. At the lower border 
the printer still leaves half an inch white (therefore probably HP 
introduced the tear-off tab), so we keep the 36 pt of the "<general>" 
section by not mentioning a new lower border. For A4 we redefine the 
left and the right border. This is also possible in absolute PostScript 
coordinates measured from the lower left corner, as we do here. We 
indicate this with the "<absolute />" tag. The left border is at 10 pt 
from the left, and as A4 paper is 595 pt wide, the right border is at 
585 points from the left.

One hint for the choice of the units: Float numbers as border widths are 
allowed, but it is recommended for having exact info to choose a unit 
which gives integer numbers for the widths (which is always possible 
with the "dotsNNNdpi" unit with NNN being the maximum resolution of the 
printer).

A "<margins>" section in a printer entry should represent the printer's 
hardware capabilities. Such a section in a driver entry should represent 
how the driver's limitations are. If there are margins defined in both 
the printer and the driver entry of the desired printer/driver combo, 
the more restrictive (wider) borders count. If there are no border 
definitions in both the printer and the driver entry, the borders are 
assumed to be of the default widths.


Adding arbitrary extra entries to the PPD file
----------------------------------------------

The "<ppdentry>" tags allow to add extra lines to the PPD file. The 
tags can be put into the top level ("<printer>") of a printer XML entry, 
into the "<execution>" section of a driver XML entry, or into the 
"<printer>" entries of the printer list in a driver XML file. They serve 
mainly to put a default resolution into PPD files for drivers without 
"Resolution" option. Examples:

"hpijs"  driver, default resolution for HP DeskJet 350. For this driver 
the default resolution depends on the printer class. Therefore the 
appropriate "<ppdentry>"s have to be in the printer entries of the 
printer list:

--------------------------------------------------------------------------
<driver id="driver/hpijs">
  <name>hpijs</name>
  ...
  <printers>
   <printer>
    <id>printer/HP-DeskJet_350C</id><!-- HP DeskJet 350C -->
    <ppdentry>
      *DefaultResolution: 600dpi
    </ppdentry>
    <margins>
     <general>
      <unit>in</unit>
      <relative />
      <left>0.25</left>
      <right>0.25</right>
      <top>0.125</top>
      <bottom>0.67</bottom>
     </general>
     <exception PageSize="A4">
      <left>0.135</left>
      <right>0.135</right>
     </exception>
    </margins>
   </printer>
   ...
  </printers>
</driver>
--------------------------------------------------------------------------

"pnm2ppa" driver: This driver has no "Resolution" option, and all 
printers print in 600 dpi with it. So we put the "<ppdentry>" into the 
"<execution>" section:

--------------------------------------------------------------------------
<driver id="driver/pnm2ppa">
  <name>pnm2ppa</name>
  <url>http://sourceforge.net/projects/pnm2ppa/</url>
  <execution>
   <filter />
   <prototype>gs -q -dNOPAUSE -dPARANOIDSAFER -dBATCH -r600%A%Z 
-sOutputFile=- - | pnm2ppa%C%B -i - -o -</prototype>
   <ppdentry>
    *DefaultResolution: 600dpi
   </ppdentry>
  </execution>
  ...
</driver>
--------------------------------------------------------------------------

Note that leading spaces are removed from the lines between the
"<ppdentry>" tags before they get inserted into the PPD file.

The lines are added at the end of the PPD file header, right after the
lines for the basic hardware capabilities of the printer.


Example for a Foomatic-generated PPD file
-----------------------------------------

Below is an example PPD file, the PPD file for the HP Color LaserJet 4550
used with the "pxlcolor" driver. It was generated with the command line

   ./foomatic-ppdfile -p HP-Color_LaserJet_4550 -d pxlcolor

The structure is completely Adobe-compliant and no relevant
information is in comments. Besides the usual keywords which one finds
in PPDs there are some special ones beginning with
"*Foomatic...". These keywords are read by foomatic-rip and contain
all information to build the renderer's command line. See explanations
for these keywords below the example file.

If a printer has auto-detection information in the Foomatic database,
the manufacturer and model names from there are inserted in the
"*Manufacturer:" and "*Product:" fields and the IEEE-1284 ID string is
put into the "*1284DeviceID:" field.

Independent whether there is auto-detection information, there is an
additional "DRV:" field in the "*1284DeviceID:" which contains driver
properties. These properties are put here, so that they appear in
CUPS' PPD/driver overview listings ("lpinfo -l -m"). This way a
printer setup tool can show the driver properties in a driver overview
without needing to generate and read the PPD files. The following
properties are available (comma-separated):

   D: Driver name
   R: Driver Recommended for this printer (0, 1)?
   M: Driver supplied by the Manufacturer (0, 1)?
   O: Driver marked Obsolete in the OpenPrinting database (0, 1)?
   F: Driver is Free software (0, 1)?
   P: Driver has Patent issues (0, 1)?
   S: Support contacts (c: commercial, v: voluntary, u: unknown, more than 
      one possible)
   T: Driver Type: G: Ghostscript built-in, C: CUPS-Raster, I: IJS,
      O: OpenPrinting Vector, F: Filter, U: Ghostscript Uniprint,
      P: PostScript
   X: Maximum X resolution of the driver in dpi
   Y: Maximum Y resolution of the driver in dpi
   C: Does the driver support Color printing (0, 1)?
   t: Rating for Text document printing with this driver (0 ... 100)
   l: Rating for Line art document printing with this driver (0 ... 100)
   g: Rating for Graphics document printing with this driver (0 ... 100)
   p: Rating for Photo document printing with this driver (0 ... 100)
   d: Rating for system loaD caused when printing with this driver (0 ... 100)
   s: Rating for processing Speed of this driver (0 ... 100)

The "DRV:" field in a device ID looks like this:

*1284DeviceID: "MFG:Hewlett-Packard;MDL:HP LaserJet 4050 Series;CMD:PJL,MLC,PCL,
PCLXL,POSTSCRIPT;DES:Hewlett-Packard LaserJet 4050 Series;DRV:Dljet4,R0,M0,F1,Sv,TG,X600,Y600,C0,t90,l90,g60,p30,s90;"

If there is no device ID for a printer, the "*1284DeviceID" will
contain only the "DRV:" field.

The PPDs contain the driver properties also in clear text, like this:

*driverName ljet4/ljet4 - Built-in Ghostscript driver for PCL 5e laser printers: ""
*driverType G/Ghostscript built-in: ""
*driverUrl: "http://www.ghostscript.com/"
*driverObsolete: False
*driverRecommendedReplacement: hpijs      (only if driver is obsolete)
*driverSupplier: "GPL Ghostscript"
*driverManufacturerSupplied: False
*driverLicense: "GPL"
*driverFreeSoftware: True
*driverSupportContactVoluntary: "http://forums.openprinting.org/ OpenPrinting forums"
*driverSupportContactCommercial: "http://... ..."
*driverSupportContactUnknown: "http://... ..."
*driverMaxResolution: 600 600
*driverColor: False
*driverTextSupport: 90
*driverLineartSupport: 90
*driverGraphicsSupport: 60
*driverPhotoSupport: 30
*driverSystemmLoad: 90
*driverRenderingSpeed: 90

----------------------------------------------------------------------------
*PPD-Adobe: "4.3"
*%
*% For information on using this, and to obtain the required backend
*% script, consult http://www.openprinting.org/
*%
*% This file is published under the GNU General Public License
*%
*% PPD-O-MATIC (4.0.0 or newer) generated this PPD file. It is for use with 
*% all programs and environments which use PPD files for dealing with
*% printer capability information. The printer must be configured with the
*% "foomatic-rip" backend filter script of Foomatic 4.0.0 or newer. This 
*% file and "foomatic-rip" work together to support PPD-controlled printer
*% driver option access with all supported printer drivers and printing
*% spoolers.
*%
*% To save this file on your disk, wait until the download has completed
*% (the animation of the browser logo must stop) and then use the
*% "Save as..." command in the "File" menu of your browser or in the 
*% pop-up manu when you click on this document with the right mouse button.
*% DO NOT cut and paste this file into an editor with your mouse. This can
*% introduce additional line breaks which lead to unexpected results.
*%
*% You may save this file as 'HP-Color_LaserJet_4550-pxlcolor.ppd'
*%
*%
*FormatVersion:	"4.3"
*FileVersion:	"1.1"
*LanguageVersion: English 
*LanguageEncoding: ISOLatin1
*PCFileName:	"PXLCOLOR.PPD"
*Manufacturer:	"HP"
*Product:	"(HP Color LaserJet 4550)"
*cupsVersion:	1.0
*cupsManualCopies: True
*cupsModelNumber:  2
*cupsFilter:	"application/vnd.cups-postscript 100 foomatic-rip"
*cupsFilter:	"application/vnd.cups-pdf 0 foomatic-rip"
*%pprRIP:        foomatic-rip other
*ModelName:     "HP Color LaserJet 4550"
*ShortNickName: "HP Color LaserJet 4550 pxlcolor"
*NickName:      "HP Color LaserJet 4550 Foomatic/pxlcolor"
*PSVersion:	"(3010.000) 550"
*PSVersion:	"(3010.000) 651"
*PSVersion:	"(3010.000) 652"
*PSVersion:	"(3010.000) 653"
*PSVersion:	"(3010.000) 704"
*PSVersion:	"(3010.000) 705"
*PSVersion:	"(3010.000) 800"
*PSVersion:	"(3010.000) 815"
*PSVersion:	"(3010.000) 850"
*PSVersion:	"(3010.000) 860"
*PSVersion:	"(3010.000) 861"
*PSVersion:	"(3010.000) 862"
*PSVersion:	"(3010.000) 863"
*LanguageLevel:	"3"
*ColorDevice:	True
*DefaultColorSpace: RGB
*FileSystem:	False
*Throughput:	"1"
*LandscapeOrientation: Plus90
*TTRasterizer:	Type42
*1284DeviceID: "MFG:Hewlett-Packard;MDL:HP Color LaserJet 4550;CMD:PJL,MLC,PCL,POSTSCRIPT,PCLXL,PJL;DES:Hewlett-Packard Color LaserJet 4550;DRV:Dpxlcolor,R0,M0,TG;"

*driverName pxlcolor/pxlcolor: ""
*driverType G/Ghostscript built-in: ""
*driverUrl: "http://www.ghostscript.com/"
*driverObsolete: False

*DefaultResolution: 1200dpi



*VariablePaperSize: False

*FoomaticIDs: HP-Color_LaserJet_4550 pxlcolor
*FoomaticRIPCommandLine: "gs -q -dBATCH -dPARANOIDSAFER -dNOPAUSE%B%A%&&
Z -sOutputFile=- - | perl -p -e &apos;if (! $did) { s/\xc0.\xf8\x26/\x&&
c0%E\xf8\x26/ &amp;&amp; $did++; }&apos;"
*End

*OpenGroup: General/General

*OpenUI *PrintoutMode/Printout Mode: PickOne
*FoomaticRIPOption PrintoutMode: enum Composite A
*OrderDependency: 10 AnySetup *PrintoutMode
*DefaultPrintoutMode: Normal
*PrintoutMode Draft/Draft: "%% FoomaticRIPOptionSetting: PrintoutMode=Draft"
*FoomaticRIPOptionSetting PrintoutMode=Draft: "PrinterResolution=300x3&&
00dpi ColorModel=Color Economode=On FastRes=Off"
*End
*PrintoutMode Draft.Gray/Draft Grayscale: "%% FoomaticRIPOptionSetting: PrintoutMode=Draft.Gray"
*FoomaticRIPOptionSetting PrintoutMode=Draft.Gray: "PrinterResolution=&&
300x300dpi ColorModel=Grayscale Economode=On FastRes=Off"
*End
*PrintoutMode Normal/Normal: "%% FoomaticRIPOptionSetting: PrintoutMode=Normal"
*FoomaticRIPOptionSetting PrintoutMode=Normal: "PrinterResolution=600x&&
600dpi ColorModel=Color Economode=Off FastRes=On"
*End
*PrintoutMode Normal.Gray/Normal Grayscale: "%% FoomaticRIPOptionSetting: PrintoutMode=Normal.Gray"
*FoomaticRIPOptionSetting PrintoutMode=Normal.Gray: "PrinterResolution&&
=600x600dpi ColorModel=Grayscale Economode=Off FastRes=On"
*End
*PrintoutMode High/High Quality: "%% FoomaticRIPOptionSetting: PrintoutMode=High"
*FoomaticRIPOptionSetting PrintoutMode=High: "PrinterResolution=1200x1&&
200dpi ColorModel=Color Economode=Off FastRes=Off"
*End
*PrintoutMode High.Gray/High Quality Grayscale: "%% FoomaticRIPOptionSetting: PrintoutMode=High.Gray"
*FoomaticRIPOptionSetting PrintoutMode=High.Gray: "PrinterResolution=1&&
200x1200dpi ColorModel=Grayscale Economode=Off FastRes=Off"
*End
*CloseUI: *PrintoutMode

*OpenUI *PageSize/Page Size: PickOne
*FoomaticRIPOption PageSize: enum CmdLine A
*OrderDependency: 100 AnySetup *PageSize
*DefaultPageSize: Letter
*PageSize Letter/US Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
*FoomaticRIPOptionSetting PageSize=Letter: " -dDEVICEWIDTHPOINTS=612 -&&
dDEVICEHEIGHTPOINTS=792"
*End
*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
*FoomaticRIPOptionSetting PageSize=A4: " -dDEVICEWIDTHPOINTS=595 -dDEV&&
ICEHEIGHTPOINTS=842"
*End
*PageSize 11x17/11x17: "%% FoomaticRIPOptionSetting: PageSize=11x17"
*FoomaticRIPOptionSetting PageSize=11x17: " -dDEVICEWIDTHPOINTS=792 -d&&
DEVICEHEIGHTPOINTS=1224"
*End
*PageSize A3/A3: "%% FoomaticRIPOptionSetting: PageSize=A3"
*FoomaticRIPOptionSetting PageSize=A3: " -dDEVICEWIDTHPOINTS=842 -dDEV&&
ICEHEIGHTPOINTS=1191"
*End
*PageSize A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
*FoomaticRIPOptionSetting PageSize=A5: " -dDEVICEWIDTHPOINTS=421 -dDEV&&
ICEHEIGHTPOINTS=595"
*End
*PageSize B5/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5"
*FoomaticRIPOptionSetting PageSize=B5: " -dDEVICEWIDTHPOINTS=516 -dDEV&&
ICEHEIGHTPOINTS=729"
*End
*PageSize Env10/Envelope #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
*FoomaticRIPOptionSetting PageSize=Env10: " -dDEVICEWIDTHPOINTS=297 -d&&
DEVICEHEIGHTPOINTS=684"
*End
*PageSize EnvC5/Envelope C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
*FoomaticRIPOptionSetting PageSize=EnvC5: " -dDEVICEWIDTHPOINTS=459 -d&&
DEVICEHEIGHTPOINTS=649"
*End
*PageSize EnvDL/Envelope DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
*FoomaticRIPOptionSetting PageSize=EnvDL: " -dDEVICEWIDTHPOINTS=312 -d&&
DEVICEHEIGHTPOINTS=624"
*End
*PageSize EnvISOB5/Envelope B5: "%% FoomaticRIPOptionSetting: PageSize=EnvISOB5"
*FoomaticRIPOptionSetting PageSize=EnvISOB5: " -dDEVICEWIDTHPOINTS=499&&
 -dDEVICEHEIGHTPOINTS=709"
*End
*PageSize EnvMonarch/Envelope Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
*FoomaticRIPOptionSetting PageSize=EnvMonarch: " -dDEVICEWIDTHPOINTS=2&&
79 -dDEVICEHEIGHTPOINTS=540"
*End
*PageSize Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
*FoomaticRIPOptionSetting PageSize=Executive: " -dDEVICEWIDTHPOINTS=52&&
2 -dDEVICEHEIGHTPOINTS=756"
*End
*PageSize Legal/US Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
*FoomaticRIPOptionSetting PageSize=Legal: " -dDEVICEWIDTHPOINTS=612 -d&&
DEVICEHEIGHTPOINTS=1008"
*End
*CloseUI: *PageSize

*OpenUI *PageRegion: PickOne
*OrderDependency: 100 AnySetup *PageRegion
*DefaultPageRegion: Letter
*PageRegion Letter/US Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
*PageRegion A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
*PageRegion 11x17/11x17: "%% FoomaticRIPOptionSetting: PageSize=11x17"
*PageRegion A3/A3: "%% FoomaticRIPOptionSetting: PageSize=A3"
*PageRegion A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
*PageRegion B5/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5"
*PageRegion Env10/Envelope #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
*PageRegion EnvC5/Envelope C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
*PageRegion EnvDL/Envelope DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
*PageRegion EnvISOB5/Envelope B5: "%% FoomaticRIPOptionSetting: PageSize=EnvISOB5"
*PageRegion EnvMonarch/Envelope Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
*PageRegion Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
*PageRegion Legal/US Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
*CloseUI: *PageRegion

*DefaultImageableArea: Letter
*ImageableArea Letter/US Letter: "18 36 594 756"
*ImageableArea A4/A4: "18 36 577 806"
*ImageableArea 11x17/11x17: "18 36 774 1188"
*ImageableArea A3/A3: "18 36 824 1155"
*ImageableArea A5/A5: "18 36 403 559"
*ImageableArea B5/B5 (JIS): "18 36 498 693"
*ImageableArea Env10/Envelope #10: "18 36 279 648"
*ImageableArea EnvC5/Envelope C5: "18 36 441 613"
*ImageableArea EnvDL/Envelope DL: "18 36 294 588"
*ImageableArea EnvISOB5/Envelope B5: "18 36 481 673"
*ImageableArea EnvMonarch/Envelope Monarch: "18 36 261 504"
*ImageableArea Executive/Executive: "18 36 504 720"
*ImageableArea Legal/US Legal: "18 36 594 972"

*DefaultPaperDimension: Letter
*PaperDimension Letter/US Letter: "612 792"
*PaperDimension A4/A4: "595 842"
*PaperDimension 11x17/11x17: "792 1224"
*PaperDimension A3/A3: "842 1191"
*PaperDimension A5/A5: "421 595"
*PaperDimension B5/B5 (JIS): "516 729"
*PaperDimension Env10/Envelope #10: "297 684"
*PaperDimension EnvC5/Envelope C5: "459 649"
*PaperDimension EnvDL/Envelope DL: "312 624"
*PaperDimension EnvISOB5/Envelope B5: "499 709"
*PaperDimension EnvMonarch/Envelope Monarch: "279 540"
*PaperDimension Executive/Executive: "522 756"
*PaperDimension Legal/US Legal: "612 1008"

*OpenUI *InputSlot/Media Source: PickOne
*FoomaticRIPOption InputSlot: enum CmdLine E
*OrderDependency: 100 AnySetup *InputSlot
*DefaultInputSlot: Default
*InputSlot Default/Printer default: "%% FoomaticRIPOptionSetting: InputSlot=Default"
*FoomaticRIPOptionSetting InputSlot=Default: "\x01"
*InputSlot Tray1/Tray 1: "%% FoomaticRIPOptionSetting: InputSlot=Tray1"
*FoomaticRIPOptionSetting InputSlot=Tray1: "\x03"
*InputSlot Tray2/Tray 2: "%% FoomaticRIPOptionSetting: InputSlot=Tray2"
*FoomaticRIPOptionSetting InputSlot=Tray2: "\x04"
*InputSlot Tray3/Tray 3: "%% FoomaticRIPOptionSetting: InputSlot=Tray3"
*FoomaticRIPOptionSetting InputSlot=Tray3: "\x05"
*InputSlot Tray4/Tray 4: "%% FoomaticRIPOptionSetting: InputSlot=Tray4"
*FoomaticRIPOptionSetting InputSlot=Tray4: "\x06"
*InputSlot Tray5/Tray 5: "%% FoomaticRIPOptionSetting: InputSlot=Tray5"
*FoomaticRIPOptionSetting InputSlot=Tray5: "\x07"
*InputSlot Tray6/Tray 6: "%% FoomaticRIPOptionSetting: InputSlot=Tray6"
*FoomaticRIPOptionSetting InputSlot=Tray6: "\x08"
*InputSlot Tray7/Tray 7: "%% FoomaticRIPOptionSetting: InputSlot=Tray7"
*FoomaticRIPOptionSetting InputSlot=Tray7: "\x09"
*InputSlot Manual/Manual Feeder: "%% FoomaticRIPOptionSetting: InputSlot=Manual"
*FoomaticRIPOptionSetting InputSlot=Manual: "\x02"
*CloseUI: *InputSlot

*JCLOpenUI *Manualfeed/Manual Feed of Paper: PickOne
*OrderDependency: 100 JCLSetup *Manualfeed
*DefaultManualfeed: Off
*Manualfeed Off/Off: "@PJL SET MANUALFEED=OFF<0A>"
*Manualfeed On/On: "@PJL SET MANUALFEED=ON<0A>"
*JCLCloseUI: *Manualfeed

*OpenUI *Duplex/Double-Sided printing: PickOne
*FoomaticRIPOption Duplex: enum CmdLine A
*OrderDependency: 100 AnySetup *Duplex
*DefaultDuplex: None
*Duplex DuplexNoTumble/On (Flip on Long Edge): "%% FoomaticRIPOptionSetting: Duplex=DuplexNoTumble"
*FoomaticRIPOptionSetting Duplex=DuplexNoTumble: " -dDuplex"
*Duplex DuplexTumble/On (Flip on Short Edge): "%% FoomaticRIPOptionSetting: Duplex=DuplexTumble"
*FoomaticRIPOptionSetting Duplex=DuplexTumble: " -dDuplex -dTumble"
*Duplex None/Off: "%% FoomaticRIPOptionSetting: Duplex=None"
*FoomaticRIPOptionSetting Duplex=None: ""
*CloseUI: *Duplex

*JCLOpenUI *Copies/Number of Copies: PickOne
*FoomaticRIPOption Copies: int JCL A
*FoomaticRIPOptionPrototype Copies: "SET COPIES=%s"
*FoomaticRIPOptionRange Copies: 1 100
*OrderDependency: 100 JCLSetup *Copies
*DefaultCopies: 1
*FoomaticRIPDefaultCopies: 1
*Copies 1/1: "@PJL SET COPIES=1<0A>"
*Copies 2/2: "@PJL SET COPIES=2<0A>"
*Copies 3/3: "@PJL SET COPIES=3<0A>"
*Copies 4/4: "@PJL SET COPIES=4<0A>"
*Copies 5/5: "@PJL SET COPIES=5<0A>"
*Copies 6/6: "@PJL SET COPIES=6<0A>"
*Copies 7/7: "@PJL SET COPIES=7<0A>"
*Copies 8/8: "@PJL SET COPIES=8<0A>"
*Copies 9/9: "@PJL SET COPIES=9<0A>"
*Copies 10/10: "@PJL SET COPIES=10<0A>"
*Copies 11/11: "@PJL SET COPIES=11<0A>"
*Copies 12/12: "@PJL SET COPIES=12<0A>"
*Copies 13/13: "@PJL SET COPIES=13<0A>"
*Copies 14/14: "@PJL SET COPIES=14<0A>"
*Copies 15/15: "@PJL SET COPIES=15<0A>"
*Copies 16/16: "@PJL SET COPIES=16<0A>"
*Copies 17/17: "@PJL SET COPIES=17<0A>"
*Copies 18/18: "@PJL SET COPIES=18<0A>"
*Copies 19/19: "@PJL SET COPIES=19<0A>"
*Copies 20/20: "@PJL SET COPIES=20<0A>"
*Copies 21/21: "@PJL SET COPIES=21<0A>"
*Copies 22/22: "@PJL SET COPIES=22<0A>"
*Copies 23/23: "@PJL SET COPIES=23<0A>"
*Copies 24/24: "@PJL SET COPIES=24<0A>"
*Copies 25/25: "@PJL SET COPIES=25<0A>"
*Copies 26/26: "@PJL SET COPIES=26<0A>"
*Copies 27/27: "@PJL SET COPIES=27<0A>"
*Copies 28/28: "@PJL SET COPIES=28<0A>"
*Copies 29/29: "@PJL SET COPIES=29<0A>"
*Copies 30/30: "@PJL SET COPIES=30<0A>"
*Copies 31/31: "@PJL SET COPIES=31<0A>"
*Copies 32/32: "@PJL SET COPIES=32<0A>"
*Copies 33/33: "@PJL SET COPIES=33<0A>"
*Copies 34/34: "@PJL SET COPIES=34<0A>"
*Copies 35/35: "@PJL SET COPIES=35<0A>"
*Copies 36/36: "@PJL SET COPIES=36<0A>"
*Copies 37/37: "@PJL SET COPIES=37<0A>"
*Copies 38/38: "@PJL SET COPIES=38<0A>"
*Copies 39/39: "@PJL SET COPIES=39<0A>"
*Copies 40/40: "@PJL SET COPIES=40<0A>"
*Copies 41/41: "@PJL SET COPIES=41<0A>"
*Copies 42/42: "@PJL SET COPIES=42<0A>"
*Copies 43/43: "@PJL SET COPIES=43<0A>"
*Copies 44/44: "@PJL SET COPIES=44<0A>"
*Copies 45/45: "@PJL SET COPIES=45<0A>"
*Copies 46/46: "@PJL SET COPIES=46<0A>"
*Copies 47/47: "@PJL SET COPIES=47<0A>"
*Copies 48/48: "@PJL SET COPIES=48<0A>"
*Copies 49/49: "@PJL SET COPIES=49<0A>"
*Copies 50/50: "@PJL SET COPIES=50<0A>"
*Copies 51/51: "@PJL SET COPIES=51<0A>"
*Copies 52/52: "@PJL SET COPIES=52<0A>"
*Copies 53/53: "@PJL SET COPIES=53<0A>"
*Copies 54/54: "@PJL SET COPIES=54<0A>"
*Copies 55/55: "@PJL SET COPIES=55<0A>"
*Copies 56/56: "@PJL SET COPIES=56<0A>"
*Copies 57/57: "@PJL SET COPIES=57<0A>"
*Copies 58/58: "@PJL SET COPIES=58<0A>"
*Copies 59/59: "@PJL SET COPIES=59<0A>"
*Copies 60/60: "@PJL SET COPIES=60<0A>"
*Copies 61/61: "@PJL SET COPIES=61<0A>"
*Copies 62/62: "@PJL SET COPIES=62<0A>"
*Copies 63/63: "@PJL SET COPIES=63<0A>"
*Copies 64/64: "@PJL SET COPIES=64<0A>"
*Copies 65/65: "@PJL SET COPIES=65<0A>"
*Copies 66/66: "@PJL SET COPIES=66<0A>"
*Copies 67/67: "@PJL SET COPIES=67<0A>"
*Copies 68/68: "@PJL SET COPIES=68<0A>"
*Copies 69/69: "@PJL SET COPIES=69<0A>"
*Copies 70/70: "@PJL SET COPIES=70<0A>"
*Copies 71/71: "@PJL SET COPIES=71<0A>"
*Copies 72/72: "@PJL SET COPIES=72<0A>"
*Copies 73/73: "@PJL SET COPIES=73<0A>"
*Copies 74/74: "@PJL SET COPIES=74<0A>"
*Copies 75/75: "@PJL SET COPIES=75<0A>"
*Copies 76/76: "@PJL SET COPIES=76<0A>"
*Copies 77/77: "@PJL SET COPIES=77<0A>"
*Copies 78/78: "@PJL SET COPIES=78<0A>"
*Copies 79/79: "@PJL SET COPIES=79<0A>"
*Copies 80/80: "@PJL SET COPIES=80<0A>"
*Copies 81/81: "@PJL SET COPIES=81<0A>"
*Copies 82/82: "@PJL SET COPIES=82<0A>"
*Copies 83/83: "@PJL SET COPIES=83<0A>"
*Copies 84/84: "@PJL SET COPIES=84<0A>"
*Copies 85/85: "@PJL SET COPIES=85<0A>"
*Copies 86/86: "@PJL SET COPIES=86<0A>"
*Copies 87/87: "@PJL SET COPIES=87<0A>"
*Copies 88/88: "@PJL SET COPIES=88<0A>"
*Copies 89/89: "@PJL SET COPIES=89<0A>"
*Copies 90/90: "@PJL SET COPIES=90<0A>"
*Copies 91/91: "@PJL SET COPIES=91<0A>"
*Copies 92/92: "@PJL SET COPIES=92<0A>"
*Copies 93/93: "@PJL SET COPIES=93<0A>"
*Copies 94/94: "@PJL SET COPIES=94<0A>"
*Copies 95/95: "@PJL SET COPIES=95<0A>"
*Copies 96/96: "@PJL SET COPIES=96<0A>"
*Copies 97/97: "@PJL SET COPIES=97<0A>"
*Copies 98/98: "@PJL SET COPIES=98<0A>"
*Copies 99/99: "@PJL SET COPIES=99<0A>"
*Copies 100/100: "@PJL SET COPIES=100<0A>"
*JCLCloseUI: *Copies

*CustomJCLCopies True: "@PJL SET COPIES=\1<0A>"
*ParamCustomJCLCopies Copies/Number of Copies: 1 int 1 100


*CloseGroup: General

*OpenGroup: Adjustment/Adjustment

*JCLOpenUI *REt/REt Setting: PickOne
*OrderDependency: 100 JCLSetup *REt
*DefaultREt: Medium
*REt Dark/Dark: "@PJL SET RET=DARK<0A>"
*REt Light/Light: "@PJL SET RET=LIGHT<0A>"
*REt Medium/Medium: "@PJL SET RET=MEDIUM<0A>"
*REt Off/Off: "@PJL SET RET=OFF<0A>"
*JCLCloseUI: *REt

*JCLOpenUI *TonerDensity/Toner Density: PickOne
*OrderDependency: 100 JCLSetup *TonerDensity
*DefaultTonerDensity: 3
*TonerDensity 1/1: "@PJL SET DENSITY=1<0A>"
*TonerDensity 2/2: "@PJL SET DENSITY=2<0A>"
*TonerDensity 3/3: "@PJL SET DENSITY=3<0A>"
*TonerDensity 4/4: "@PJL SET DENSITY=4<0A>"
*TonerDensity 5/5: "@PJL SET DENSITY=5<0A>"
*JCLCloseUI: *TonerDensity

*FoomaticRIPOption GSResolution: enum CmdLine A 100
*FoomaticRIPOptionSetting GSResolution=FromPrinterResolution: ""
*FoomaticRIPOptionSetting GSResolution=300x300dpi: " -r300x300"
*FoomaticRIPOptionSetting GSResolution=600x600dpi: " -r600x600"
*FoomaticRIPOptionSetting GSResolution=1200x600dpi: " -r1200x600"
*FoomaticRIPOptionSetting GSResolution=1200x1200dpi: " -r1200x1200"

*FoomaticRIPOption JCLResolution: enum JCL A 100
*FoomaticRIPOptionSetting JCLResolution=FromPrinterResolution: ""
*FoomaticRIPOptionSetting JCLResolution=300x300dpi: "SET RESOLUTION=30&&
0"
*End
*FoomaticRIPOptionSetting JCLResolution=600x600dpi: "SET RESOLUTION=60&&
0"
*End
*FoomaticRIPOptionSetting JCLResolution=1200x600dpi: "SET RESOLUTION=1&&
200x600"
*End
*FoomaticRIPOptionSetting JCLResolution=1200x1200dpi: "SET RESOLUTION=&&
1200"
*End

*CloseGroup: Adjustment

*OpenGroup: PrintoutMode/Printout Mode

*OpenUI *FastRes/Fast Res.: PickOne
*OrderDependency: 100 AnySetup *FastRes
*DefaultFastRes: FromPrintoutMode
*FastRes FromPrintoutMode/Controlled by 'Printout Mode': "%% FoomaticRIPOptionSetting: FastRes=@PrintoutMode"
*FastRes Off/Off: "@PJL SET BITSPERPIXEL=1<0A>"
*FastRes On/On: "@PJL SET BITSPERPIXEL=2<0A>"
*CloseUI: *FastRes

*OpenUI *Economode/Toner Saving: PickOne
*OrderDependency: 100 AnySetup *Economode
*DefaultEconomode: FromPrintoutMode
*Economode FromPrintoutMode/Controlled by 'Printout Mode': "%% FoomaticRIPOptionSetting: Economode=@PrintoutMode"
*Economode Off/Off: "@PJL SET ECONOMODE=OFF<0A>"
*Economode On/On: "@PJL SET ECONOMODE=ON<0A>"
*CloseUI: *Economode

*OpenUI *ColorModel/Color Mode: PickOne
*FoomaticRIPOption ColorModel: enum CmdLine B
*OrderDependency: 100 AnySetup *ColorModel
*DefaultColorModel: FromPrintoutMode
*ColorModel FromPrintoutMode/Controlled by 'Printout Mode': "%% FoomaticRIPOptionSetting: ColorModel=@PrintoutMode"
*ColorModel Color/Color: "%% FoomaticRIPOptionSetting: ColorModel=Color"
*FoomaticRIPOptionSetting ColorModel=Color: " -sDEVICE=pxlcolor"
*ColorModel Grayscale/Grayscale: "%% FoomaticRIPOptionSetting: ColorModel=Grayscale"
*FoomaticRIPOptionSetting ColorModel=Grayscale: " -sDEVICE=pxlmono"
*CloseUI: *ColorModel

*OpenUI *PrinterResolution/Resolution: PickOne
*FoomaticRIPOption PrinterResolution: enum Composite A
*OrderDependency: 99 AnySetup *PrinterResolution
*DefaultPrinterResolution: FromPrintoutMode
*PrinterResolution FromPrintoutMode/Controlled by 'Printout Mode': "%% FoomaticRIPOptionSetting: PrinterResolution=FromPrintoutMode"
*FoomaticRIPOptionSetting PrinterResolution=FromPrintoutMode: ""
*PrinterResolution 300x300dpi/300 DPI: "%% FoomaticRIPOptionSetting: PrinterResolution=300x300dpi"
*FoomaticRIPOptionSetting PrinterResolution=300x300dpi: "JCLResolution&&
=300x300dpi GSResolution=300x300dpi"
*End
*PrinterResolution 600x600dpi/600 DPI: "%% FoomaticRIPOptionSetting: PrinterResolution=600x600dpi"
*FoomaticRIPOptionSetting PrinterResolution=600x600dpi: "JCLResolution&&
=600x600dpi GSResolution=600x600dpi"
*End
*CloseUI: *PrinterResolution

*CloseGroup: PrintoutMode


*% Generic boilerplate PPD stuff as standard PostScript fonts and so on

*DefaultFont: Courier
*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
*Font Bookman-Light: Standard "(001.004S)" Standard ROM
*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
*Font Courier: Standard "(002.004S)" Standard ROM
*Font Courier-Bold: Standard "(002.004S)" Standard ROM
*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
*Font Helvetica: Standard "(001.006S)" Standard ROM
*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
*Font Symbol: Special "(001.007S)" Special ROM
*Font Times-Bold: Standard "(001.007S)" Standard ROM
*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
*Font Times-Italic: Standard "(001.007S)" Standard ROM
*Font Times-Roman: Standard "(001.007S)" Standard ROM
*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
*Font ZapfDingbats: Special "(001.004S)" Standard ROM
----------------------------------------------------------------------------

Foomatic keywords
-----------------

*FoomaticIDs: <printer> <driver>
    <printer>: The printer ID in the Foomatic database
    <driver>: The driver name/ID in the Foomatic database

*FoomaticRIPPostPipe: "<code>"
    <code>: A shell command line into which the output of foomatic-rip
            is piped. Only used with LPRng, LPD, GNUlpr, spooler-less

*FoomaticRIPCammandLine: "<code>"
    <code>: The general command line prototype, with spots to insert option
            settings ("%A", "%B", ...).

*FoomaticRIPCammandLinePDF: "<code>"
    <code>: The command line prototype for PDF input if it is different to
            the one for PostScript input, with spots to insert option
            settings ("%A", "%B", ...).

*FoomaticRIPNoPageAccounting: <boolean value>
    <value>: If True, no accounting code will be inserted into the
             PostScript data stream.

*FoomaticRIPOption <name>: <type> <style> <spot> [<order>]
    <name>: Option name; <type>: enum, bool, int, float;
    <style>: CmdLine, JCL, PS, Composite;
    <spot>: Insert this at "%<spot>" in the "*FoomaticRIPCammandLine";
    <order>: order number (1-choice options only)

*FoomaticRIPOptionSetting <name>=<choice>: "<code>"
    <name>: Option name; <choice>: choice name;
    <code>: Code to insert for Cmdline and JCL options,
            Settings of member options for Composite
            options (see below)

*FoomaticRIPOptionPrototype <name>: "<code>"
    (keyword only for numerical and string/password options)
    <name>: Option name;
    <code>: Code to insert for Cmdline, JCL, and
            PS options. With "%s" for the number/string
            set by the user.

*FoomaticRIPOptionRange <name>: <min> <max>
    (keyword only for numerical options)
    <name>: Option name;
    <min>, <max>: allowed range for the number.

*FoomaticRIPOptionMaxLength <name>: <length>
    (keyword only for string/password options)
    <name>: Option name;
    <length>: maximum allowed length for the string.

*FoomaticRIPOptionAllowedChars <name>: "<code>"
    (keyword only for string options)
    <name>: Option name;
    <code>: List of allowed characters in the string
            (checked by a '/^[...]*$/', see above).

*FoomaticRIPOptionAllowedRegExp <name>: "<code>"
    (keyword only for string options)
    <name>: Option name;
    <code>: Perl regular expression which the string must fulfill
            (checked by a '/.../', see above).

*FoomaticRIPDefault<name>: <value>
    (keyword only for numerical options)
    <name>: Option name;
    <value>: default value, only needs to be in
            the allowed range, does not need to be
	    one of the enumerated choices.

*FoomaticRIPJobEntityMaxLength: <integer value>
*FoomaticRIPUserEntityMaxLength: <integer value>
*FoomaticRIPHostEntityMaxLength: <integer value>
*FoomaticRIPTitleEntityMaxLength: <integer value>
*FoomaticRIPOptionsEntityMaxLength: <integer value>
    <integer value>: Maximum length for the substitution strings for
    the special entities "&job;", "&user;", "&host;", "&title;", and
    "&options;" which can be used in the quoted strings of all "*Foomatic..."
    keywords (foomatic-filters 4.0.6 or newer needed).

All strings in quotes (Foomatic command line, snippets to insert in
command line, "<code>" in the keyword descriptions above) are encoded
with the "htmlify()" function of DB.pm, so they contain no forbidden
characters ("<", ">", "\"") any more. In addition they are broken up
into short lines. The filter (foomatic-rip) will put them together
at first and then replace the HTML/XML entities by the original
characters. If a string is split up, an "*End" line follows, as
required by the Adobe specification. In the quoted strings also the
following special entities can be used to insert job parameters:

   Entity          Gets replaced by
   ---------------------------------------------------------
   &job;           Job ID
   &user;          User name (who sent the job)
   &host;          Job host name
   &title;         Job title
   &options;       Job options
   &copies;        Number of copies
   &rbinumcopies;  "%RBINumCopies:" of PostScript input
   &year;          Job rendering date: 4-digit year
   &month;         Job rendering date: 2-digit month
   &date;          Job rendering date: 2-digit day of month
   &hour;          Job rendering date: 2-digit hours (24 hours)
   &min;           Job rendering date: 2-digit minutes
   &sec;           Job rendering date: 2-digit seconds

foomatic-rip substitutes these entities by the appropriate parameters
before starting the rendering process. This way job parameters can be
sent to the printer. From foomatic-filters 4.0.6 on the length of the
inserted strings can be limited, either by the above-mentioned
"*FoomaticRIP...EntityMaxLength:" keywords in the PPD or by adding the
length to the entities (ex: "&user8;", "&title16;", ...). If the
string to insert for the entity is longer than the limit, it gets cut
off to the limit. Note that adding numbers to the entities makes the
PPD incompatible with older versions of foomatic-rip. PPDs with the
above-mentioned new keywords work with older versions of foomatic-rip,
but limits do not get applied. Therefore I generally recommend using
the PPD keywords for PPDs to make them publically available.

All Foomatic-relevant info is stored with keywords beginning with 
"*Foomatic...", not in comment lines. So if some program strips the 
comments off the PPD file, the file still works. The data is stored 
in a way compliant to the Adobe specification.

The "*Foomatic..." lines are located in the option entries, so that all 
info which is related is located close to each other. This makes the 
file more easily readable. The lines also contain only the information 
which is not provided by the standard PPD lines. So redundancy is low 
and the PPD can more easily be edited and customized.

"*Foomatic..." lines are given to all non-PostScript options and to
numerical or string/password PostScript options. Usual "Boolean" and
"PickOne" PostScript options do not need them. Numerical and
string/password options are "PickOne" for most frontends, but with the
"*Foomatic..." lines the server (the foomatic-rip filter script)
identifies them as numerical or string/password options (and so
accepts values which are not listed) and, second, frontends could also
read the "*Foomatic..." lines and so show the options as numerical or
string (with input field, slider, combo box) or even as password
(input field which shows asterisks instead of the actually typed
characters), as KDE Print and XPP now do by reading the Perl
structure.

Non-PostScript options with only one choice consist only of
"*Foomatic..." lines. So the one choice is stored in the PPD file but
frontends will not show a widget for these options.

Also composite options can be described more easily:

----------------------------------------------------------------------------

*OpenUI *PrintoutMode/Printout Mode: PickOne
*FoomaticRIPOption PrintoutMode: enum Composite C
*OrderDependency: 20 AnySetup *PrintoutMode
*DefaultPrintoutMode: Normal
*PrintoutMode Draft/Draft (Economy): "%% FoomaticRIPOptionSetting: 
PrintoutMode=Draft"
*FoomaticRIPOptionSetting PrintoutMode=Draft: "Resolution=300 &&
MediaType=Normal Dither=VeryFast"
*End
*PrintoutMode Normal/Normal: "%% FoomaticRIPOptionSetting: 
PrintoutMode=Normal"
*FoomaticRIPOptionSetting PrintoutMode=Normal: "Resolution=600 &&
MediaType=Normal Dither=AdaptiveHybrid"
*End
*PrintoutMode High/High Quality: "%% 
FoomaticRIPOptionSetting: PrintoutMode=High"
*FoomaticRIPOptionSetting PrintoutMode=High: "Resolution=1200 &&
MediaType=Inkjet Dither=AdaptiveHybrid"
*End
*PrintoutMode Photo/Photo: "%% FoomaticRIPOptionSetting: PrintoutMode=Photo"
*FoomaticRIPOptionSetting PrintoutMode=Photo: "Resolution=1200 &&
MediaType=GlossyPhoto Dither=EvenTone"
*End
*CloseUI: *PrintoutMode

----------------------------------------------------------------------------

Remark to the "*FoomaticRIPDefault<name>: <value>" entries for
numerical options:

Adobe's PPD specs do not support numerical options. Therefore the
numerical options are mapped to enumerated options in the PPD file and
their characteristics as a numerical option are stored in
"*Foomatic..."  keywords. Especially a value between the enumerated
fixed values can be used as the default value. Then this value must be
given by a "*FoomaticRIPDefault<option>: <value>" line in the PPD
file. But this value is only valid, if the "official" default given by
a "*Default<option>: <value>" line (it must be one of the enumerated
values) points to the enumerated value which is closest to this
value. This way a user can select a default value with a tool only
supporting PPD files but not Foomatic extensions.  This tool only
modifies the "*Default<option>: <value>" line and if the
"*FoomaticRIPDefault<option>: <value>" had always priority, the user's
change in "*Default<option>: <value>" had no effect.

For numerical, string, and password options there are also the CUPS
PPD extensions for custom options used. This allows GUIs which use
CUPS' PPD extensions give full access to these options to the
user. See above.