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
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Details of Ghostscript output devices</title>
<!-- $Id$ -->
<!-- Originally: devices.txt -->
<link rel="stylesheet" type="text/css" href="gs.css" title="Ghostscript Style">
</head>
<body>
<!-- [1.0 begin visible header] ============================================ -->
<!-- [1.1 begin headline] ================================================== -->
<h1>Details of Ghostscript output devices</h1>
<!-- [1.1 end headline] ==================================================== -->
<!-- [1.2 begin table of contents] ========================================= -->
<h2>Table of contents</h2>
<blockquote><ul>
<li><a href="#Measurements">Notes on measurements</a>
<li><a href="#IJS">IJS - Inkjet and other raster devices</a>
<li><a href="#Win">MS Windows printers</a>
<li><a href="#File_formats">File formats</a>
<ul>
<li><a href="#JFIF">JPEG file format (JFIF)</a>
<li><a href="#TIFF">TIFF file formats</a>
</ul>
<li><a href="#Display_devices">Display devices</a>
<ul>
<li><a href="#x11_devices">X Window System</a>
</ul>
<li><a href="#HP_ijs">HP Deskjet official drivers</a>
<li><a href="#HP8_color_inkjet">H-P 8xx, 1100, and 1600 color inkjet printers</a>
<ul>
<li><a href="#HP8_gdevcd8">Drivers contained in <b><tt>gdevcd8.c</tt></b></a>
<li><a href="#HP8_further_documentation">Further documentation</a>
</ul>
<li><a href="#HP880_color_inkjet">H-P 812, 815, 832, 880, 882, 895, and 970 color inkjet printers</a>
<ul>
<li><a href="#HP880_gdevcd8">Drivers contained in <b><tt>gdevcd8.c</tt></b></a>
<li><a href="#HP880_further_documentation">Further documentation</a>
</ul>
<li><a href="#HP_color_inkjet">Other H-P color inkjet printers</a>
<ul>
<li><a href="#HP_gdevcdj">Drivers contained in <b><tt>gdevcdj.c</tt></b></a>
<li><a href="#HP_paper_size">Default paper size</a>
<li><a href="#HP_limits">Deskjet physical limits</a>
<li><a href="#HP_command_line">Printer properties (command-line parameters)</a>
<ul>
<li><a href="#HP_bpp">Bits per pixel</a>
<li><a href="#HP_deskjet_properties">Deskjet properties</a>
<li><a href="#HP_paintjet_properties">Paintjet XL300 / Paintjet XL properties</a>
</ul>
<li><a href="#HP_gamma">Gamma correction</a>
<li><a href="#HP_resolution_enhance">HP's resolution-enhanced mode for Inkjet printers</a>
<li><a href="#HP_tips">General tips</a>
</ul>
<li><a href="#BJC_8200">Canon BJC-8200 printer</a>
<li><a href="#BJC">Other Canon BubbleJet (BJC) printers</a>
<ul>
<li><a href="#BJC_history">History</a>
<li><a href="#BJC_build">Configuring and building the BJC drivers</a>
<ul>
<li><a href="#BJC_defaults">Modify values in <b><tt>gdevbjc.h</tt></b></a>
<li><a href="#BJC_CMYK_RGB">CMYK-to-RGB color conversion</a>
<li><a href="#BJC_vertical_centering">Vertical centering of the printable area</a>
<li><a href="#BJC_margins">Page margins</a>
<li><a href="#BJC_compile">Makefile and compilation</a>
</ul>
<li><a href="#BJC_usage">Use of the drivers</a>
<ul>
<li><a href="#BJC_options">Supported Options and Defaults</a>
<li><a href="#BJC_device_info">Device information</a>
<li><a href="#BJC_HW_margins">Hardware margins</a>
<li><a href="#BJC_PPD">PostScript printer description (PPD) files</a>
<li><a href="#BJC_PPD_custom">Customizing the PPD files</a>
</ul>
<li><a href="#BJC_bugs">How to report problems</a>
<li><a href="#BJC_acks">Acknowledgements</a>
</ul>
<li><a href="#STC_epson_stylus">Epson Stylus color printer (see also <b><tt>uniprint</tt></b>)</a>
<ul>
<li><a href="#STC_usage">Usage</a>
<li><a href="#STC_options">Options</a>
<li><a href="#STC_FAQ">Application note and FAQ</a>
<ul>
<li><a href="#STC_FAQ_A3">Support for A3 paper</a>
<li><a href="#STC_FAQ_margins">Margins, PageSize</a>
<li><a href="#STC_FAQ_II_IIS_1500">Stylus Color II / IIs and 1500</a>
</ul>
<li><a href="#STC_recommendations">Recommendations</a>
<ul>
<li><a href="#STC_dither_experiment">Color dithering experiments with <b><tt>gdevstc</tt></b> 1.21</a>
</ul>
<li><a href="#STC_color_transform">Color transformation</a>
<li><a href="#STC_CAM"><b><tt>ColorAdjustMatrix</tt></b></a>
<li><a href="#STC_RGBCMYK_coding">RGB / CMYK coding and transfer, and <b><tt>BitsPerPixel</tt></b></a>
<li><a href="#What_is_weaving">What is weaving?</a>
<li><a href="#STC_print_modes">Print mode parameters</a>
<ul>
<li><a href="#STC_unidirectional"><b><tt>Unidirectional</tt></b></a>
<li><a href="#STC_noweave"><b><tt>Microweave</tt></b>, <b><tt>noWeave</tt></b> and <b><tt>OutputCode=deltarow</tt></b></a>
<li><a href="#STC_model"><b><tt>Model</tt></b></a>
</ul>
<li><a href="#STC_Pitfalls">Bugs and pitfalls</a>
<li><a href="#STC_Tests">Tests</a>
<ul>
<li><a href="#STC_OutputCodes">The various OutputCodes</a>
<li><a href="#STC_printing_time">Printing time related to other options</a>
</ul>
<li><a href="#STC_acks">Acknowledgments</a>
</ul>
<li><a href="#Uniprint">uniprint, a flexible unified printer driver</a>
<ul>
<li><a href="#Uni_state">The state of this driver</a>
<li><a href="#Uni_background">Notes on <b><tt>uniprint</tt></b>'s background</a>
<li><a href="#Uni_make_pfile">Godzilla's guide to the creation of Unified Printer Parameter (<b><tt>.upp</tt></b>) files</a>
<li><a href="#Uni_all_parameters">All parameters in brief</a>
<li><a href="#Uni_honors"><b><tt>Uniprint</tt></b>'s Roll of Honor</a>
<li><a href="#Uni_weaving_howto"><b><tt>Uniprint</tt></b> weaving parameters howto</a></li>
<li><a href="#Uni_esc300">Extension to <b><tt>uniprint</tt></b> for the Epson Stylus Color 300</a></li>
</ul>
<li><a href="#SPARCprinter">Sun SPARCprinter</a>
<ul>
<li><a href="#SPARC_install">Installation</a>
<li><a href="#SPARC_problems">Problems</a>
</ul>
<li><a href="#Apple">Apple dot matrix printer</a>
</ul></blockquote>
<!-- [1.2 end table of contents] =========================================== -->
<!-- [1.3 begin hint] ====================================================== -->
<p>For other information, see the <a href="Readme.htm">Ghostscript
overview</a>. You may also be interested in <a href="Make.htm">how to
build Ghostscript</a> and <a href="Install.htm">install it</a>, as well as
the description of the <a href="Drivers.htm">driver interface</a>.
<!-- [1.3 end hint] ======================================================== -->
<hr>
<!-- [1.0 end visible header] ============================================== -->
<!-- [2.0 begin contents] ================================================== -->
<h2><a name="Measurements"></a>Notes on measurements</h2>
<p>
Several different important kinds of measures appear throughout this
document: inches, centimeters and millimeters, points, and bits per pixel.
<dl>
<dt><b>Inches</b>
<dd>1 inch equals 2.54 centimeters. The inch measure is sometimes
represented by "<b>in</b>" or a quotation mark (<b>"</b>) to the right
of a measure, like <b>8.5in</b> or <b>8.5""</b>. Dots per inch,
"<b>dpi</b>", are the common measure of printing resolution for dot-matrix,
laser, and ink-jet printers. U.S. "letter" paper is exactly
8.5in×11in, approximately 21.6cm×27.9cm. (See in the usage
documentation all the <a href="Use.htm#Known_paper_sizes">paper sizes
predefined in Ghostscript</a>.)
<dt><b>Centimeters</b> and <b>millimeters</b>
<dd>ISO standard paper sizes such as A4 and A3 are commonly represented in
the SI units of centimeters and millimeters. Centimeters are abbreviated
"<b><tt>cm</tt></b>", millimeters "<b><tt>mm</tt></b>". ISO A4 paper is
quite close to 21.0×29.7 centimeters (approximately 8.3×11.7
inches).
<dt><b>Points</b>
<dd>Points are a measure traditionally used in the printing trade and now
in PostScript, which specifies exactly 72 points per inch (approximately
28.35 per centimeter). The <a href="Use.htm#Known_paper_sizes">paper sizes
known to Ghostscript</a> are defined in the initialization file
<b><tt>gs_statd.ps</tt></b> in terms of points.
<dt><b>Bits per pixel</b>
<dd>Commonly abbreviated "<b><tt>bpp</tt></b>".
</dl>
<hr>
<h2><a name="IJS"></a>IJS - Inkjet and other raster devices</h2>
<p>
IJS is a relatively new initiative to improve the quality and ease of
use of inkjet printing with Ghostscript. Using IJS, you can add new
drivers, or upgrade existing ones, without recompiling Ghostscript.
All driver authors are encouraged to adapt their drivers for IJS, and
if there is an IJS driver available for your printer, it should be
your first choice.
</p>
<p>Please see the <a href="http://www.linuxprinting.org/ijs/">IJS web
page</a> for more information about IJS, including a listing of
IJS-compatible drivers.
</p>
<p>
A typical command line for IJS is:
</p>
<blockquote>
<b><tt>
gs -DSAFER -sDEVICE=ijs -sIjsServer=hpijs
-sDeviceManufacturer=HEWLETT-PACKARD -sDeviceModel='DESKJET 990'
-DIjsUseOutputFD -sOutputFile=/dev/usb/lp1 -DNOPAUSE --
examples/tiger.eps
</tt></b>
</blockquote>
<p>
Individual IJS command line parameters are as follows:
</p>
<dl>
<dt><b><tt>-sIjsServer=</tt></b><em>{path}</em>
<dd>Sets the pathname for the IJS server (ie printer driver).
Ghostscript will spawn a new process for this driver, and communicate
with it using the IJS protocol. The pathname need not be absolute,
as the PATH environment variable is searched, but it's probably a good
idea for robustness and security. Note also that if -dSAFER is not
specified, it's possible for PostScript code to set this parameter,
so it can cause arbitrary code to be executed. See the section on <a
href="Use.htm#Security">Security</a> for more information.
</dl>
<dl>
<dt><b><tt>-sDeviceManufacturer=</tt></b><em>{name}</em>
<dt><b><tt>-sDeviceModel=</tt></b><em>{name}</em>
<dd>These parameters select the device according to IEEE-1284 standard
device ID strings. In general, consult the documentation for the
driver to find the appropriate settings. Note that, if the value
contains a space, you'll want to quote the value in your shell, as
in the example above.
</dl>
<dl>
<dt><b><tt>-sIjsParams=</tt></b><em>{params}</em>
<dd>This parameter allows you to set arbitrary IJS parameters on
the IJS driver. The format is a comma-separated list of
<b><tt>key=value</tt></b> pairs. If it is necessary to send a
value containing a comma or backslash, it can be escaped with
a backslash. Thus, <b><tt>'-sIjsParams=Foo=bar,Baz=a\,b'</tt></b> sets
the parameter Foo to "bar", and Baz to "a,b".
</dl>
<dl>
<dt><b><tt>-dIjsUseOutputFD</tt></b>
<dd>This flag indicates that Ghostscript should open the output file
and pass a file descriptor to the server. If not set, Ghostscript
simply passes the filename set in OutputFile to the server. In most
cases, this flag won't matter, but if you have a driver which works
only with OutputFD (such as hpijs 1.0.2), or if you're using the
-sOutputFile="|cmd" syntax, you'll need to set it.
</dl>
<dl>
<dt><b><tt>-dBitsPerSample=</tt></b><em>N</em>
<dd>This parameter controls the number of bits per sample. The
default value of 8 should be appropriate for most work. For monochrome
images, use -dBitsPerSample=1.
</dl>
<p>Generic Ghostscript options that are particularly relevant for IJS
are summarized below:
</p>
<dl>
<dt><b><tt>-r</tt></b><em>number</em>
<br><b><tt>-r</tt></b><em>number1</em><b><tt>x</tt></b><em>number2</em>
<dd>Sets the resolution, in dpi. If the resolution is not specified,
Ghostscript queries the IJS server to determine the preferred resolution.
When the resolution is specified, it overrides the value (if any)
preferred by the IJS server.
</dl>
<dl>
<dt><b><tt>-dDuplex</tt></b>
<dt><b><tt>-dTumble</tt></b>
<dd>These flags enable duplex (two-sided) printing. Tumble controls
the orientation. When Tumble is false, the pages
are oriented suitably at the left or right. When Tumble is true,
the pages are oriented suitably for binding at the top or
bottom.
</dl>
<dl>
<dt><b><tt>-sProcessColorModel=</tt></b><em>{name}</em>
<dd>Use this flag to select the process color model. Suitable values
include DeviceGray, DeviceRGB, and DeviceCMYK.
</dl>
<h3>Building IJS</h3>
<p> IJS is included by default on Unix gcc builds, and also in
autoconf'ed builds. Others may need some makefile tweaking. First,
make sure the IJS device is selected:
<blockquote>
DEVICE_DEVS2=$(DD)ijs.dev
</blockquote>
<p> Next, make sure that the path and execution type are set in
the toplevel makefile. The values for Unix are as follows:
<blockquote>
IJSSRCDIR=ijs
IJSEXECTYPE=unix
</blockquote>
<p> At present, "unix" and "win" are the only supported values for
IJSEXECTYPE. If neither sounds appropriate for your system, it's
possible that more porting work is needed.
<p> Last, make sure that ijs.mak is included in the toplevel makefile.
It should be present right after the include of icclib.mak.
<p> IJS is not inherently platform-specific. We're very much interested
in taking patches from people who have ported it to non-mainstream
platforms. And once it's built, you won't have to recompile Ghostscript
to support new drivers!
<h2><a name="Win"></a>MS Windows printers</h2>
<p>
This section was written by Russell Lang, the author of Ghostscript's
MS Windows-specific printer driver, and updated by
<a href="mailto:Pierre.Arnaud@opac.ch">Pierre Arnaud</a>,
the current maintainer.
</p>
<p>
The <b><tt>mswinpr2</tt></b> device uses MS Windows printer drivers, and
thus should work with any printer with device-independent bitmap (DIB)
raster capabilities. The printer resolution cannot be selected directly
using PostScript commands from Ghostscript: use the printer setup in the
Control Panel instead. It is however possible to specify a maximum resolution
for the printed document (see below).
</p>
<p>
If no Windows printer name is specified in <b><tt>-sOutputFile</tt></b>,
Ghostscript prompts for a Windows printer using the standard Print Setup
dialog box. You must set the orientation to Portrait and the page size to
that expected by Ghostscript; otherwise the image will be clipped.
Ghostscript sets the physical device size to that of the Windows printer
driver, but it does not update the PostScript clipping path.
</p>
<p>
If a Windows printer name is specified in <b><tt>-sOutputFile</tt></b> using
the format <tt>"\\spool\printer_name"</tt>, for instance
</p>
<blockquote><b><tt>
gs ... -sOutputFile="\\spool\Apple LaserWriter II NT"
</tt></b></blockquote>
<p>
then Ghostscript attempts to open the Windows printer without prompting
(except, of course, if the printer is connected to <b><tt>FILE:</tt></b>).
Ghostscript attempts to set the Windows printer page size and orientation
to match that expected by Ghostscript, but doesn't always succeed. It uses
this algorithm:
</p>
<ol>
<li>If the requested page size matches one of the Windows standard page
sizes +/- 2mm, request that standard size.</li>
<li>Otherwise if the requested page size matches one of the Windows
standard page sizes in landscape mode, ask for that standard size in
landscape.</li>
<li>Otherwise ask for the page size by specifying only its dimensions.</li>
<li>Merge the requests above with the defaults. If the printer driver
ignores the requested paper size, no error is generated: it will print on
the wrong paper size.</li>
<li>Open the Windows printer with the merged orientation and size.</li>
</ol>
<p>
The Ghostscript physical device size is updated to match the Windows
printer physical device.
</p>
<h3><a name="Win_properties"></a>Supported command-line parameters</h3>
<p>
The <b><tt>mswinpr2</tt></b> device supports a limited number of command-line
parameters (e.g. it does not support setting the printer resolution). The
recognized parameters are the following:
</p>
<blockquote>
<dl>
<dt><b><tt>-sDEVICE=mswinpr2</tt></b></dt>
<dd>Selects the MS Windows printer device. If Ghostscript was not
compiled with this device as the default output device, you have to specify
it on the command line.</dd>
<dt><b><tt>-dNoCancel</tt></b></dt>
<dd>Hides the progress dialog, which shows the percent of the document page
already processed and also provides a <em>cancel</em> button. This option
is useful if GS is intended to print pages in the background, without any
user intervention.</dd>
<dt><b><tt>-sOutputFile=</tt></b><b>"\\spool\<em>printer_name</em>"</b></dt>
<dd>Specifies which printer should be used. The <em>printer_name</em> should be
typed exactly as it appears in the Printers control panel, including spaces.</dd>
</dl>
</blockquote>
<h3><a name="Win_options"></a>Supported options (device properties)</h3>
<p>
Several extra options exist which cannot be set through the command-line,
but only by executing the appropriate PostScript setup code. These options
can be set through the inclusion of a setup file on the command-line:
</p>
<blockquote><b><tt>
gs ... setup.ps ...
</tt></b></blockquote>
<p>
The <tt>setup.ps</tt> file is responsible for the device selection, therefore
you should not specify the <b><tt>-sDEVICE=mswinpr2</tt></b> option on the
command-line if you are using such a setup file. Here is an example of such
a setup file:
</p>
<blockquote><pre>
mark
/NoCancel true % don't show the cancel dialog
/BitsPerPixel 4 % force 4 bits/pixel
/UserSettings
<<
/DocumentName (Ghostscript document) % name for the Windows spooler
/MaxResolution 360 % maximum document resolution
>>
(mswinpr2) finddevice % select the Windows device driver
putdeviceprops
setdevice
</pre></blockquote>
<p>
This example disables the progress dialog (same as the <tt><b>-dNoCancel</b></tt>
option), forces a 4 bits/pixel output resolution and specifies additional user
settings, such as the document name (which will be displayed by the Windows
spooler for the queued document) and the maximum resolution (here 360 dpi).
It then finds and selects an instance of the MS Windows device printer
and activates it. This will show the standard printer dialog, since no
<tt><b>/OutputFile</b></tt> property was specified.
</p>
<p>
The following options are available:
</p>
<blockquote>
<dl>
<dt><b><tt>/NoCancel <em>boolean</em></tt></b></dt>
<dd>Disables (hides) the progress dialog when set to <em><tt>true</tt></em> or
show the progress dialog if not set or set to <em><tt>false</tt></em>.</dd>
<dt><b><tt>/OutputFile <em>string</em></tt></b></dt>
<dd>Specifies which printer should be used. The string should be of the form
<tt><b>\\spool\<em>printer_name</em></b></tt>, where the <em>printer_name</em> should be
typed exactly as it appears in the Printers control panel, including spaces.</dd>
<dt><b><tt>/QueryUser <em>integer</em></tt></b></dt>
<dd>Shows the standard printer dialog (<tt><b>1</b></tt> or any other value),
shows the <em>printer setup dialog</em> (<tt><b>2</b></tt>) or selects the
<em>default Windows printer</em> without any user interaction (<tt><b>3</b></tt>).</dd>
<dt><b><tt>/BitsPerPixel <em>integer</em></tt></b></dt>
<dd>Sets the device depth to the specified bits per pixel. Currently supported
values are <tt><b>1</b></tt> (monochrome), <tt><b>4</b></tt> (CMYK with screening
handled by Ghostscript) and <tt><b>24</b></tt> (True Color, dithering handled by
the Windows printer driver; this option can produce huge print jobs).</dd>
<dt><b><tt>/UserSettings <em>dict</em></tt></b></dt>
<dd>Sets additional options, defined in a dictionary. The following properties can
be set:
<dl>
<dt><b><tt>/DocumentName <em>string</em></tt></b></dt>
<dd>Defines the user friendly document name which will be displayed by the
Windows spooler.</dd>
<dt><b><tt>/DocumentRange <em>[n1 n2]</em></tt></b></dt>
<dd>Defines the range of pages contained in the document. This information can
be used by the printer dialog, in conjunction with the following property.</dd>
<dt><b><tt>/SelectedRange <em>[n1 n2]</em></tt></b></dt>
<dd>Defines the selected range of pages. This information will be displayed in
the printer dialog and will be updated after the user interaction. A PostScript
program could check these values and print only the selected page range.</dd>
<dt><b><tt>/MaxResolution <em>dpi</em></tt></b></dt>
<dd>Specifies the maximum tolerated output resolution. If the selected printer has
a higher resolution than <tt><b>dpi</b></tt>, then Ghostscript will render the
document with a submultiple of the printer resolution. For example, if
<tt><b>MaxResolution</b></tt> is set to 360 and the output printer supports
up to 1200 dpi, then Ghostscript renders the document with an internal
resolution of 1200/4=300 dpi. This can be very useful to reduce the memory
requirements when printing in True Color on some high resolution ink-jet color
printers.</dd>
</dl></dd>
</dl>
</blockquote>
<p>
These properties can be queried through the <tt><b>currentpagedevice</b></tt>
operator. The following PostScript code snippet shows how to do it for some
of the properties:
</p>
<blockquote><pre>
currentpagedevice /BitsPerPixel get == % displays the selected depth
currentpagedevice /UserSettings get % get the additional options..
/us exch def % ..and assign them to a variable
us /DocumentName get == % displays the document name
us /SelectedRange get == % displays the selected page range
% other misc. informations (don't rely on them)
us /Color get == % 1 => monochrome output, 2 => color output
us /PrintCopies get == % displays the number of copies requested
</pre></blockquote>
<p>
There are a few undocumented informations stored in the <tt><b>UserSettings</b></tt>
dictionary. You should not rely on them. Their use is still experimental and
they could be removed in a future version.
</p>
<h3><a name="Win_duplex"></a>Duplex printing</h3>
<p>
If the Windows printer supports the duplex printing feature, then it will
also be available through the <b><tt>mswinpr2</tt></b> device. You can query
for this support through the <b><tt>/Duplex</tt></b> propery of the
<b><tt>currentpagedevice</tt></b>. If it returns <b><tt>null</tt></b>, then
the feature is not supported by the selected printer. Otherwise, <b><tt>true</tt></b>
means that the printer is currently set up to print on both faces of the paper
and <b><tt>false</tt></b> that it is not, but that it can.
</p>
<p>
The following example shows how to print on both faces of the paper (using
the long side of the paper as the reference):
</p>
<blockquote><pre>
<< /Duplex true /Tumble false >> setpagedevice
</pre></blockquote>
<p>
</p>
<hr>
<h2><a name="File_formats"></a>File formats</h2>
<h3><a name="JFIF"></a>JPEG file format (JFIF)</h3>
<p>
Ghostscript includes output drivers that can produce <a
href="http://www.ijg.org/">Independent JPEG Group</a> JFIF (JPEG File
Interchange Format) files from PostScript images. <b>Please note</b> that
JPEG is a compression method specifically intended for continuous-tone
images such as photographs, not for graphics, and it is therefore quite
unsuitable for the vast majority of page images produced with PostScript,
which should be saved in a form better for graphics, such as
<a href="http://www.libpng.org/pub/png/">Portable Network Graphics</a>
(PNG) format. If you get crummy-looking JPEG files, don't blame
Ghostscript; instead consult a reference about uses and abuses of JPEG,
such as the JPEG FAQ
<blockquote>
<a href="http://www.faqs.org/faqs/jpeg-faq/">http://www.faqs.org/faqs/jpeg-faq/</a>
</blockquote>
<p>
You can use the JPEG output drivers -- <b><tt>jpeg</tt></b> to produce
color JPEG files and <b><tt>jpeggray</tt></b> for grayscale JPEGs -- the
same as other file-format drivers: by specifying the device name and an
output file name, for example
<blockquote><b><tt>
gs -sDEVICE=jpeg -sOutputFile=foo.jpg foo.ps
</tt></b></blockquote>
<p>
You can also use the <a href="Use.htm#Resolution_switch"><b><tt>-r</tt></b>
switch</a> to specify the imaging resolution and thus the output file's
size in pixels. The default resolution is normally 72×72dpi.
<p>
The JPEG devices support several special parameters to control the JPEG
"quality setting" (DCT quantization level).
<blockquote>
<dl>
<dt><b><tt>-dJPEGQ=</tt></b><b><em>N</em></b> (integer from 0 to 100, default 75)
<dd>Set the quality level <b><em>N</em></b> according to the widely used
IJG quality scale, which balances the extent of compression against the
fidelity of the image when reconstituted. Lower values drop more
information from the image to achieve higher compression, and therefore
have lower quality when reconstituted.
<dt><b><tt>-dQFactor=</tt></b><b><em>M</em></b> (float from 0.0 to 1.0)
<dd>Adobe's QFactor quality scale, which you may use in place of
<b><tt>JPEGQ</tt></b> above. The QFactor scale is used by PostScript's
DCTEncode filter but is nearly unheard-of elsewhere.
</dl>
</blockquote>
<p>
At this writing the default JPEG quality level of 75 is equivalent to
<b><tt>-dQFactor=0.5</tt></b>, but the JPEG default might change in the
future. The JPEG drivers could be extended to support additional JPEG
compression options, such as the other DCTEncode filter parameters, but so
far they haven't been.
<h3><a name="TIFF"></a>TIFF file formats</h3>
<p>
There are two unrelated sets of TIFF drivers. There are two color TIFF
drivers that produce uncompressed output:
<blockquote>
<dl>
<dt><b><tt>tiff12nc</tt></b>
<dd>Produces 12-bit RGB output (4 bits per component).
<dt><b><tt>tiff24nc</tt></b>
<dd>Produces 24-bit RGB output (8 bits per component).
</dl>
</blockquote>
<p>
The remaining TIFF drivers all produce black-and-white output with different
compression modes:
<blockquote>
<dl>
<dt><b><tt>tiffcrle</tt></b>
<dd>G3 fax encoding with no EOLs
<dt><b><tt>tiffg3</tt></b>
<dd>G3 fax encoding with EOLs
<dt><b><tt>tiffg32d</tt></b>
<dd>2-D G3 fax encoding
<dt><b><tt>tiffg4</tt></b>
<dd>G4 fax encoding
<dt><b><tt>tifflzw</tt></b>
<dd>LZW-compatible (tag = 5) compression
<dt><b><tt>tiffpack</tt></b>
<dd>PackBits (tag = 32773) compression
</dl>
</blockquote>
<p>
The black-and-white TIFF drivers support creation of files that are
comprised of more than a single strip. Multi-strip files reduce the memory
requirement on the reader, since readers need only store and process one
strip at a time. These drivers provide two parameters beyond the standard
set:
<blockquote>
<dl>
<dt><b><tt>-dMaxStripSize=</tt><em>N</em></b> (non-negative integer; default = 0)
<dd>Set the maximum (uncompressed) size of a strip.
<dt><b><tt>-dAdjustWidth=</tt><em>true|false</em></b> (Boolean; default =
true)
<dd>If true, then if the requested page width is close to either A4 (1728
columns) or B4 (2048 columns), set the page width to A4 or B4 respectively.
</dl></blockquote>
<p>
The TIFF 6.0 specification, Section 7, page 27, recommends that the size of
each strip be about 8 Kbytes. As an example, to generate the 'tiger' in
tiffg4 format that has the recommended strip size, use:
<blockquote><pre>
gs -sDEVICE=tiffg4 -sOutputFile=tiger.tif -dMaxStripSize=8192 examples/tiger.eps
</pre></blockquote>
<p>
If the value of the <b><tt>MaxStripSize</tt></b> parameter is smaller than a
single image row, then no error will be generated, and the TIFF file will be
generated correctly using one row per strip. Note that smaller strip sizes
increase the size of the file by increasing the size of the StripOffsets and
StripByteCounts tables, and by reducing the effectiveness of the compression
which must start over for each strip.
<p>
If the value of MaxStripSize is 0 (the default), then the entire image will
be a single strip.
<hr>
<h2><a name="Display_devices"></a>Display Devices</h2>
<p>
Ghostscript is often used for screen display of postscript and pdf documents.
In many cases, a client or 'viewer' application calls the ghostscript engine
to do the rasterization and handles the display of the resulting image itself,
but it is also possible to invoke ghostscript directly and select an output
device which directly handles displaying the image on screen.
<p>
This section describes the various display-oriented devices that are available
in ghostscript.
<h3><a name="x11_devices"></a>X Window System</h3>
<p>
Perhaps the most common use of of a display device is with the X Window System
on unix-like systems. It is the default device on the command line client on
such systems, and is used more creatively by the gv client application.
<p>
The available devices are:
<dl>
<dt><b>x11</b>
<dd>This is the default device, handling display on X11R6.
<dt><b>x11alpha</b>
<dd>This is the x11 device, but with antialiasing. It is equivalent to
invoking the x11 device with the options <tt>-dGraphicsAlphaBits=4
-dTextAlphaBits=4 -dMaxBitmap=50000000</tt>.
<dt><b>x11cmyk</b>
<dd>This device rasterizes the image in the CMKY color space, then flattens
it to RGB for display. It's intended for testing only.
<dt><b>x11mono</b>
<dd>This is a strict black-and-white device for 1-bit monochrome displays.
<dt><b>x11gray2</b>
<dd>This is a device for 2 bpp (4-level) monochrome displays.
<dt><b>x11gray4</b>
<dd>This is a device for 4 bpp (16-level) monochrome displays.
</dl>
<hr>
<h2><a name="HP_ijs"></a>HP Deskjet official drivers</h2>
<p>
HP provides official drivers for many of their Deskjet printer models.
In order to use these drivers, you will need the HP Inkjet Server as
well as Ghostscript, available from <a
href="http://hpinkjet.sourceforge.net">http://hpinkjet.sourceforge.net</a>.
This version of Ghostscript includes the patch from version 0.97 of
the hpijs software. If you are installing hpijs from an RPM, you will
only need the hpijs RPM, not the ghostscript-hpijs one, as the code
needed to work with hpijs is already included.
<p>
Note that newer version of the hpijs drivers support the IJS protocol.
If you can, you should consider using the ijs driver instead. Among
other things, the hpijs Ghostscript driver is Unix-only, and is untested
on older Unix platforms.
<p>
As of the 0.97 version, hpijs supports the following printer models:
<dl><dt><b>e-Series:</b>
<dd>e-20
<dt><b>DeskJet 350C Series:</b>
<dd>350C
<dt><b>DeskJet 600C Series:</b>
<dd>600C, 660C, 670/672C, 670TV, 680/682C
<dt><b>DeskJet 600C Series Photo:</b>
<dd>610/612C, 640/648C, 690/692/693/694/695/697C
<dt><b>DeskJet 630C Series:</b>
<dd>630/632C
<dt><b>DeskJet 800C Series:</b>
<dd>810/812C, 830/832C, 840/842/843C, 880/882C, 895C
<dt><b>DeskJet 900C Series, PhotoSmart::</b>
<dd>930/932C, 950/952C, 970C, PhotoSmart 1000/1100
<dt><b>DeskJet 990C, PhotoSmart:</b>
<dd>960C, 980C, 990C, PhotoSmart 1215/1218
</ul>
<p>You will need to add the following line to your makefile:
<blockquote>
DEVICE_DEVS2=$(DD)DJ630.dev $(DD)DJ6xx.dev $(DD)DJ6xxP.dev $(DD)DJ8xx.dev $(DD)DJ9xx.dev $(DD)DJ9xxVIP.dev $(DD)AP21xx.dev
</blockquote>
<p>
Please see <a
href="http://hpinkjet.sourceforge.net">http://hpinkjet.sourceforge.net</a>
for more information about this driver. Thanks to the folks at HP,
especially David Suffield for making this driver available and working to
integrate it with Ghostscript.
<hr>
<h2><a name="HP8_color_inkjet"></a>H-P 8xx, 1100, and 1600 color inkjet printers</h2>
<p>
This section, written by Uli Wortmann <<a
href="mailto:uliw@erdw.ethz.ch">uliw@erdw.ethz.ch</a>>, deals with the
DeskJet 670, 690, 850, 855, 870, 890, 1100, and 1600.
<h3><a name="HP8_gdevcd8"></a>Drivers contained in <b><tt>gdevcd8.c</tt></b></h3>
<p>
The source module <b><tt>gdevcd8.c</tt></b> contains four generic drivers:
<blockquote><table cellpadding=0 cellspacing=0>
<tr valign=top> <td><b><tt>cdj670</tt></b>
<td>
<td>HP DeskJet 670 and 690
<tr valign=top> <td><b><tt>cdj850</tt></b>
<td>
<td>HP DeskJet 850, 855, 870, and 1100
<tr valign=top> <td><b><tt>cdj890</tt></b>
<td>
<td>HP DeskJet 890
<tr valign=top> <td><b><tt>cdj1600</tt></b>
<td>
<td>HP DeskJet 1600
</table></blockquote>
<h3><a name="HP8_further_documentation"></a>Further documentation</h3>
<p>
<b>Credits:</b> Much of the driver is based on ideas derived from the
cdj550 driver of George Cameron. The support for the hp670, hp690, hp890
and hp1600 was added by Martin Gerbershagen.
<blockquote><table cellpadding=0 cellspacing=0>
<tr valign=top> <td>11.11.96
<td>
<td>Version 1.0
<td>
<td>
<tr valign=top> <td>25.08.97
<td>
<td>Version 1.2
<td>
<td>Resolved all but one of the known bugs, introduced a couple of
perfomance improvements. Complete new color-transfer-function
handling (see gamma).
<tr valign=top> <td>01.06.98
<td>
<td>Version 1.3
<td>
<td>Due to the most welcome contribution of Martin Gerbershagen
(ger@ulm.temic.de), support for the hp670, hp690 and hp890 and
hp1600 has been added. Martin has also resolved all known bugs.
<tr valign=top> <td>
<td>
<td>
<td>
<td>Problems:Dark colors are still pale.
</table></blockquote>
<p>
The hp690 is supported through the hp670 device, the hp855, hp870 and the
hp1100 through the hp850 device. The driver needs no longer special
switches to be invoked except <b><tt>-sDEVICE=cdj850</tt></b>,
<b><tt>-sDEVICE=CDJ890</tt></b>, <b><tt>-sDEVICE=CDJ670</tt></b>, or
<b><tt>-sDevice=CDJ1600</tt></b>. The following switches are supported.
<blockquote><table cellpadding=0 cellspacing=0>
<tr valign=top> <td><b><tt>-dPapertype=</tt></b>
<td>
<td>0
<td>
<td>plain paper [default]
<tr valign=top> <td>
<td>
<td>1
<td>
<td>bond paper
<tr valign=top> <td>
<td>
<td>2
<td>
<td>special paper
<tr valign=top> <td>
<td>
<td>3
<td>
<td>glossy film
<tr valign=top> <td>
<td>
<td>4
<td>
<td>transparency film
<tr valign=top> <td>
<td>
<td>
<td>
<td>Currently the lookup tables are unsuited for printing on
special paper or transparencies. For these please revert to the
gamma functions.
<tr valign=top> <td><b><tt>-dQuality=</tt></b>
<td>
<td>-1
<td>
<td>draft
<tr valign=top> <td>
<td>
<td>0
<td>
<td>normal [default]
<tr valign=top> <td>
<td>
<td>1
<td>
<td>presentation
<tr valign=top> <td><b><tt>-dRetStatus=</tt></b>
<td>
<td>0
<td>
<td>C-RET off
<tr valign=top> <td>
<td>
<td>1
<td>
<td>C-RET on [default]
<tr valign=top> <td><b><tt>-dMasterGamma=</tt></b>
<td>
<td>3.0
<td>
<td>[default = 1.0]
</table></blockquote>
<blockquote>
<b>Note:</b> To take advantage of the calibrated color-transfer functions,
be sure not to have any gamma statements left! If you need to (i.e., for
overhead transparencies), you still can use the gamma functions, but they
will override the built-in calibration. To use gamma in the traditional
way, set MasterGamma to any value greater than 1.0 and less than 10.0. To
adjust individual gamma values, you have to additionally set MasterGamma to
a value greater than 1.0 and less than 10.0. With the next release, gamma
functions will be dropped.
</blockquote>
<p>
When using the driver, be aware that printing at 600dpi involves
processing large amounts of data (> 188MB !). Therefore the
driver is not what you would expect to be a fast driver ;-)
This is no problem when printing a full-sized color page (because
printing itself is slow), but it's really annoying if you print only
text pages. Maybe I can optimize the code for text-only pages in a
later release. Right now, it is recommended to use the highest
possible optimisation level your compiler offers.
For the time being, use the cdj550 device with <b><tt>-sBitsPerPixel=3</tt></b>
for fast proof prints. If you simply want to print 600dpi BW data,
use the cdj550 device with <b><tt>-sBitsPerPixel=8</tt></b> (or 1).
<p>
Since the printer itself is slow, it may help to set the process priority
of the gs process to "regular" or even less. On a 486/100MHz this is still
sufficient to maintain a continuous data flow. Note to OS/2 users: simply
put the gs window into the background or minimize it. Also make sure that
<b><tt>print01.sys</tt></b> is invoked without the <b><tt>/irq</tt></b>
switch (great speed improvement under Warp4).
<p>
The printer default settings compensate for dot-gain by a calibrated
color-transfer function. If this appears to be too light for your business
graphs, or for overhead transparencies, feel free to set
<b><tt>-dMasterGamma=1.7</tt></b>. Furthermore, you may tweak the gamma
values independently by setting <b><tt>-dGammaValC</tt></b>,
<b><tt>-dGammaValM</tt></b>, <b><tt>-dGammaValY</tt></b> or
<b><tt>-dGammaValK</tt></b> (if not set, the values default to
<b><tt>MasterGamma</tt></b>). This will only work when
<b><tt>-dMasterGamma</tt></b> is set to a value greater than 1.0.
<p>
Further information, bugs, tips etc, can be found at my website. To learn
more about gamma, see
<a href="ftp://ftp.igd.fhg.de/pub/doc/colour/GammaFAQ.pdf">ftp://ftp.igd.fhg.de/pub/doc/colour/GammaFAQ.pdf</a>.
<p>
Depending on how you transfer the files, under UNIX you may need to remove
the CRs of the CR-LF sequence used for end-of-line on DOS-based (MS
Windows-based) systems. You can do this in unpacking the files with <b><tt>unzip -a hp850.zip</tt></b>.
<p>
To compile with gs5.x or later, simply add to your makefile
<blockquote>
DEVICE_DEVS4=cdj850.dev cdj670.dev cdj890.dev cdj1600.dev
</blockquote>
<p>
Have fun!
<p>
Uli <<a href="mailto:uliw@erdw.ethz.ch">uliw@erdw.ethz.ch</a>>
<br><a href="http://www.erdw.ethz.ch/~bonk/">http://www.erdw.ethz.ch/~bonk/</a>
<hr>
<h2><a name="HP880_color_inkjet"></a>H-P 812, 815, 832, 880, 882, 895, and 970 color inkjet printers</h2>
<p>
This section, written by Matthew Gelhaus <<a
href="mailto:hp880@gelhaus.net">hp880@gelhaus.net</a>>, deals with the
DeskJet 812, 815, 832, 880, 882, 895, and 970.
<p>
This is a modified version of the <a href="#HP8_color_inkjet">HP8xx driver</a>
written by Uli Wortmann. More information and download are available at
<a href="http://www.gelhaus.net/hp880c/">http://www.gelhaus.net/hp880c/</a>.
<h3><a name="HP880_gdevcd8"></a>Drivers contained in <b><tt>gdevcd8.c</tt></b></h3>
<p>
The source module <b><tt>gdevcd8.c</tt></b> contains one generic driver:
<blockquote><table cellpadding=0 cellspacing=0>
<tr valign=top> <td><b><tt>cdj880</tt></b>
<td>
<td>HP DeskJet 812, 815, 832, 880, 882, 895, and 970
</table></blockquote>
<h3><a name="HP880_further_documentation"></a>Further documentation</h3>
<p>
<b>Credits:</b> This driver is based on the cdj850 driver by Uli Wortmann, and shares the same
internal structure, although the PCL3+ interpretation has changed.
<blockquote><table cellpadding=0 cellspacing=0>
<tr valign=top> <td>15.03.99
<td>
<td>Version 1.3
<td>
<td>Initial version, based on Version 1.3 of Uli Wortmann's driver.
<tr valign=top> <td>26.02.00
<td>
<td>Version 1.4beta
<td>
<td>Greatly improved color handling & dithering, but not yet complete enough
to use for text.
</table></blockquote>
<p>
All printers are supported through the cdj880 device. Invoke with
<b><tt>-sDEVICE=cdj880</tt></b>. The following switches are supported.
<blockquote><table cellpadding=0 cellspacing=0>
<tr valign=top> <td><b><tt>-dPapertype=</tt></b>
<td>
<td>0
<td>
<td>plain paper [default]
<tr valign=top> <td>
<td>
<td>1
<td>
<td>bond paper
<tr valign=top> <td>
<td>
<td>2
<td>
<td>special paper
<tr valign=top> <td>
<td>
<td>3
<td>
<td>glossy film
<tr valign=top> <td>
<td>
<td>4
<td>
<td>transparency film
<tr valign=top> <td>
<td>
<td>
<td>
<td>Currently the lookup tables are unsuited for printing on
special paper or transparencies. For these please revert to the
gamma functions.
<tr valign=top> <td><b><tt>-dQuality=</tt></b>
<td>
<td>-1
<td>
<td>draft
<tr valign=top> <td>
<td>
<td>0
<td>
<td>normal [default]
<tr valign=top> <td>
<td>
<td>1
<td>
<td>presentation
<tr valign=top> <td><b><tt>-dMasterGamma=</tt></b>
<td>
<td>3.0
<td>
<td>[default = 1.0]
</table></blockquote>
<p>
The printer default settings compensate for dot-gain by a pre-defined
color-transfer function. If this appears to be too light for your business
graphs, or for overhead transparencies, feel free to set
<b><tt>-dMasterGamma=1.7</tt></b>. Furthermore, you may tweak the gamma
values independently by setting <b><tt>-dGammaValC</tt></b>,
<b><tt>-dGammaValM</tt></b>, <b><tt>-dGammaValY</tt></b> or
<b><tt>-dGammaValK</tt></b> (if not set, the values default to
<b><tt>MasterGamma</tt></b>). This will only work when
<b><tt>-dMasterGamma</tt></b> is set to a value greater than 1.0.
<p>
Further information, bugs, tips etc, can be found at my website.
<p>
To compile with gs6.x or later, simply add to your makefile
<blockquote>
DEVICE_DEVS4=$(DD)cdj880.dev
</blockquote>
<p>
Matthew Gelhaus <<a href="mailto:hp880@gelhaus.net">mailto:hp880@gelhaus.net</a>>
<br><a href="http://www.gelhaus.net/hp880c/">http://www.gelhaus.net/hp880c/</a>
<hr>
<h2><a name="HP_color_inkjet"></a>H-P color inkjet printers</h2>
<p>
This section, written by George Cameron, deals with the DeskJet 500C,
DeskJet 550C, PaintJet, PaintJet XL, PaintJet XL300, the DEC LJ250
operating in PaintJet-compatible mode.
<h3><a name="HP_gdevcdj"></a>Drivers contained in <b><tt>gdevcdj.c</tt></b></h3>
<p>
The source module <b><tt>gdevcdj.c</tt></b> contains six generic drivers:
<blockquote><table cellpadding=0 cellspacing=0>
<tr valign=top> <td><b><tt>cdj500</tt></b>
<td>
<td>HP DeskJet 500C and 540C
<tr valign=top> <td><b><tt>cdj550</tt></b>
<td>
<td>HP DeskJet 550C, 560C, 660C, 660Cse
<tr valign=top> <td><b><tt>pjxl300</tt></b>
<td>
<td>HP PaintJet XL300, DeskJet 1200C, and CopyJet
<tr valign=top> <td><b><tt>pjtest</tt></b>
<td>
<td>HP PaintJet
<tr valign=top> <td><b><tt>pjxltest</tt></b>
<td>
<td>HP PaintJet XL
<tr valign=top> <td><b><tt>declj250</tt></b>
<td>
<td>DEC LJ250
</table></blockquote>
<p>
All these drivers have 8-bit (monochrome), 16-bit and 24-bit (colour) and
for the DJ 550C, 32-bit (colour, CMYK mode) options in addition to standard
colour and mono drivers. It is also possible to set various
printer-specific parameters from the command line, for example
<blockquote><b><tt>
gs -sDEVICE=cDeskJet -dBitsPerPixel=16 -dDepletion=1 -dShingling=2 tiger.eps
</tt></b></blockquote>
<p>
<b>Note:</b> the old names <b><tt>cDeskJet</tt></b>,
<b><tt>cdjcolor</tt></b> and <b><tt>cdjmono</tt></b> drivers have been
retained; however, their functionality duplicates that available using the
drivers above (and <b><tt>cDeskJet</tt></b> is identical to
<b><tt>cdj500</tt></b>). That is, we can use
<blockquote><table cellpadding=0 cellspacing=0>
<tr valign=top> <td><b><tt>gs -sDEVICE=cdj500 -dBitsPerPixel=24</tt></b>
<td>
<td>for <b><tt>cdjcolor</tt></b>, and
<tr valign=top> <td><b><tt>gs -sDEVICE=cdj500 -dBitsPerPixel=1</tt></b>
<td>
<td>for <b><tt>cdjmono</tt></b>
</table></blockquote>
<h3><a name="HP_paper_size"></a>Default paper size</h3>
<p>
If the preprocessor symbol <b><tt>A4</tt></b> is defined, the default paper
size is ISO A4; otherwise it is U.S. letter size (see about
<a href="Use.htm#Known_paper_sizes">paper sizes</a> in the usage
documentation). You can <a href="Use.htm#Paper_size">specify other paper
sizes</a> on the command line, including A3 for the PaintJet XL and
PaintJet XL300, as also explained in the usage documentation.
<h3><a name="HP_limits"></a>DeskJet physical limits</h3>
<p>
The DeskJet's maximum printing width is 2400 dots, or 8 inches
(20.32cm). The printer manuals say that the maximum recommended printing
height on the page is 10.3 inches (26.16cm), but since this is obviously
not true for A4 paper, and I have been unable to detect any problems in
printing longer page lengths, this would seem to be a rather artificial
restriction.
<p>
All DeskJets have 0.5 inches (1.27cm) of unprintable bottom margin, due to the mechanical
arrangement used to grab the paper. Side margins are approximately 0.25 inches (0.64cm)
for U.S. letter paper, and 0.15 inches (0.38cm) for A4.
<h4><a name="HP_command_line"></a>Printer properties (command-line parameters)</h4>
<p>
Several printer "properties" have been implemented for these printers.
Those available so far are all integer quantities, and thus may be
specified, for instance, like
<blockquote>
<b><tt>gs -dBitsPerPixel=32 -dShingling=1</tt></b> ...
</blockquote>
<p>
which sets the <b><tt>BitsPerPixel</tt></b> parameter to 32 and the
<b><tt>Shingling</tt></b> parameter to 1.
<h4><a name="HP_bpp"></a>Bits per pixel</h4>
<p>
If the preprocessor symbol <b><tt>BITSPERPIXEL</tt></b> is defined as an
integer (see below for the range of allowable values), that number defines
the default bits per pixel (bit depth) for the generic drivers. If the
symbol is undefined, the default is 24 bits per pixel. It is, of course,
still possible to specify the value from the command line as described
below. Note also that the <b><tt>cDeskJet</tt></b>,
<b><tt>cdjcolor</tt></b> and <b><tt>cdjmono</tt></b> drivers are unaffected
by setting this symbol, as their default settings are predefined to be 1, 3
and 24 respectively.
<p>
All of the drivers in <b><tt>gdevcdj.c</tt></b> accept a command line
option to set the <b><tt>BitsPerPixel</tt></b> property. This gives
considerable flexibility in choosing various tradeoffs among speed,
quality, colour, etc. The valid numbers are:
<blockquote><dl compact>
<dt><b>1</b>
<dd>A standard Ghostscript monochrome driver, using black ink (by
installing the separate mono cartridge in the case of the DeskJet 500C, or
automatically for the other printers).
<dt><b>3</b>
<dd>A standard Ghostscript colour driver, using internal dithering. This
is fast to compute and to print, but the clustered dithering can lose some
detail and colour fidelity.
<dt><b>8</b>
<dd>An "error-diffusion" monochrome driver which uses Floyd-Steinberg
dithering to print greyscale images. The patterns are much more randomised
than with the normal clustered dithering, but the data files can be much
larger and somewhat slower to print.
<dt><b>16</b>
<dd>A "cheaper" version of the 24-bit driver, which generates
Floyd-Steinberg colour dithered output using the minimum memory (this may
be helpful when using Ghostscript has not been compiled using a 16-bit
build environment). The quality can be almost as good as the 24-bit
version.
<dt><b>24</b>
<dd>A high-quality colour driver using Floyd-Steinberg dithering for
maximum detail and colour range. However, it is very memory-intensive, and
thus can be slow to compute. It tends to produce rather larger raw data
files, so they can also take longer to print.
<dt><b>32</b>
<dd>Only for the DeskJet 550C, which uses the black cartridge and the
colour cartridge simultaneously (that is, CMYK printing). This printer can
both be faster and give higher quality than the DeskJet 500C, because of
the true black ink. (Note that the 24-bit mode also permits CMYK printing
on this printer, and uses less memory. Any differences between 24-bit and
32-bit should be small.)
</dl></blockquote>
<h4><a name="HP_DeskJet_properties"></a>DeskJet properties</h4>
<blockquote><table cellpadding=0 cellspacing=0>
<tr valign=bottom>
<th align=left>Name
<td>
<th align=left>Type
<td>
<th align=left>
<tr> <td colspan=5><hr>
<tr valign=top> <td><b><tt>BlackCorrect</tt></b>
<td>
<td><b><tt>int</tt></b>
<td>
<td>Colour correction to give better blacks when using the DJ500C in colour mode. For example, the default of 4 reduces the cyan component to 4/5. Range accepted: 0 - 9 (0 = none).
<tr valign=top> <td><b><tt>Shingling</tt></b>
<td>
<td><b><tt>int</tt></b>
<td>
<td>Interlaced, multi-pass printing: 0 = none, 1 = 50%, 2 = 25%, 2 is best and slowest.
<tr valign=top> <td><b><tt>Depletion</tt></b>
<td>
<td><b><tt>int</tt></b>
<td>
<td>"Intelligent" dot-removal: 0 = none, 1 = 25%, 2 = 50%, 1 best for graphics? Use 0 for transparencies.
</table></blockquote>
<h4><a name="HP_PaintJet_properties"></a>PaintJet XL300 / PaintJet XL properties</h4>
<blockquote>
<table cellpadding=0 cellspacing=0>
<tr valign=bottom>
<th align=left>Name
<td>
<th align=left>Type
<td>
<th align=left>
<tr> <td colspan=5><hr>
<tr valign=top> <td><b><tt>PrintQuality</tt></b>
<td>
<td><b><tt>int</tt></b>
<td>
<td>Mechanical print quality: -1 = fast, 0 = normal, 1 = presentation. Fast mode reduces ink usage and uses single-pass operation for some media types. Presentation uses more ink and the maximum number of passes, giving slowest printing for highest quality
<tr valign=top> <td><b><tt>RenderType</tt></b>
<td>
<td><b><tt>int</tt></b>
<td>
<td><dl compact>
<dt><b>0</b><dd>driver does dithering
<dt><b>1</b><dd>snap to primaries
<dt><b>2</b><dd>snap black to white, others to black
<dt><b>3</b><dd>ordered dither
<dt><b>4</b><dd>error diffusion
<dt><b>5</b><dd>monochrome ordered dither
<dt><b>6</b><dd>monochrome error diffusion
<dt><b>7</b><dd>cluster ordered dither
<dt><b>8</b><dd>monochrome cluster ordered dither
<dt><b>9</b><dd>user-defined dither (not supported)
<dt><b>10</b><dd>monochrome user-defined dither ns.
</dl>
</table>
<p>
The PaintJet (non-XL) has no additional properties.
</blockquote>
<h3><a name="HP_gamma"></a>Gamma correction</h3>
<p>
One consequence of using Floyd-Steinberg dithering rather than Ghostscript's
default clustered ordered dither is that it is much more obvious that the
ink dots are rather larger on the page than their nominal 1/180-inch or 1/300-inch
size (clustering the dots tends to minimise this effect). Thus it is often
the case that the printed result is rather too dark. A simple empirical
correction for this may be achieved by preceding the actual PostScript
file to be printed by a short file which effectively sets the gamma for
the device, such as
<blockquote><b><tt>
gs ... gamma.ps colorpic.ps -c quit
</tt></b></blockquote>
<p>
where <b><tt>gamma.ps</tt></b> is
<blockquote>
<pre>%!
/.fixtransfer {
currentcolortransfer 4 {
mark exch
dup type dup /arraytype eq exch /packedarraytype eq or
1 index xcheck and { /exec load } if
0.333 /exp load
] cvx 4 1 roll
} repeat setcolortransfer
} bind odef
.fixtransfer
/setpagedevice { setpagedevice .fixtransfer } bind odef</pre>
</blockquote>
<p>
This does the gamma correction <b><em>after</em></b> whatever correction
the device might be doing already. To do the correction
<b><em>before</em></b> the current correction,
<blockquote>
<pre>%!
/.fixtransfer {
currentcolortransfer 4 {
mark 0.333 /exp load 4 -1 roll
dup type dup /arraytype eq exch /packedarraytype eq or
1 index xcheck and { /exec load } if
] cvx 4 1 roll
} repeat setcolortransfer
} bind odef
.fixtransfer
/setpagedevice { setpagedevice .fixtransfer } bind odef</pre>
</blockquote>
<p>
This example sets the gamma for R, G, and B to 3, which seems to work
reasonably well in practice.
<h3><a name="HP_resolution_enhance"></a>HP's resolution-enhanced mode for Inkjet printers</h3>
<p>
This feature is available on HP's more recent inkjet printers, including
the DeskJet 520 (mono), 540 (mono or colour) and 560C (mono and colour).
The colour and monochrome drivers for the HP DeskJet 550c are (probably)
the best you will get for use with Ghostscript, for the following reasons.
<p>
These printers do not offer true 600×300dpi resolution. Those that
print in colour are strictly 300×300dpi in colour mode, while in mono
mode there is a pseudo 600×300dpi mode with the restriction that you
can't print two adjacent dots. In effect what you have is 600dpi dot
positioning, but on average you don't get more dots per line. This
provides the possibility, for instance, to have sharper character outlines,
because you can place dots on the edges nearer to their ideal positions.
This is why it is worth doing.
<p>
However, HP will not support user-level programming of this
resolution-enhanced mode, one reason being that (I understand) all the dot
spacing has to be done by the driver, and if you get it wrong, you can
actually damage the print head.
<p>
To summarise, you may lose a smidgin of (potential) text clarity using the
550c drivers (<b><tt>cdj550</tt></b>, <b><tt>cdjcolor</tt></b>,
<b><tt>cdjmono</tt></b> etc.), but other than that, they are the ones for
the job.
<h3><a name="HP_tips"></a>General tips</h3>
<p>
For all the printers above, the choice of paper is critically important to
the final results. The printer manuals suggest type of paper, but in
general, smoother, less fibrous types give better results. In particular,
the special ink-jet paper can make a big difference: colours are brighter,
but most importantly, there is almost no colour bleed, even with adjacent
areas of very heavy inking. Similarly the special coated transparencies
also work well (and ordinary transparencies do not work at all!).
<p>
The Unix procedure <a href="Unix-lpr.htm"><b><tt>unix-lpr.sh</tt></b></a>
provides one example of setting up a multi-option colour PostScript
<b><tt>lpr</tt></b> queue on Unix systems, and includes the ability to
choose a range of different colour options and printer accounting and error
logging.
<p>
<b>Caveat emptor!</b> It is not always easy for me to test all of these
drivers, as the only colour printer I have here is the DeskJet 500C. I rely
on others to test drivers for the additional machines and report their
findings back to me.
<hr>
<h2><a name="BJC_8200"></a>Canon BJC-8200 printer</h2>
<p>
This section was contributed by the author of the <b><tt>uniprint</tt></b>
configuration files for the Canon BJC-8200, Stephan C. Buchert <<a
href="mailto:scb@stelab.nagoya-u.ac.jp">scb@stelab.nagoya-u.ac.jp</a>>.
These files also handle the Japanese Canon F850 printer.
<p>
Warning: Usage of this program is neither supported nor endorsed by
the Canon corporation. Please see the Ghostscript <a
href="Public.htm">license</a> regarding warranty.
<h3>Introduction</h3>
<p>
The Canon Bubble Jet printer BJC-8200 is designed for printing digital
photos and halftone images. Software drivers for Windows 95-2000 and Mac are
usually included and can be downloaded from the Canon web sites like
<a href="http://consumer.usa.canon.com/bjc/bjc8200/">http://consumer.usa.canon.com/bjc/bjc8200/</a>
for the US market. If these drivers cannot be used for some reason, then at
present Ghostscript is probably the alternative giving the best results.
<p>
The BJC-8200 has features not found among the specs of earlier bubble jet
models (except the even more advanced BJC-8500) and is advertised to offer:
<ol>
<li>microfine droplet technology;
<li>support for printing on a new type of paper, Photo Paper Pro;
<li>a printhead capable of printing up to 1200 DpI;
<li>individual ink tanks for 6 colors;
<li>an internal status monitor reporting low ink back to a driver;
<li>an optional color scanner cartridge for up to 600 DpI resolution.
</ol>
<p>
Access to features 5 and 6 requires use of the original Canon drivers for
the foreseeable future. This README is about getting the printer features
1-3 working with Ghostscript. No (re)compilation of Ghostscript is normally
required.
<p>
Ghostscript comes with a relatively highly configurable driver, called
<a href="#Uniprint">uniprint</a>, for printers which understand raster
images in various propriety formats. Most options for this driver are
usually organized into files having the suffix ".upp." Ghostscript
versions >= 5.10 (or even earlier) include such uniprint control files
for the Canon BJC-610. They work also well for some other Canon Bubble
Jet models, for example for my BJC-35vII. But when using them for a
BJC-8200 the result is unsatisfactory.
<h3>The uniprint control files for the BJC-8200</h3>
<p>
After some experimenting with the options for uniprint I have obtained quite
satisfactory prints with my printer(*). This distribution includes six new
uniprint control files:
<ul>
<li>bj8pp12f.upp
<li>bj8hg12f.upp
<li>bj8gc12f.upp
<li>bj8oh06n.upp
<li>bj8ts06n.upp
<li>bj8pa06n.upp
</ul>
<p>
They are included in Ghostscript >=6.21. For older versions you can put
them anywhere in the Ghostscript search path (type "gs -h" to see the
path), but should perhaps add the files to the directory with the
other *.upp files. This is "/usr/share/ghostscript/gs6.01/lib" in my
RedHat 6.1 Linux box with Aladdin Ghostscript 6.01.
<p>
Here is an explanation of my file name convention: the prefix "bj8" should
perhaps be used for the Canon BJC-8200 and compatible (like the Japanese
F850 and perhaps the non-Japanese BJC-8500) models. The next two letters
indicate the print media:
<ul>
<li>pp "Photo Paper Pro"
<li>hg "High Gloss Photo Film"
<li>gc "Glossy Photo Cards"
<li>oh "OHP transparencies"
<li>ts "T-shirt transfer"
<li>pa "Plain Paper"
</ul>
<p>
The numbers at positions 6 and 7 indicate the resolution
<ul>
<li>12 1200x1200 DpIxDpI
<li>06 600x600 DpIxDpI
</ul>
<p>
The last letter stands for a quality factor that effects also the print
speed (presumably related to the number of passes that the printhead makes).
<ul>
<li>f highest quality
<li>n normal quality
</ul>
<p>
Printing a postcard size (~10x15 cm^2) image at 1200x1200 DpI^2 takes about
3 minutes. The output of Ghostscript is then typically 4-5 MByte. The
bootleneck seems to be the transfer of the raster image in run-length
encoded Canon format to the printer (via the parallel port on my system) or
the printer's speed, not Ghostscript or the uniprint renderer.
<h3>Further Optimization for the Canon BJC-8200</h3>
So far I have only experimented with the printer initialization code at the
beginning of each page (-dupBeginPageCommand) and the resolution (-r). Other
options, particularly the transfer arrays (-dupBlackTransfer,
-dupCyanTransfer, -dupMagentaTransfer, -dupYellowTransfer) and the margins
(-dupMargins) were simply copied from the files for the BJC-610, but they
may need to be changed for optimized performance.
<p>
Here is information useful for changing or adding uniprint control files for
the BJC-8200:
<p>
In "-dupBeginPageCommand=..." use the line
<blockquote>
1b28 64 0400 04b0 04b0
</blockquote>
<p>
for 1200x1200 resolution, and
<blockquote>
1b28 64 0400 0258 0258
</blockquote>
<p>
for 600x600. The "-r" option in the control file must of course match this
line. Other resolutions might work as well, but I didn't try.
<p>
Crucial are the numbers in the lines like
<blockquote><pre>
1b28 63 0300 3005 04
^ ^
Plain Paper 0 4 Highest quality
OHP transparency 2 .
T-shirt transfer 3 .
Glossy Photo Film 5 .
High Gloss Paper 6 0 Lowest quality
Photo Paper Pro 9
</pre></blockquote>
<h3>Outlook</h3>
<p>
Presently uniprint can use the black (K), cyan (C), magenta (M), and
yellow (Y) colors in the BJC-8200. The unused colors are photo (or
light) cyan (c) and magenta (m). Also the Canon driver seems to use
only CMYK, for example when printing on Photo Paper Pro in "Camera" or
"SuperPhoto" mode. These modes supposedly produce prints of the best
quality that the Canon driver can offer. Other modes of Canon driver
do use up to all six color cartridges (CMYKcm). Therefore expanding
uniprint's capabilities for six colors would be interesting, but it may
not increase the output quality of 6-color printers such as the
BJC-8200 drastically.
<p>
More control files for uniprint could be added in order to offer more
versatility for controlling the BJC-8200 within a Ghostscript
installation. The number of possible combinations for media type, resolution
and print quality factor is very large, many combinations would not make
much sense, many might be used here and there, but relatively rarely. The
user would have to remember a name for each combination that is used.
<p>
A better way would be to let the user patch optionally a user owned or
system wide uniprint control file before each print via some print
tool. This is similar to the approach taken by Canon with their driver for
Windows. Similarly a uniprint tool could also incorporate other functions
such as printing test and demo pages and the low ink warning once the
protocol for this is known. Clearly it would be difficult to code such a
uniprint tool for all the platforms where Ghostscript is running.
<h3>Usage on RedHat Linux</h3>
<p>
In order to install a BJC-8200 printer on a RedHat Linux system with
RedHat's printtool, you need also to insert with a text editor the contents
of the file <b><tt>bj8.rpd</tt></b> into the RedHat printer database
<b><tt>/usr/lib/rhs/rhs-printfilters/printerdb</tt></b>. Insert it most
appropriately after the section
<blockquote><pre>
StartEntry: U_CanonBJC610
.
.
.
EndEntry
< --- insert here "bj8.rpd" from this distribution:
< --- StartEntry: U_CanonBJC8200
.
.
.
</pre></blockquote>
<h3>Contacting the Author</h3>
<p>
E-mail address: <<a
href="mailto:scb@stelab.nagoya-u.ac.jp">scb@stelab.nagoya-u.ac.jp</a>>
<p>
Footnotes:
<p>
(*) Actually I have a F850, not a BJC-8200. That model is sold for the
Japanese market only. The specs and also the external look are the
same as those of the BJC-8200 models for the American and European
markets. I expect that the raster image mode which is used exclusively
by Ghostscript is entirely compatible for both models.
<p>
Stephan C. Buchert
<hr>
<h2><a name="BJC"></a>Other Canon BubbleJet (BJC) printers</h2>
<p>
This section was contributed by the author of the drivers, Yves Arrouye
(<<a href="mailto:yves.arrouye@usa.net">yves.arrouye@usa.net</a>>, but
please do not send questions to him: he no longer maintains these drivers.)
The drivers handle Canon BJC-600, BJC-4xxx, BJC-70, Stylewriter 2x00, and
BJC-800 printers.
<h3><a name="BJC_history"></a>History</h3>
<p>
The BJC-600 driver was written in the first place by Yoshio Kuniyoshi and
later modified by Yves Arrouye. We tried to make it evolve synchronously,
though Yoshio cannot be reached since a long time ago. The drivers are
based on code for the HP printers by George Cameron (in fact, they are in
the same file!), so he's the first person to thank.
<p>
The 2.00 version of the drivers was a complete rewrite of the driver
(arguments, optimization, colour handling, in short: everything!) by Yves
Arrouye. That release was also the first one to be able to use the full
width of an A3 paper size. PostScript Printer Description (PPD) files for
the drivers were released with version 2.15. They are incomplete,
but they can be used to drive the printers' main features.
<h3><a name="BJC_build"></a>Configuring and building the BJC drivers</h3>
<h4><a name="BJC_defaults"></a>Modify values in
<b><tt>gdevbjc.h</tt></b></h4>
<p>
Configure the drivers by modifying the default values in the file
<b><tt>gdevbjc.h</tt></b> or on the compilation line. If you don't do
that, the drivers use reasonable defaults that make them work "as
expected". All default values shown here are defined in that file.
<h4><a name="BJC_CMYK_RGB"></a>CMYK-to-RGB color conversion</h4>
<p>
By default, the drivers use the same algorithm as Ghostscript to convert
CMYK colors to RGB. If you prefer to use Adobe formulas, define
<b><tt>USE_ADOBE_CMYK_RGB</tt></b> when compiling. (See the top of the
file <b><tt>gdevcdj.c</tt></b> to see the difference between the two.)
<h4><a name="BJC_vertical_centering"></a>Vertical centering of the
printable area</h4>
<p>
The drivers center the imageable area horizontally but not vertically, so
that what can be printed does use the most of the output media. If you
define <b><tt>BJC_DEFAULT_CENTEREDAREA</tt></b> when compiling, then the
top and bottom margins will be the same, resulting in a (smaller)
vertically centered imageable area also.
<h4><a name="BJC_margins"></a>Page margins</h4>
<p>
If you define <b><tt>USE_RECOMMENDED_MARGINS</tt></b>, then the top and
bottom margins will be the same (that is,
<b><tt>BJC_DEFAULT_CENTEREDAREA</tt></b> will be defined for you) and the
margins will be the 12.4mm recommended by Canon. Since margins are
complicated (because one must rely on the mechanical precision of the
printer), the drivers do something about the bottom margin: by default the
bottom margin is 9.54mm for the BJC-600 driver and 7mm for the BJC-800. If
you define <b><tt>USE_TIGHT_MARGINS</tt></b>, then the bottom margin is 7mm
for both drivers (but I never managed to get my own BJC-600 to print a line
on this low bound, hence the larger default). Regardless of the presence
of this definition, <b><tt>USE_FIXED_MARGINS</tt></b> will not allow the
BJC-800 to use the lower 7mm bottom margin, so if you have a problem with
the bottom margin on a BJC-800, just define that (without defining
<b><tt>USE_TIGHT_MARGINS</tt></b>, of course).
<p>
A quick way to be sure the margins you selected is to print a file whose
contents are:
<blockquote><b><tt>
%!<br>
clippath stroke showpage
</tt></b></blockquote>
<p>
If the margins are okay, you will get a rectangle visibly surrounding
the printable area. If they're not correct, one or more of the sides will
be either incomplete or completely unprinted.
<h4><a name="BJC_compile"></a>Makefile and compilation</h4>
<p>
Make sure the <b><tt>bjc600</tt></b> or <b><tt>bjc800</tt></b> devices are
in <a href="Make.htm#Features_and_devices"><b><tt>DEVICE_DEVS</tt></b> in
the makefile</a>; that is, look in the makefile for your platform and add
them if necessary -- they may already be there. As of Ghostscript 5.10,
for instance, one makefile has
<blockquote><b><tt>
DEVICE_DEVS6=bj10e.dev bj200.dev bjc600.dev bjc800.dev
</tt></b></blockquote>
<h3><a name="BJC_usage"></a>Use of the drivers</h3>
<p>
There are two drivers here. The "<b><tt>bjc600</tt></b>" one supports the BJC-600 and
BJC-4xxx (maybe the BJC-70 as well) and the "<b><tt>bjc800</tt></b>" one supports the
BJC-800 series. Remarks here that apply to both drivers use the name
"bjc".
<h4><a name="BJC_options"></a>Supported Options and Defaults</h4>
<p>
Note: "options", "properties", and "parameters" designate the same thing:
device parameters that you can change.
<p>
Giving an option an incorrect value causes an error. Unless stated
otherwise, this error will be a rangecheckerror. Options may be set from
the Ghostscript command line (using the <b><tt>-d</tt></b> and
<b><tt>-s</tt></b> switches or other predetermined switches if they have an
effect on the driver) or using the PostScript Level 2
<b><tt>setpagedevice</tt></b> operator if Ghostscript has been compiled
with the <b><tt>level2</tt></b> or <b><tt>level3</tt></b> device (which it should
<b><tt>;-)</tt></b>). There are <b>no</b> special-purpose operators such as
one was able to find in Level 1 printers.
<p>
The bjc uses 24 bits per pixel by default (unless you change the value of
<b><tt>BJC_BITSPERPIXEL</tt></b>), corresponding to CMYK printing.
Supported modes are 1 bpp and 4 bpp (gray levels), 8 bpp, 16 bpp, 24 bpp
and 32 bpp (colours). Colours are preferably stored in the CMYK model
(which means, for example, that with 16 bpp there are only 16 different
shades of each color) but it is possible to store them as RGB color for
some depths. Some modes do Floyd-Steinberg dithering and some don't, but
use the default Ghostscript halftoning (in fact, when halftoning is used,
dithering takes also place but because of the low point density it is
usually not efficient, and thus invisible).
<blockquote><table cellpadding=0 cellspacing=0>
<tr><th colspan=5 bgcolor="#CCCC00"><hr><font size="+1">Descriptions of printing modes by bpp and <b><tt>Colors</tt></b></font><hr>
<tr valign=bottom>
<th align=left>bpp
<td>
<th align=left><b><tt>Colors</tt></b>
<td>
<th align=left>Mode
<tr> <td colspan=5><hr>
<tr valign=top> <td>32
<td>
<td align=center>4
<td>
<td>CMYK colour printing, Floyd-Steinberg dithering
<tr valign=top> <td>24
<td>
<td align=center>4
<td>
<td>The same. (But each primary colour is stored on 6 bits instead of 8.)
<tr valign=top> <td>24
<td>
<td align=center>3
<td>
<td>RGB colour printing, Floyd-Steinberg dithering. This mode does
<b><tt>not</tt></b> use the black cartridge (that's why it
exists, for when you don't want to use it <b><tt>;-)</tt></b>).
Each primary colour is stored in 8 bits as in the 32/4 mode,
but black generation and under-color removal are done on the
driver side and not by Ghostscript, so you have no control over
it. (This mode is no longer supported in this driver.)
<tr valign=top> <td>16
<td>
<td align=center>4
<td>
<td>CMYK colour printing, halftoned by Ghostscript. F-S dithering
is still visible here (but the halftone patterns are visible
too!).
<tr valign=top> <td>8
<td>
<td align=center>4
<td>
<td>The same. (But each primary colour is stored in 2 bits instead of 4.)
<tr valign=top> <td>8
<td>
<td align=center>3
<td>
<td>RGB colour printing. This mode is not intended for use. What I
mean is that it should be used only if you want to use custom
halftone screens <b>and</b> the halftoning is broken using the
8/4 mode (some versions of Ghostscript have this problem).
<tr valign=top> <td>8
<td>
<td align=center>1
<td>
<td>Gray-level printing, Floyd-Steinberg dithering
<tr valign=top> <td>1
<td>
<td align=center>1
<td>
<td>Gray-level printing halftoned by Ghostscript
</table></blockquote>
<p>
These modes are selected using the <b><tt>BitsPerPixel</tt></b> <b>and</b>
<b><tt>Colors</tt></b> integer options (either from the command line or in
a PostScript program using <b><tt>setpagedevice</tt></b>). See below.
<p>
A note about darkness of what is printed: Canon printers do print dark,
really. And the Floyd-Steinberg dithering may eventually darken your image
too. So you may need to apply gamma correction by calling Ghostscript as in
<blockquote><b><tt>
gs -sDEVICE=bjc600 gamma.ps myfile.ps
</tt></b></blockquote>
<p>
where <b><tt>gamma.ps</tt></b> changes the gamma correction (here to 3 for
all colors); 0.45 gives me good results, but your mileage may vary. The
bigger the value the lighter the output:
<blockquote><b><tt>
{ 0.45 exp } dup dup currenttransfer setcolortransfer
</tt></b></blockquote>
<p>
The drivers support printing at 90dpi, 180dpi and 360dpi. Horizontal and
vertical resolutions must be the same or a limitcheck error will happen. A
rangecheck will happen too if the resolution is not
90 ×2^<small><sup><b>N</b></sup></small>. If the driver
is compiled with <b><tt>-DBJC_STRICT</tt></b> a rangecheck also happens if
the resolution is not one of those supported. This is not the case, as we
expect that there may be a 720dpi bjc some day.
<p>
Here are the various options supported by the bjc drivers, along with
their types, supported values, effects, and usage:
<dl>
<dt><b><tt>BitsPerPixel</tt></b> (int)
<dd>Choose the depth of the page. Valid values are 1, 8, 16, 24 (the
default) and 32.
<p>
Note that when this is set for the first time, the <b><tt>Colors</tt></b>
property is automatically adjusted unless it is also specified. The table
here shows the corresponding color models and the rendering method visible:
"GS" for Ghostscript halftoning and "F-S" for Floyd-Steinberg dithering.
When both are present it means that the dithering of halftones is visible.
Default choices are indicated by asterisk "*".
<blockquote><table cellpadding=0 cellspacing=0>
<tr><th colspan=9 bgcolor="#CCCC00"><hr><font size="+1">Valid <b><tt>Colors</tt></b> values for<br>allowed <b><tt>BitsPerPixel</tt></b> values
</font><hr>
<tr valign=bottom>
<th align=left>bpp
<td>
<th align=left><b><tt>Colors</tt></b>
<td>
<th align=left>
<td>
<th align=left>Color model
<td>
<th align=left>Dithering
<tr> <td colspan=9><hr>
<tr valign=top> <td>32
<td>
<td align=center>4
<td>
<td>
<td align=center>
<td>CMYK
<td>
<td>F-S
<tr valign=top> <td>24
<td>
<td align=center>4
<td>
<td><b>*</b>
<td align=center>
<td>CMYK
<td>
<td>F-S
<tr valign=top> <td>
<td>
<td align=center>3
<td>
<td>
<td align=center>
<td>RGB
<td>
<td>F-S
<tr valign=top> <td>16
<td>
<td align=center>4
<td>
<td>
<td align=center>
<td>CMYK
<td>
<td>GS, F-S
<tr valign=top> <td>8
<td>
<td align=center>4
<td>
<td><b>*</b>
<td align=center>
<td>CMYK
<td>
<td>GS
<tr valign=top> <td>
<td>
<td align=center>3
<td>
<td>
<td align=center>
<td>RGB
<td>
<td>GS
<tr valign=top> <td>
<td>
<td align=center>1
<td>
<td>
<td align=center>
<td>K (CMYK)
<td>
<td>F-S
<tr valign=top> <td>1
<td>
<td align=center>1
<td>
<td><b>*</b>
<td align=center>
<td>K (CMYK)
<td>
<td>GS
</table></blockquote>
<p>Also note that automagical change of one parameter depending on the
other one does not work in a <b><tt>setpagedevice</tt></b> call. This
means that if you want to change <b><tt>BitsPerPixel</tt></b> to a value
whose valid <b><tt>Colors</tt></b> values do not include the actual
<b><tt>Colors</tt></b> value, you must change <b><tt>Colors</tt></b> too.
</dl>
<dl>
<dt><b><tt>Colors</tt></b> (int)
<dd>Choose the number of color components from among 1, 3 and 4 (the
default). This setting cannot be used in a PostScript program, only on
Ghostscript's command line. See <b><tt>ProcessColorModel</tt></b> below
for what to use to change the number of colors with PostScript code.
<p>
Note that setting this property does limit the choices of
<b><tt>BitsPerPixel</tt></b>. As for the previous property, its first
setting may induce a setting of the "other value"
(<b><tt>BitsPerPixel</tt></b> here). The table here indicates valid
combinations with "V", default values with asterisk "*".
<blockquote><table cellpadding=0 cellspacing=0>
<tr><th colspan=13 bgcolor="#CCCC00"><hr><font size="+1">Valid <b><tt>BitsPerPixel</tt></b> values<br>for allowed <b><tt>Colors</tt></b> values</font><hr>
<tr valign=top> <td>
<td>
<td>
<td>
<th align=left colspan=9><b><tt>BitsPerPixel</tt></b> OK values<hr>
<tr valign=top> <th>Colors
<td>
<th>Type
<td>
<td>32
<td>
<td>24
<td>
<td>16
<td>
<td>8
<td>
<td>1
<tr> <td colspan=13><hr>
<tr valign=top> <td>4
<td>
<td>CMYK
<td>
<td><b>V</b>
<td>
<td><b>*</b>
<td>
<td><b>V</b>
<td>
<td><b>V</b>
<td>
<td>
<tr valign=top> <td>3
<td>
<td>RGB
<td>
<td>
<td>
<td><b>*</b>
<td>
<td>
<td>
<td><b>V</b>
<td>
<td>
<tr valign=top> <td>1
<td>
<td>K
<td>
<td>
<td>
<td>
<td>
<td>
<td>
<td><b>V</b>
<td>
<td><b>*</b>
</table></blockquote>
<p>Also note that automagical change of one parameter depending on the
other one does not work in a <b><tt>setpagedevice</tt></b> call. This
means that if you want to change <b><tt>Colors</tt></b> to a value whose
valid <b><tt>BitsPerPixel</tt></b> values don't include the actual
<b><tt>BitsPerPixel</tt></b> value, you must change
<b><tt>BitsPerPixel</tt></b> too.
</dl>
<dl>
<dt><b><tt>ProcessColorModel</tt></b> (symbol)
<dd>A symbol taken from <b><tt>/DeviceGray</tt></b>,
<b><tt>/DeviceRGB</tt></b> or <b><tt>/DeviceCMYK</tt></b> which can be used
to select 1, 3 or 4 colors respectively. Note that this parameter takes
precedence over <b><tt>Colors</tt></b>, and that both affect the same
variable of the driver. (See <b><tt>Colors</tt></b> above for values
combined with <b><tt>BitsPerPixel</tt></b>.)
</dl>
<dl>
<dt><b><tt>HWResolution</tt></b> (floats array)
<dd>An array of two floats giving the horizontal and vertical resolution in
dots per inch from among 90, 180 and 360 (the default). Both values must
be the same. On the Ghostscript command line, the resolution may be
changed with the <a href="Use.htm#Resolution_switch"><b><tt>-r</tt></b>
switch</a>.
</dl>
<dl>
<dt><b><tt>ManualFeed</tt></b> (bool)
<dd>Indicate that the sheets won't be fed automatically by the printer,
<b><tt>false</tt></b> by default. (Not meaningful on the BJC-600, I fear.)
</dl>
<dl>
<dt><b><tt>MediaType</tt></b> (string)
<dd>The media to print on, chosen from among "<b><tt>PlainPaper</tt></b>",
"<b><tt>CoatedPaper</tt></b>", "<b><tt>TransparencyFilm</tt></b>",
"<b><tt>Envelope</tt></b>", "<b><tt>Card</tt></b>" and
"<b><tt>Other</tt></b>". Default is "<b><tt>PlainPaper</tt></b>". For
"<b><tt>Envelope</tt></b>", "<b><tt>Card</tt></b>" or
"<b><tt>Other</tt></b>" the driver puts the printer into thick mode
automatically regardless of the actual media weight.
</dl>
<dl>
<dt><b><tt>MediaWeight</tt></b> (int or null)
<dd>The weight of the media in grams per square meter. Null (the default)
indicates that the weight is of no importance. If the specified media
weight is greater than 105 (that is, the value of the compilation default
<b><tt>BJC</tt></b>???<b><tt>_MEDIAWEIGHT_THICKLIMIT</tt></b>) then the
printer will be set to use thick paper.
</dl>
<dl>
<dt><b><tt>PrintQuality</tt></b> (string)
<dd>The quality of printing.
<table cellpadding=0 cellspacing=0>
<tr valign=bottom>
<th align=left>Value
<td>
<th align=left><b><tt>bjc600</tt></b>
<td>
<th align=left><b><tt>bjc800</tt></b>
<td>
<th align=left>
<tr> <td colspan=7><hr>
<tr valign=top> <td><b><tt>Low</tt></b>
<td>
<td>
<td>
<td align=center><b>X</b>
<td>
<td>Has the effect of making only two printing passes instead of four, so should be twice the speed; known as "CN" (Color Normal) mode
<tr valign=top> <td><b><tt>Draft</tt></b>
<td>
<td align=center><b>X</b>
<td>
<td align=center><b>X</b>
<td>
<td>Unlights the "HQ" light on a BJC-600
<tr valign=top> <td><b><tt>Normal</tt></b>
<td>
<td align=center><b>X</b>
<td>
<td align=center><b>X</b>
<td>
<td>Default for both drivers; lights the "HQ" light on a BJC-600
<tr valign=top> <td><b><tt>High</tt></b>
<td>
<td align=center><b>X</b>
<td>
<td align=center><b>X</b>
<td>
<td>Means 200% black and 100% CMY; lights the "Bk+" light on a BJC-600
</table>
</dl>
<dl>
<dt><b><tt>DitheringType</tt></b> (string)
<dd>Dithering algorithm from between "<b><tt>Floyd-Steinberg</tt></b>" and
"<b><tt>None</tt></b>". "<b><tt>None</tt></b>" is the default for 1/1 print
mode, "<b><tt>Floyd-Steinberg</tt></b>" for other modes. At the moment
this parameter is read-only, though no error is generated if one tries to
change it. This parameter is not of much value at the moment and is here
mainly to reserve the name for future addition of dithering algorithms.
</dl>
<dl>
<dt><b><tt>PrintColors</tt></b> (int)
<dd>Mask for printing color. If 0, use black for any color; otherwise the
value must be the sum of any of 1 (cyan), 2 (magenta), 4 (yellow) and 8
(black), indicating which colors will be used for printing. When printing
colour, only colours specified will be printed (this means that some planes
will be missing if a color's value above is omitted). When printing grays,
black is used if it is present in the <b><tt>PrintColors</tt></b>;
otherwise, the image is printed by superimposing each requested color.
</dl>
<dl>
<dt><b><tt>MonochromePrint</tt></b> (bool)
<dd><b>For <tt>bjc600</tt> only</b>, <b><tt>false</tt></b> by default.
Substitute black for Cyan, Magenta and Yellow when printing -- useful, for
example, to get some monochrome output of a dithered printing This is a
hardware mechanism as opposed to the previous software one. I think that
using this or setting <b><tt>PrintColors</tt></b> to 0 will give the same
results.
</dl>
<p>
Note that the <b><tt>MediaType</tt></b> and <b><tt>ThickMedia</tt></b>
options will be replaced by the use of the device
<b><tt>InputAttributes</tt></b> and <b><tt>OutputAttributes</tt></b> as
soon as possible. Please note too that the print mode may be reset at the
start of printing, not at the end. This is the expected behaviour. If you
need to reset the printer to its default state, simply print a file that
does just a <b><tt>showpage</tt></b>.
<h4><a name="BJC_device_info"></a>Device information</h4>
<p>
Here is other information published by the driver that you will find
in the <b><tt>deviceinfo</tt></b> dictionary.
<dl>
<dt><b><tt>OutputFaceUp</tt></b> (bool)
<dd>This has the boolean value <b><tt>true</tt></b>, indicating that the
sheets are stacked face up.
</dl>
<dl>
<dt><b><tt>Version</tt></b> (float)
<dd>In the form <b>M.</b><em>mm</em>pp, where <b>M</b> is the major
version, <em>mm</em> the bjc driver's minor version, and pp the specific
driver minor version (that is, <b><tt>M.</tt></b><em>mm</em> will always be
the same for the <b><tt>bjc600</tt></b> and <b><tt>bjc800</tt></b>
drivers).
</dl>
<dl>
<dt><b><tt>VersionString</tt></b> (string)
<dd> A string showing the driver version and other indications. At the
moment, things like "a" or "b" may follow the version to indicate alpha or
beta versions. The date of the last change to this version is given in the
form MM/DD/YY (no, it won't adapt to your locale).
</dl>
<h4><a name="BJC_HW_margins"></a>Hardware margins</h4>
<p>
The BJC printers have top and bottom hardware margins of 3mm and 7.1mm
respectively (Canon says 7mm, but this is unusable because of the rounding
of paper sizes to PostScript points). The left margin is 3.4mm for A4 and
smaller paper sizes, 6.4mm for U.S. paper sizes, envelopes and cards. It
is 4.0mm for A3 paper on the BJC-800.
<p>
The maximum printing width of a BJC-600 printer is 203mm. The maximum
printing width of a BJC-800 printer is 289mm on A3 paper, 203mm on
U.S. letter and ISO A4 paper.
<h4><a name="BJC_PPD"></a>PostScript printer description (PPD) files</h4>
<p>
The files <b><tt>CBJC600.PPD</tt></b> and <b><tt>CBJC800.PPD</tt></b> (whose
long names are, respectively, <b><tt>Canon_BubbleJetColor_600.ppd</tt></b>
and <b><tt>Canon_BubbleJetColor_800.ppd</tt></b>) are PPD files to drive the
features of the <b><tt>bjc600</tt></b> and <b><tt>bjc800</tt></b> drivers.
They can be used, for example, on NextStep systems (presumably on OpenStep
systems too) and on Unix systems with Adobe's TranScript and
<b><tt>pslpr</tt></b> (not tested). The files are not complete at the
moment. Please note that NextStep's printing interface does not
correctly enforce constraints specified in these files (in UIConstraints
descriptions): you must force yourself to use valid combinations of
options.
<h4><a name="BJC_PPD_custom"></a>Customizing the PPD files</h4>
<p>
By default the PPD files are set for U.S. letter size paper, and they use a
normalized transfer function. If you choose to use A4 printing by default,
you must replace "<b><tt>Letter</tt></b>" with "<b><tt>A4</tt></b>" in
these (noncontiguous) lines:
<blockquote>
[...]<br>
<b><tt>*DefaultPageSize: Letter<br></tt></b>
[...]<br>
<b><tt>*DefaultRegion: Letter<br></tt></b>
[...]<br>
<b><tt>*DefaultImageableArea: Letter</tt></b><br>
[...]<br>
</blockquote>
<p>
Some versions of Ghostscript have problems with normalized colors, which
makes them add magenta in gray levels. If you experience this problem,
in the PPD file replace the line
<blockquote><b><tt>
*DefaultTransfer: Normalized
</tt></b></blockquote>
<p>
with the alternate line
<blockquote><b><tt>
*DefaultTransfer: Null
</tt></b></blockquote>
<p>
The "thick media" option is implemented by choosing a value of 120 or 80
(for thick and thin media respectively) for the <b><tt>MediaWeight</tt></b>
feature of the drivers. If you ever change the threshold for thick media
in the driver code, you may need to change the values in the PPD files too.
<p>
All customization should be done using the "<b><tt>*Include:</tt></b>"
feature of PPD files so that your local changes will be retained if you
update the PPD files.
<h3><a name="BJC_bugs"></a>How to report problems</h3>
<p>
Yves Arrouye no longer maintains this driver, and will not answer questions
about it. If you are posting a question about it in a public form, please
be as descriptive as possible, and please send information that can be used
to reproduce the problem. Don't forget to say which driver you use, and in
what version. Version information can be found in the source code of the
driver or by issuing the following command in a shell:
<blockquote><b><tt>
echo "currentpagedevice /VersionString get ==" | gs -q -sDEVICE=bjc600 -
</tt></b></blockquote>
<h3><a name="BJC_acks"></a>Acknowledgements</h3>
<p>
I am particularly grateful to Yoshio Kuniyoshi <<a
href="mailto:yoshio@nak.math.keio.ac.jp">yoshio@nak.math.keio.ac.jp</a>>
without whom I'd never make these drivers, and also to L. Peter Deutsch,
who answered all my (often silly) questions about Ghostscript's driver
interface.
<p>
Thanks also to the people who volunteered to beta-test the v2.x BJC
drivers: David Gaudine
<<a href="mailto:david@donald.concordia.ca">david@donald.concordia.ca</a>>,
Robert M. Kenney <<a href="mailto:rmk@unh.edu">rmk@unh.edu</a>>,
James McPherson
<<a href="mailto:someone@erols.com">someone@erols.com</a>>
and Ian Thurlbeck
<<a href="mailto:ian@stams.strath.ac.uk">ian@stams.strath.ac.uk</a>>
(listed alphabetically) were particularly helpful by discovering bugs and
helping find out exact paper margins on printers I don't have access to.
<p>
And many thanks to Klaus-Gunther Hess
<<a href="mailto:ghess@elmos.de">ghess@elmos.de</a>> for looking
at the dithering code and devising a good CMYK dithering algorithm for the
Epson Stylus Color, which I then adapted to the code of these drivers.
<hr>
<h2><a name="STC_epson_stylus"></a>Epson Stylus color printer (see also <b><tt>uniprint</tt></b>)</h2>
<p>
This section was contributed by Gunther Hess
<<a href="mailto:ghess@elmos.de">ghess@elmos.de</a>>, who also wrote
<b><tt>uniprint</tt></b>, a later set of drivers. You should probably see
the section on <a href="#Uniprint"><b><tt>uniprint</tt></b></a> for whether
it might be better for your uses than this driver.
<h3><a name="STC_usage"></a>Usage</h3>
<p>
This driver is selected with "<b><tt>-sDEVICE=stcolor</tt></b>", producing
output for an Epson Stylus Color at 360dpi resolution by default. But it
can do much more with this printer, and with significantly better quality,
than with the default mode; and it can also produce code for monochrome
versions of the printer. This can be achieved via either command-line
options or Ghostscript input. For convenience a PostScript file is
supplied for use as an initial input file. Try the following command:
<blockquote>
<b><tt>gs -sDEVICE=stcolor -r</tt></b><b>{Xdpi}</b><b><tt>x</tt></b><b>{Ydpi}</b><b><tt> stcolor.ps</tt></b> <b>{YourFile.ps}</b>
</blockquote>
<p>
where <b>{Xdpi}</b> is one of 180, 360, or 720 and <b>{Ydpi}</b> is one of
90, 180, 360, or 720. The result should be significantly better. You may
use <b><tt>stcolor.ps</tt></b> with other devices too, but I do not
recommend this, since it does nothing then. <b><tt>stcolor.ps</tt></b>
should be available with binary distributions and should reside in the same
directory as other Ghostscript initialization files or in the same
directory as the files to be printed. Thus if Ghostscript is part of your
printer-spooler, you can insert
<blockquote><b><tt>
(stcolor.ps) findlibfile { pop run } if pop
</tt></b></blockquote>
<p>
in files you want to use the improved algorithms. You may want to adapt
<b><tt>stcolor.ps</tt></b> file to your specific needs. The methods and
options for this are described here, but this description is restricted to
Ghostscript options, while their manipulation at the PostScript level is
documented in the material on <a href="Language.htm">the relationship of
Ghostscript and PostScript</a> and in <b><tt>stcolor.ps</tt></b>.
<h3><a name="STC_options"></a>Options</h3>
<p>
Now to explain the options (as written on my UNIX system). The order is
somehow related to their use during the printing process:
<dl>
<dt><b><tt>-dUnidirectional</tt></b>
<dd>Force unidirectional printing, recommended for transparencies
</dl>
<dl>
<dt><b><tt>-dMicroweave</tt></b>
<dd>Enable the printer's "microweave" feature; see
"<a href="#What_is_weaving">What is weaving?</a>" below.
</dl>
<dl>
<dt><b><tt>-dnoWeave</tt></b>
<dd>Disable any Weaving (overrides <b><tt>-dMicroweave</tt></b>)
</dl>
<dl>
<dt><b><tt>-dSoftweave</tt></b>
<dd>Enable the driver's internal weaving. Note that <b><tt>Softweave</tt></b> works <b>only</b> with the original Stylus Color and the PRO-Series.
</dl>
<dl>
<dt><b><tt>-sDithering=</tt></b><em>{name}</em>
<dd>Select another dithering algorithm (name) from among
<blockquote><table cellpadding=0 cellspacing=0>
<tr valign=top> <td><b><tt>gscmyk</tt></b>
<td>
<td>fast color output, CMYK process color model (default)
<tr valign=top> <td><b><tt>gsmono</tt></b>
<td>
<td>fast monochrome output
<tr valign=top> <td><b><tt>gsrgb</tt></b>
<td>
<td>fast color output, RGB process color model
<tr valign=top> <td><b><tt>fsmono</tt></b>
<td>
<td>Floyd-Steinberg, monochrome
<tr valign=top> <td><b><tt>fsrgb</tt></b>
<td>
<td>Floyd-Steinberg, RGB process color model (almost identical to the <b><tt>cdj550</tt></b>/<b><tt>bjc</tt></b> algorithm)
<tr valign=top> <td><b><tt>fsx4</tt></b>
<td>
<td>Floyd-Steinberg, CMYK process color model (shares code with <b><tt>fsmono</tt></b> and <b><tt>fsrgb</tt></b>, but is algorithmically really bad)
<tr valign=top> <td><b><tt>fscmyk</tt></b>
<td>
<td>Floyd-Steinberg, CMYK process color model and proper modifications for CMYK
<tr valign=top> <td><b><tt>hscmyk</tt></b>
<td>
<td>modified Floyd-Steinberg with CMYK model ("hs" stands for "hess" not for "high speed", but the major difference from <b><tt>fscmyk</tt></b> is speed)
<tr valign=top> <td><b><tt>fs2</tt></b>
<td>
<td>algorithm by Steven Singer (RGB) should be identical to <b><tt>escp2cfs2</tt></b>.
</table></blockquote>
</dl>
<dl>
<dt><b><tt>-dBitsPerPixel=</tt></b><em>{1...32}</em>
<dd>number of bits used for pixel storage; the larger the value, the better
the quality -- at least in theory. In <b><tt>fsrgb</tt></b> one can gain
some speed by restricting to 24 bits rather than the default 30.
</dl>
<dl>
<dt><b><tt>-dFlag0</tt></b>
<dd>causes some algorithms to select a uniform initialisation rather than a
set of random values. May yield a sharper image impression at the cost of
dithering artifacts. (Applies to <b><tt>hscmyk</tt></b> and all fs modes,
except for fs2, which always uses a constant initialization.)
</dl>
<dl>
<dt><b><tt>-dFlag1</tt></b> ... <b><tt>-dFlag4</tt></b>
<dd>Available for future algorithms.
</dl>
<dl>
<dt><b><tt>-dColorAdjustMatrix='{</tt></b><em>three, nine, or sixteen
floating-point values</em><b><tt>}'</tt></b>
<dd>This is a matrix to adjust the colors. Values should be between -1.0
and 1.0, and the number of values depends on the color model the selected
algorithm uses. In RGB and CMYK modes a matrix with 1.0 on the diagonal
produces no transformation. This feature is really required, but I could
not identify a similar feature at the language level, so I implemented it,
but I don't know reasonable values yet.
</dl>
<dl>
<dt><b><tt>-dCtransfer='{</tt></b><em>float float ...</em><b><tt>}'</tt></b> or
<dt><b><tt>-dMtransfer=</tt></b>..., <b><tt>-dY</tt></b>..., <b><tt>-dK</tt></b>... or
<dt><b><tt>-dRtransfer='{</tt></b><em>float float ...</em><b><tt>}'</tt></b> or
<dt><b><tt>-dG</tt></b>..., <b><tt>-dB</tt></b>... or
<dt><b><tt>-dKtransfer='{</tt></b><em>float float ...</em><b><tt>}'</tt></b>
<dd>Which you use depends on the algorithm, which may be either either
CMYK, RGB or monochrome. The values are arrays of floats in the range from
0 to 1.0, representing the visible color intensity for the device. One may
achieve similar effects with <b><tt>setcolortransfer</tt></b> at the
language level, but this takes more time and the underlying code for the
driver-specific parameters is still required. The size of the arrays is
arbitrary and the defaults are "<b><tt>{0.0 1.0}</tt></b>", which is a
linear characteristic. Most of the code in <b><tt>stcolor.ps</tt></b> are
better transfer arrays.
</dl>
<dl>
<dt><b><tt>-dKcoding='{</tt></b><em>float...</em><b><tt>}'</tt></b>
<dt><b><tt>-dC</tt></b>..., <b><tt>-dM</tt></b>... etc.
<dd>Arrays between 0.0 and 1.0, controlling the internal coding of the
color values. Clever use of these arrays may yield further enhancements,
but I have no experience yet. (To be discontinued with version 2.x.)
</dl>
<dl>
<dt><b><tt>-sModel=st800</tt></b>
<dd>Causes output to be suitable for the monochrome Stylus 800 (no weaving,
no color).
</dl>
<dl>
<dt><b><tt>-sOutputCode=</tt></b><em>{name}</em>
<dd>Can be either "<b><tt>plain</tt></b>", "<b><tt>runlength</tt></b>" or
"<b><tt>deltarow</tt></b>" and changes the ESC/P2 coding technique
used by the driver. The default is to use runlength encoding.
"<b><tt>plain</tt></b>" selects uncompressed encoding and generates
enormous amounts of data.
</dl>
<dl>
<dt><b><tt>-descp_Band=</tt></b><em>1/8/15/24</em>
<dd>Number of nozzles of scanlines used in printing, Useful only with
<b><tt>-dnoWeave</tt></b>. Larger Values yield smaller code, but this
doesn't increase the printing speed.
</dl>
<dl>
<dt><b><tt>-descp_Width=</tt></b><em>N</em>
<dd>Number of pixels Printed in each scan Line. (Useful only when tuning
margins; see below)
</dl>
<dl>
<dt><b><tt>-descp_Height=</tt></b><em>pixels</em>
<dd>Length of the entire page in pixels. (Parameter of
"<b><tt>ESC(C</tt></b>" in default initialization.)
</dl>
<dl>
<dt><b><tt>-descp_Top=</tt></b><em>scan lines</em>
<dd>Top margin in scan lines. (First parameter of "<b><tt>ESC(c</tt></b>"
in default initialization.)
</dl>
<dl>
<dt><b><tt>-descp_Bottom=</tt></b><em>scan lines</em>
<dd>Bottom margin in scan lines. (Second parameter of
"<b><tt>ESC(c</tt></b>" in default initialization.)
</dl>
<dl>
<dt><b><tt>-sescp_Init=</tt></b>"<em>string</em>"
<dd>Override for the initialization sequence. (Must set graphics mode 1
and units.)
</dl>
<dl>
<dt><b><tt>-sescp_Release=</tt></b>"<em>string</em>"
<dd>Overrides the release sequence, "<b><tt>ESC @ FF</tt></b>" by
default.
</dl>
<p>
ESC/P2 allows any resolutions to be valid in theory, but only
<b><tt>-r360x360</tt></b> (the default) and <b><tt>-r720x720</tt></b> (not
on STC-IIs ? and st800) are known to work with most printers.
<p>
<blockquote><table cellpadding=0 cellspacing=0>
<tr><th colspan=7 bgcolor="#CCCC00"><hr><font size="+1">Valid option combinations<br>Stylus I & Pro-Series only</font><hr>
<tr valign=bottom>
<th valign=bottom align=left>Resolution
<td>
<th valign=bottom align=left><b><tt>escp_Band</tt></b>
<td>
<th valign=bottom align=left>Weave usable
<td>
<th valign=bottom align=left><b><tt>escp_Band</tt></b> &<br>number of passes
<tr> <td colspan=7><hr>
<tr valign=top> <td>180x90
<td>
<td>15
<td>
<td><b><tt>noWeave</tt></b>
<td>
<td>
<tr valign=top> <td>180x180
<td>
<td>1 , 8, 24
<td>
<td><b><tt>noWeave</tt></b>, <b><tt>Microweave</tt></b>
<td>
<td>15/2 <b><tt>SoftWeave</tt></b>
<tr valign=top> <td>180x360
<td>
<td>
<td>
<td>
<td>
<td>15/4 <b><tt>SoftWeave</tt></b>
<tr valign=top> <td>180x720
<td>
<td>
<td>
<td>
<td>
<td>15/8 <b><tt>SoftWeave</tt></b>
<tr valign=top> <td>360x90
<td>
<td>15
<td>
<td><b><tt>noWeave</tt></b>
<td>
<td>
<tr valign=top> <td>360x180
<td>
<td>1, 8, 24
<td>
<td><b><tt>noWeave</tt></b>, <b><tt>Microweave</tt></b>
<td>
<td>15/2 <b><tt>SoftWeave</tt></b>
<tr valign=top> <td>360x360
<td>
<td>1, 8, 24
<td>
<td><b><tt>noWeave</tt></b>, <b><tt>Microweave</tt></b>
<td>
<td>15/4 <b><tt>SoftWeave</tt></b>
<tr valign=top> <td>360x720
<td>
<td>
<td>
<td>
<td>
<td>15/8 <b><tt>SoftWeave</tt></b>
<tr valign=top> <td>720x90
<td>
<td>15
<td>
<td><b><tt>noWeave</tt></b>
<td>
<td>
<tr valign=top> <td>720x180
<td>
<td>
<td>
<td>
<td>
<td>15/2 <b><tt>SoftWeave</tt></b>
<tr valign=top> <td>720x360
<td>
<td>
<td>
<td>
<td>
<td>15/4 <b><tt>SoftWeave</tt></b>
<tr valign=top> <td>720x720
<td>
<td>1
<td>
<td><b><tt>noWeave</tt></b>, <b><tt>Microweave</tt></b>
<td>
<td>15/8 <b><tt>SoftWeave</tt></b>
</table></blockquote>
<blockquote>
<b>Beware:</b> there are only few validity checks for parameters. A good
example is <b><tt>escp_Band</tt></b>: if you set this, the driver uses your
value even if the value is not supported by the printer. <b>You asked for
it and you got it!</b>
</blockquote>
<h3><a name="STC_FAQ"></a>Application note and FAQ</h3>
<p>
Quite a bunch of parameters. Hopefully you never need any of them, besides
feeding <b><tt>stcolor.ps</tt></b> to Ghostscript in front of your input.
<p>
After answering some questions over fifty times I prepared a FAQ. Here is
version 1.3 of the FAQ, as of <b><tt>stcolor</tt></b> version 1.20 (for
Ghostscript 3.50).
<h4><a name="STC_FAQ_A3"></a>Support for A3 paper</h4>
<p>
Yes, this driver supports the A3-size printer: merely set the required
pagesize and margins. A simple way to do this is to specify the
command-line switch "<b><tt>-sPAPERSIZE=a3</tt></b>" or include the
procedure call "<b><tt>a3</tt></b>" in the PostScript prolog section. To
optimize the printable area or set the proper margins, see the next
paragraph.
<h4><a name="STC_FAQ_margins"></a>Margins, PageSize</h4>
<p>
I refuse to add code to <b><tt>stcolor</tt></b> that tries to guess the
proper margins or page size, because I found that such guessing is usually
wrong and needs correction in either the source or the parameters. You can
modify <b><tt>stcolor.ps</tt></b> to do that, however. After the line
<blockquote><b><tt>
mark % prepare stack for "putdeviceprops"
</tt></b></blockquote>
<p>
insert these lines, which define page size and margins in points:
<blockquote>
<pre>/.HWMargins [9.0 39.96 12.6 9.0] % Left, bottom, right, top (1/72")
/PageSize [597.6 842.4] % Paper, including margins (1/72")
/Margins [ % neg. Offset to Left/Top in Pixels
4 index 0 get STCold /HWResolution get 0 get mul 72 div neg
5 index 3 get STCold /HWResolution get 1 get mul 72 div neg
]</pre></blockquote>
<p>
Feel free to change the values of <b><tt>.HWMargins</tt></b> and
<b><tt>PageSize</tt></b> to match your needs; the values given are the
defaults when the driver is compiled with "<b><tt>-DA4</tt></b>". This
option or its omission may cause trouble: the Stylus Color can print up to
exactly 8 inches (2880 pixels) at 360dpi. The remaining paper is the
margin, where the left margin varies only slightly with the paper size,
while the right margin is significantly increased for wider paper, such as
U.S. letter size.
<p>
<b>Note</b> that if you are using an ISO paper size with a version of
<b><tt>stcolor</tt></b> after 1.20 and compiled without
"<b><tt>-DA4</tt></b>", then the default margin is too large, and you need
to add the proper "<b><tt>.HWMargins</tt></b>" to the command line or to
<b><tt>stcolor.ps</tt></b>.
<h4><a name="STC_FAQ_II_IIS_1500"></a>Stylus Color II / IIs and 1500</h4>
<p>
First the good news: the driver can print on the Stylus Color II.
Now the bad news:
<ul>
<li>According to Epson support the driver "abuses" the color
capabilities. (See "Future Plans" for details.)
<li>You need some parameters on the command line (or in
<b><tt>stcolor.ps</tt></b>).
<li>I doubted that it would be usable with the Stylus Color IIs, but
it <b>is</b> usable and suffers from mixing problems!
</ul>
<p>
To make things work, you <b>MUST</b> disable the driver's internal
weaving (<b><tt>Softweave</tt></b>), in one of these two ways:
<blockquote>
<b><tt>gs -dMicroweave</tt></b> ...<br>
<b><tt>gs -dnoWeave -descp_Band=1</tt></b> ...
</blockquote>
<p>
Version 1.90, current as of Ghostscript 5.10, fixes this bug by new default
behaviour. I experienced significantly increased printing speed with the
second variant on the old Stylus Color, when printing mostly monochrome
data.
<h3><a name="STC_recommendations"></a>Recommendations</h3>
<p>
The next section is a contribution from Jason Patterson <jason@reflections.com.au>
who evaluated a previous version (1.17). Ghostscript was invoked as follows:
<blockquote><dl compact>
<dt><b><tt>gs</tt></b>
<dd><b><tt>-sDEVICE=stcolor -r720x720
-sDithering=</tt></b>... <b><tt>-sOutputFile=escp.out stcolor.ps
whatsoever.ps</tt></b>
</dl></blockquote>
<p>
where "..." is the name of the desired algorithm.
<b><tt>stcolor.ps</tt></b> was omitted for the gs-algorithms
(<b><tt>gsmono</tt></b>, <b><tt>gsrgb</tt></b> and <b><tt>gscmyk</tt></b>),
for which it is useless and would not allow the selection of
"<b><tt>gscmyk</tt></b>".
<h4><a name="STC_dither_experiment"></a>Color dithering experiments with
<b><tt>gdevstc</tt></b> 1.21</h4>
<p>
Here are data about the EPSON Stylus Color driver's different dithering
methods, based on a little experiment using four good quality scanned
images of quite varied nature, to begin with, a summary of the results of
the four experiments. <b>Sanity note:</b> the results here are from only
four images and a total of 24 printouts (eight on 720dpi paper, sixteen on
plain paper). Your results will almost certainly vary, and your standards
might not be the same as mine, so use these results only as a guide, not as
a formal evaluation.
<blockquote><table cellpadding=0 cellspacing=0>
<tr><th colspan=3 bgcolor="#CCCC00"><hr><font size="+1">Quality of output by method</font><hr>
<tr valign=bottom>
<th align=left>
<td>
<th align=left>
<tr> <td colspan=3><hr>
<tr> <td valign=top><b><tt>gsmono</tt></b>
<td>
<td>Pretty much what you'd expect from a mono ordered pattern.
Looks like what a lot of mono laser printers produce.
<tr> <td valign=top><b><tt>fsmono</tt></b>
<td>
<td>Excellent for monochrome.
<tr> <td valign=top><b><tt>gscmyk</tt></b>
<td>
<td>Not very good, but expected from an ordered pattern.
<tr> <td valign=top><b><tt>gsrgb</tt></b>
<td>
<td>A little better than <b><tt>gscmyk</tt></b>. More consistent
looking.
<tr> <td valign=top><b><tt>fs2</tt></b>
<td>
<td>Good, but not quite as good as <b><tt>fsrgb</tt></b>. Gets the
brightness wrong: too light at 720dpi, too dark at 360dpi.
<tr> <td valign=top><b><tt>fsrgb</tt></b>
<td>
<td>Very good, but a little too dark and has a slight blue tint.
<tr> <td valign=top><b><tt>hscmyk</tt></b>
<td>
<td>Excellent. Slightly better than <b><tt>fsrgb</tt></b> and
<b><tt>fs2</tt></b>. Better than <b><tt>fscmyk</tt></b> on
some images, almost the same on most.
<tr> <td valign=top><b><tt>fscmyk</tt></b>
<td>
<td>Best. Very, very slightly better than <b><tt>hscmyk</tt></b>.
On some images nearly as good as the EPSON demos done with
the MS Windows driver.
</table></blockquote>
<blockquote><table cellpadding=0 cellspacing=0>
<tr><th colspan=4 bgcolor="#CCCC00"><hr><font size="+1">Overall visual quality (1-10), best to worst</font><hr>
<tr valign=top> <th colspan=4 align=left>Monochrome
<tr> <td>
<td><b><tt>fsmono</tt></b>
<td>
<td><b><tt>******************</tt></b>
<tr> <td>
<td><b><tt>gsmono</tt></b>
<td>
<td><b><tt>**********</tt></b>
<tr> <td>
<td>
<td>
<td><b><tt>0 1 2 3 4 5 6 7 8 9 10</tt></b>
<tr> <td colspan=4><hr>
<tr valign=top> <th colspan=4 align=left>Colour
<tr> <td>
<td><b><tt>fscmyk</tt></b>
<td>
<td><b><tt>*******************</tt></b>
<tr> <td>
<td><b><tt>hscmyk</tt></b>
<td>
<td><b><tt>*******************</tt></b>
<tr> <td>
<td><b><tt>fsrgb</tt></b>
<td>
<td><b><tt>******************</tt></b>
<tr> <td>
<td><b><tt>fs2</tt></b>
<td>
<td><b><tt>*****************</tt></b>
<tr> <td>
<td><b><tt>gsrgb</tt></b>
<td>
<td><b><tt>**********</tt></b>
<tr> <td>
<td><b><tt>gscmyk</tt></b>
<td>
<td><b><tt>*********</tt></b>
<tr> <td>
<td>
<td>
<td><b><tt>0 1 2 3 4 5 6 7 8 9 10</tt></b>
</table></blockquote>
<h3><a name="STC_color_transform"></a>Color transformation</h3>
<p>
In the initial version of the driver distributed with Ghostscript 3.33, the
parameter "<b><tt>SpotSize</tt></b>" was the only way to manipulate the
colors at the driver level. According to the parameters enumerated above,
this has changed significantly with version 1.16 and above as a result an
ongoing discussion about dithering algorithms and "false color" on the
Epson Stylus Color. This initiated the transformation of the
<b><tt>stcolor</tt></b> driver into a framework for different dithering
algorithms, providing a generalized interface to the internal Ghostscript
color models and the other data structures related to Ghostscript drivers.
<p>
The main thing such a framework should be able to do is to deliver the
values the dithering algorithm needs; and since this directly influences
the optical image impression, this transformation should be adjustable
without the need for recompilation and relinking. In general the process
can be described as follows:
<blockquote><table cellpadding=0 cellspacing=0>
<tr valign=top> <td colspan=3><b><tt>ColorAdjustMatrix</tt></b>
<td align=center>Coding
<td colspan=3>
<td align=center>Transfer
<td colspan=3>
<tr valign=top> <td>|
<td align=center>Ghostscript color
<td>|
<td align=center>=>
<td>|
<td align=center>Ghostscript raster
<td>|
<td align=center>=>
<td>|
<td align=center>Dithering data
<td>|
<tr valign=top> <td>|
<td>
<td>|
<td>
<td>|
<td align=center>1/2/4/8/16/32-bit
<td>|
<td>
<td>|
<td>
<td>|
<tr valign=top> <td>|
<td align=center>1/3/4 16-bit values
<td>|
<td>
<td>|
<td align=center>1/3/4 values
<td>|
<td>
<td>|
<td align=center>(arbitrary type)
<td>|
</table></blockquote>
<p>
Due to the limitations on raster storage, information is lost in the first
transformation step, except for the 16-bit monochrome mode. So any color
adjustment should take place before this step and this is where the optional
<b><tt>ColorAdjustMatrix</tt></b> works.
<p>
The first transformation step, called "coding", is controlled by the
<b><tt>?coding</tt></b> arrays. The decoding process expands the range of
values expontentially to a larger range than that provided by the initial
Ghostscript color model, and is therefore a reasonable place to make
device- or algorithm-specific adjustments. This is where the
<b><tt>?transfer</tt></b> arrays are used. Array access might be not the
fastest method, but its generality is superior, so this step is always
based upon internally algorithm-specific array access. If 8 bits are stored
per color component and if the algorithm uses bytes too, the second
transformation is included within the first, which saves significant
computation time when printing the data.
<h3><a name="STC_CAM"></a><b><tt>ColorAdjustMatrix</tt></b></h3>
<p>
The driver supports different values for <b><tt>ProcessColorModel</tt></b>,
which raises the need for different color adjustments. Here
"<b><tt>CAM</tt></b>" stands for "<b><tt>ColorAdjustMatrix</tt></b>".
<dl>
<dt><b><tt>DeviceGray</tt></b> (three floats)
<dd><pre>if ((r == g) && (g == b))
K' = 1.0 - R;
else
K' = 1.0 - CAM[0] * R + CAM[1] * G + CAM[2] * B;</pre>
<p>
According to the <a href="Drivers.htm">documentation on drivers</a>, the
latter (the "else" clause) should never happen.
</dl>
<dl>
<dt><b><tt>DeviceRGB</tt></b> (nine floats)
<dd><pre>if((r == g) && (g == b))
R' = B' = G' = R;
else
R' = CAM[0]*R + CAM[1]*G + CAM[2]*B;
G' = CAM[3]*R + CAM[4]*G + CAM[5]*B;
B' = CAM[6]*R + CAM[7]*G + CAM[8]*B;</pre>
<p>
The printer always uses four inks, so a special treatment of black is
provided. Algorithms may take special action if R, G, and B are all
equal.
</dl>
<dl>
<dt><b><tt>DeviceCMYK</tt></b> (sixteen floats)
<dd>
<pre>if((c == m) && (m == y))
K' = max(C,K);
C' = M' = Y' = 0;
else
K = min(C,M,Y);
if((K > 0) && ColorAdjustMatrix_present) { => UCR
C -= K;
M -= K;
Y -= K;
}
C' = CAM[ 0]*C + CAM[ 1]*M + CAM[ 2]*Y + CAM[ 3]*K;
M' = CAM[ 4]*C + CAM[ 5]*M + CAM[ 6]*Y + CAM[ 7]*K;
Y' = CAM[ 8]*C + CAM[ 9]*M + CAM[10]*Y + CAM[11]*K;
K' = CAM[12]*C + CAM[13]*M + CAM[14]*Y + CAM[15]*K;</pre>
<p>
Again we have a special black treatment. "<b><tt>max(C,K)</tt></b>" was introduced
because of a slight misbehaviour of Ghostscript, which delivers
black under certain circumstances as (1,1,1,0). Normally, when
no special black separation and undercolor removal procedures
are defined at the PostScript level, either (C,M,Y,0) or (0,0,0,K)
values are mapped. This would make the extended <b><tt>ColorAdjustMatrix</tt></b>
quite tedious, and so during mapping, black separation is done for
(C,M,Y,0) requests; and if there is a <b><tt>ColorAdjustMatrix</tt></b>, undercolor
removal is used too. In other words the default matrix is:
<blockquote><table>
<tr> <td>1 <td>0 <td>0 <td>1
<tr> <td>0 <td>1 <td>0 <td>1
<tr> <td>0 <td>0 <td>1 <td>1
<tr> <td>0 <td>0 <td>0 <td>1
</table></blockquote>
<p>
and it is applied to CMYK values with separated and removed black. Raising
the CMY coefficients while lowering the K coefficients reduces black and
intensifies color. But be careful, because even small deviations from the
default cause drastic changes.
</dl>
<p>
If no <b><tt>ColorAdjustMatrix</tt></b> is set, the matrix computations are
skipped. Thus the transformation reduces to range inversion in monochrome
mode and black separation in CMYK mode.
<h3><a name="STC_RGBCMYK_coding"></a>RGB / CMYK coding and transfer, and <b><tt>BitsPerPixel</tt></b></h3>
<p>
These two (groups of) parameters are arrays of floating-point numbers in
the range 0.0 to 1.0. They control the truncation to the desired number of
bits stored in raster memory (<b><tt>BitsPerPixel</tt></b>) and the ink
density. The "truncation" may become a nonlinear function if any of the
<b><tt>?coding</tt></b> arrays is set. Assume the following Ghostscript
invocation:
<blockquote><pre>gs -sDEVICE=stcolor -sDithering=fscmyk -dBitsPerPixel=16 \
-dKcoding='{ 0.0 0.09 0.9 1.0 }' \
-dMcoding='{ 0.0 0.09 0.9 1.0 }' \
-dKtransfer='{ 0.0 0.09 0.9 1.0 }' \
-dYtransfer='{ 0.0 0.09 0.9 1.0 }'</pre>
</blockquote>
<p>
We may have either or both of <b><tt>?coding</tt></b> and
<b><tt>?transfer</tt></b>, giving four possible combinations. (These four
combinations appear in the given example.) The resulting mapping appears
in the following tables, where except for the internal Indices (4
components × 4 bits = 16 <b><tt>BitsPerPixel</tt></b>), all values
are normalized to the range 0 to 1. The actual range is 0 to 65535 for the
Ghostscript color and 0 to 16777215 for the ink values delivered to the
<b><tt>fscmyk</tt></b> algorithm. Sorry for the bunch of numbers
following, but you may try this example in conjunction with
<b><tt>stcinfo.ps</tt></b>, which should give you a graphical printout of
the following numbers when you issue a <b><tt>showpage</tt></b> command.
<blockquote><table cellpadding=0 cellspacing=0>
<tr> <td>
<td>
<th colspan=5>Cyan<hr>
<td>
<th colspan=5>Magenta<hr>
<tr valign=top> <th>CI/15
<td>
<th>gs_color_values
<td>
<th>CI
<td>
<th>Ink
<td>
<th>gs_color_values
<td>
<th>CI
<td>
<th>Ink
<tr> <td colspan=13><hr>
<tr valign=top> <td align=center>0.000
<td>
<td align=center>0.000 - 0.062
<td>
<td align=right>0
<td>
<td align=center>0.000
<td>
<td align=center>-0.123 - 0.123
<td>
<td align=right>0
<td>
<td align=center>0.000
<tr valign=top> <td align=center>0.067
<td>
<td align=center>0.063 - 0.125
<td>
<td align=right>1
<td>
<td align=center>0.067
<td>
<td align=center>0.123 - 0.299
<td>
<td align=right>1
<td>
<td align=center>0.247
<tr valign=top> <td align=center>0.133
<td>
<td align=center>0.125 - 0.187
<td>
<td align=right>2
<td>
<td align=center>0.133
<td>
<td align=center>0.299 - 0.365
<td>
<td align=right>2
<td>
<td align=center>0.351
<tr valign=top> <td align=center>0.200
<td>
<td align=center>0.188 - 0.250
<td>
<td align=right>3
<td>
<td align=center>0.200
<td>
<td align=center>0.365 - 0.392
<td>
<td align=right>3
<td>
<td align=center>0.379
<tr valign=top> <td align=center>0.267
<td>
<td align=center>0.250 - 0.312
<td>
<td align=right>4
<td>
<td align=center>0.267
<td>
<td align=center>0.392 - 0.420
<td>
<td align=right>4
<td>
<td align=center>0.406
<tr valign=top> <td align=center>0.333
<td>
<td align=center>0.313 - 0.375
<td>
<td align=right>5
<td>
<td align=center>0.333
<td>
<td align=center>0.420 - 0.447
<td>
<td align=right>5
<td>
<td align=center>0.433
<tr valign=top> <td align=center>0.400
<td>
<td align=center>0.375 - 0.437
<td>
<td align=right>6
<td>
<td align=center>0.400
<td>
<td align=center>0.447 - 0.475
<td>
<td align=right>6
<td>
<td align=center>0.461
<tr valign=top> <td align=center>0.467
<td>
<td align=center>0.438 - 0.500
<td>
<td align=right>7
<td>
<td align=center>0.467
<td>
<td align=center>0.475 - 0.502
<td>
<td align=right>7
<td>
<td align=center>0.488
<tr valign=top> <td align=center>0.533
<td>
<td align=center>0.500 - 0.562
<td>
<td align=right>8
<td>
<td align=center>0.533
<td>
<td align=center>0.502 - 0.529
<td>
<td align=right>8
<td>
<td align=center>0.516
<tr valign=top> <td align=center>0.600
<td>
<td align=center>0.563 - 0.625
<td>
<td align=right>9
<td>
<td align=center>0.600
<td>
<td align=center>0.529 - 0.557
<td>
<td align=right>9
<td>
<td align=center>0.543
<tr valign=top> <td align=center>0.667
<td>
<td align=center>0.625 - 0.687
<td>
<td align=right>10
<td>
<td align=center>0.667
<td>
<td align=center>0.557 - 0.584
<td>
<td align=right>10
<td>
<td align=center>0.571
<tr valign=top> <td align=center>0.733
<td>
<td align=center>0.688 - 0.750
<td>
<td align=right>11
<td>
<td align=center>0.733
<td>
<td align=center>0.584 - 0.612
<td>
<td align=right>11
<td>
<td align=center>0.598
<tr valign=top> <td align=center>0.800
<td>
<td align=center>0.750 - 0.812
<td>
<td align=right>12
<td>
<td align=center>0.800
<td>
<td align=center>0.612 - 0.639
<td>
<td align=right>12
<td>
<td align=center>0.626
<tr valign=top> <td align=center>0.867
<td>
<td align=center>0.813 - 0.875
<td>
<td align=right>13
<td>
<td align=center>0.867
<td>
<td align=center>0.639 - 0.715
<td>
<td align=right>13
<td>
<td align=center>0.653
<tr valign=top> <td align=center>0.933
<td>
<td align=center>0.875 - 0.937
<td>
<td align=right>14
<td>
<td align=center>0.933
<td>
<td align=center>0.715 - 0.889
<td>
<td align=right>14
<td>
<td align=center>0.778
<tr valign=top> <td align=center>1.000
<td>
<td align=center>0.938 - 1.000
<td>
<td align=right>15
<td>
<td align=center>1.000
<td>
<td align=center>0.889 - 1.111
<td>
<td align=right>15
<td>
<td align=center>1.000
</table></blockquote>
<p>
The difference between cyan and magenta is the presence of a coding array.
The coding process must map a range of color values to each of the sixteen
component indices. If no coding array is given, this is accomplished
by dividing by 4096, equivalent to a right shift by 12 bits. The
final ink density resides in the given interval and moves from the left to
the right side from 0 to 15. For magenta there is a coding array
and the ink value matches the center of the intervals. But the distribution
of the mapped intervals follows the given coding array and is nonlinear in
the linear color space of Ghostscript.
<p>
Now let us take a look at the case with transfer arrays:
<blockquote><table cellpadding=0 cellspacing=0>
<tr> <td>
<td>
<th colspan=5>Yellow<hr>
<td>
<th colspan=5>Black<hr>
<tr valign=top> <th>CI/15
<td>
<th>gs_color_values
<td>
<th>CI
<td>
<th>Ink
<td>
<th>gs_color_values
<td>
<th>CI
<td>
<th>Ink
<tr> <td colspan=13><hr>
<tr valign=top> <td align=center>0.000
<td>
<td align=center>0.000 - 0.062
<td>
<td align=right>0
<td>
<td align=center>0.000
<td>
<td align=center>-0.123 - 0.123
<td>
<td align=right>0
<td>
<td align=center>0.000
<tr valign=top> <td align=center>0.067
<td>
<td align=center>0.063 - 0.125
<td>
<td align=right>1
<td>
<td align=center>0.018
<td>
<td align=center>0.123 - 0.299
<td>
<td align=right>1
<td>
<td align=center>0.067
<tr valign=top> <td align=center>0.133
<td>
<td align=center>0.125 - 0.187
<td>
<td align=right>2
<td>
<td align=center>0.036
<td>
<td align=center>0.299 - 0.365
<td>
<td align=right>2
<td>
<td align=center>0.133
<tr valign=top> <td align=center>0.200
<td>
<td align=center>0.188 - 0.250
<td>
<td align=right>3
<td>
<td align=center>0.054
<td>
<td align=center>0.365 - 0.392
<td>
<td align=right>3
<td>
<td align=center>0.200
<tr valign=top> <td align=center>0.267
<td>
<td align=center>0.250 - 0.312
<td>
<td align=right>4
<td>
<td align=center>0.072
<td>
<td align=center>0.392 - 0.420
<td>
<td align=right>4
<td>
<td align=center>0.267
<tr valign=top> <td align=center>0.333
<td>
<td align=center>0.313 - 0.375
<td>
<td align=right>5
<td>
<td align=center>0.090
<td>
<td align=center>0.420 - 0.447
<td>
<td align=right>5
<td>
<td align=center>0.333
<tr valign=top> <td align=center>0.400
<td>
<td align=center>0.375 - 0.437
<td>
<td align=right>6
<td>
<td align=center>0.252
<td>
<td align=center>0.447 - 0.475
<td>
<td align=right>6
<td>
<td align=center>0.400
<tr valign=top> <td align=center>0.467
<td>
<td align=center>0.438 - 0.500
<td>
<td align=right>7
<td>
<td align=center>0.414
<td>
<td align=center>0.475 - 0.502
<td>
<td align=right>7
<td>
<td align=center>0.467
<tr valign=top> <td align=center>0.533
<td>
<td align=center>0.500 - 0.562
<td>
<td align=right>8
<td>
<td align=center>0.576
<td>
<td align=center>0.502 - 0.529
<td>
<td align=right>8
<td>
<td align=center>0.533
<tr valign=top> <td align=center>0.600
<td>
<td align=center>0.563 - 0.625
<td>
<td align=right>9
<td>
<td align=center>0.738
<td>
<td align=center>0.529 - 0.557
<td>
<td align=right>9
<td>
<td align=center>0.600
<tr valign=top> <td align=center>0.667
<td>
<td align=center>0.625 - 0.687
<td>
<td align=right>10
<td>
<td align=center>0.900
<td>
<td align=center>0.557 - 0.584
<td>
<td align=right>10
<td>
<td align=center>0.667
<tr valign=top> <td align=center>0.733
<td>
<td align=center>0.688 - 0.750
<td>
<td align=right>11
<td>
<td align=center>0.920
<td>
<td align=center>0.584 - 0.612
<td>
<td align=right>11
<td>
<td align=center>0.733
<tr valign=top> <td align=center>0.800
<td>
<td align=center>0.750 - 0.812
<td>
<td align=right>12
<td>
<td align=center>0.940
<td>
<td align=center>0.612 - 0.639
<td>
<td align=right>12
<td>
<td align=center>0.800
<tr valign=top> <td align=center>0.867
<td>
<td align=center>0.813 - 0.875
<td>
<td align=right>13
<td>
<td align=center>0.960
<td>
<td align=center>0.639 - 0.715
<td>
<td align=right>13
<td>
<td align=center>0.867
<tr valign=top> <td align=center>0.933
<td>
<td align=center>0.875 - 0.937
<td>
<td align=right>14
<td>
<td align=center>0.980
<td>
<td align=center>0.715 - 0.889
<td>
<td align=right>14
<td>
<td align=center>0.933
<tr valign=top> <td align=center>1.000
<td>
<td align=center>0.938 - 1.000
<td>
<td align=right>15
<td>
<td align=center>1.000
<td>
<td align=center>0.889 - 1.111
<td>
<td align=right>15
<td>
<td align=center>1.000
</table></blockquote>
<p>
Yellow uses a transfer array. There is no linear correspondence between
the color and the ink values: this correspondence is defined through the
given array. In other words, the transfer arrays define a nonlinear ink
characteristic, which is exactly the same functionality that PostScript's
"(color)transfer" function provides.
<p>
While for yellow the intervals match the intervals used with cyan, for
black the intervals match the magenta intervals. But watch the
correspondence between the CI/15 values and the ink density for black: this
is a linear distribution in the ink domain.
<p>
Not a bad idea, I think. Consider the <b><tt>fs2</tt></b> algorithm: it
uses values in the range 0 to 255. If any transfer array were alone, some
of the 256 possible values would never be used and others would be used for
adjacent intervals several times. Establishing an identical coding array
solves this problem, so the full potential of the algorithm is used.
<p>
Another useful feature of the coding arrays is that they are internally
normalized to the range 0-1. In 720x720dpi mode the transfer arrays in
<b><tt>stcolor.ps</tt></b> limit the dot density to about 50%, so these
arrays end at 0.5 (and begin at 0.5 for RGB). Because of automatic
normalization, these arrays can also be used as coding arrays. But of
course in the <b><tt>fs2</tt></b> case mentioned above, values from 0 to
127 will never be delivered to the algorithm, while values 128-255 are
delivered for adjacent intervals.
<p>
To clarify the intended use of the three parameters (parameter groups), keep this in mind:
<blockquote><ul>
<li><b><tt>ColorAdjustMatrix</tt></b> is never used when transferring gray
values. This restricts it to what the name says: adjustment of colors,
that is, correction for miscolored ink. Do not use it for saturation or
brightness control.
<li><b><tt>?transfer</tt></b> arrays control the values delivered to the
driver, which in turn controls the ink quantity. Use these arrays to
control saturation and brightness. In general these arrays are identical
for all inks. If they differ they provide a simpler scheme for color
correction, which is not necessarily faster than the
<b><tt>ColorAdjustMatrix</tt></b>.
<li><b><tt>?coding</tt></b> arrays control the color value intervals mapped
to the internal color indices.
</ul></blockquote>
<h3><a name="What_is_weaving"></a>What is weaving?</h3>
<p>
The Epson Stylus Color has a head assembly that contains two physically
identifiable heads, one for black and one for cyan, magenta, and yellow
(CMY). This makes four "logical" heads, one for each color component.
Each of these four heads has several jets at some vertical (Y) distance
from one another, so several horizontal lines can be printed of a given
color during one pass of the heads. From experience I think there are
fifteen jets per color, spaced at 1/90in.
<p>
So the question arises of how to print at a Y resolution of 360dpi with
90dpi jets. Simply by division one gets 360dpi/90dpi = 4, which tells us
that 4 passes of the head assembly are needed to achieve a Y resolution of
360dpi.
<p>
Weaving is the method of how the fifteen jets are used to print adjacent
horizontal rows separated here by 1/360 inch:
<blockquote><table cellpadding=0 cellspacing=0>
<tr><th colspan=17 bgcolor="#CCCC00"><hr><font size="+1">Print-head jets used with and without weaving</font><hr>
<tr> <td>
<td>
<th valign=bottom colspan=7>Weaving<hr>
<td>
<th valign=bottom colspan=7>noWeave<hr>
<tr valign=top> <td>
<th>Pass
<th>1
<td>
<th>2
<td>
<th>3
<td>
<th>4
<td>
<th>1
<td>
<th>2
<td>
<th>3
<td>
<th>4
<tr> <th>Row
<tr valign=top> <td align=center>0
<td>
<td align=center>jet 0
<td>
<td align=center>--
<td>
<td align=center>--
<td>
<td align=center>--
<td>
<td align=center>jet 0
<td>
<td align=center>--
<td>
<td align=center>--
<td>
<td align=center>--
<tr valign=top> <td align=center>1
<td>
<td align=center>--
<td>
<td align=center>jet 1
<td>
<td align=center>--
<td>
<td align=center>--
<td>
<td align=center>--
<td>
<td align=center>jet 0
<td>
<td align=center>--
<td>
<td align=center>--
<tr valign=top> <td align=center>2
<td>
<td align=center>--
<td>
<td align=center>--
<td>
<td align=center>jet 2
<td>
<td align=center>--
<td>
<td align=center>--
<td>
<td align=center>--
<td>
<td align=center>jet 0
<td>
<td align=center>--
<tr valign=top> <td align=center>3
<td>
<td align=center>--
<td>
<td align=center>--
<td>
<td align=center>--
<td>
<td align=center>jet 3
<td>
<td align=center>--
<td>
<td align=center>--
<td>
<td align=center>--
<td>
<td align=center>jet 0
<tr valign=top> <td align=center>4
<td>
<td align=center>jet 1
<td>
<td align=center>--
<td>
<td align=center>--
<td>
<td align=center>--
<td>
<td align=center>jet 1
<td>
<td align=center>--
<td>
<td align=center>--
<td>
<td align=center>--
<tr valign=top> <td align=center>5
<td>
<td align=center>--
<td>
<td align=center>jet 2
<td>
<td align=center>--
<td>
<td align=center>--
<td>
<td align=center>--
<td>
<td align=center>jet 1
<td>
<td align=center>--
<td>
<td align=center>--
<tr valign=top> <td align=center>6
<td>
<td align=center>--
<td>
<td align=center>--
<td>
<td align=center>jet 3
<td>
<td align=center>--
<td>
<td align=center>--
<td>
<td align=center>--
<td>
<td align=center>jet 1
<td>
<td align=center>--
<tr valign=top> <th>...
</table></blockquote>
<p>
Now let's assume that the dot diameter is different for each individual
jet, but the average among the jets matches the desired resolution. With
weaving, adjacent rows are printed by different jets, thus some averaging
takes place. Without weaving, adjacent rows are printed by the same jet
and this makes the dot diameter deviations visible as 1/90in stripes on
the paper.
<h3><a name="STC_print_modes"></a>Print mode parameters</h3>
<p>
The parameters "<b><tt>Unidirectional</tt></b>",
"<b><tt>Microweave</tt></b>", "<b><tt>noWeave</tt></b>",
"<b><tt>OutputCode</tt></b>", "<b><tt>Model</tt></b>" and the given
resolution control the data generated for the printer.
<h4><a name="STC_unidirectional"></a><b><tt>Unidirectional</tt></b></h4>
<p>
Simply toggles the unidirectional mode of the printer. Setting
"<b><tt>Unidirectional</tt></b>" definitely slows printing speed, but may
improve the quality. I use this for printing transparencies, where fast
head movement could smear the ink.
<h4><a name="STC_noweave"></a><b><tt>Microweave</tt></b>,
<b><tt>noWeave</tt></b> and <b><tt>OutputCode=deltarow</tt></b></h4>
<p>
The first are two booleans, which implies that four combinations are
possible. Actually only three exist (if you don't count for
<b><tt>deltarow</tt></b>): <b><tt>Softweave</tt></b>,
<b><tt>Microweave</tt></b>, and <b><tt>noWeave</tt></b>. The first and
second are functionally identical, the difference being whether the driver
or the printer does the job.
<p>
In the default <b><tt>Softweave</tt></b> mode the driver sends the data
properly arranged to the printer, while in <b><tt>Microweave</tt></b> mode,
it is the printer that arranges the data. But in general the host processor
is much faster than the printer's processor, and thus it is faster for the
host do the job. In addition to that, for 720dpi eight passes are
required, and the amount of buffer space needed to buffer the data for the
passes is far beyond the printer's memory. <b><tt>Softweave</tt></b>
requires an odd value of "<b><tt>escp_Band</tt></b>"; the Stylus Color
provides fifteen for that.
<p>
"<b><tt>OutputCode</tt></b>" controls the encoding used. In the basic
modes, the choice consists of "plain" and "runlength". The computation of
runlength-encoded data does not take much time, less than the data tranfer
to the printer; thus this is the recommended mode, and of course the
default. With the Stylus Color, Epson introduced some new encoding
principles, namely "tiff" and "deltarow". While the first was omitted from
this driver for lack of apparent advantages, "<b><tt>deltarow</tt></b>" is
available as an option. "<b><tt>Softweave</tt></b>" cannot be used with
this encoding, so if <b><tt>OutputCode=deltarow</tt></b> is set,
<b><tt>Microweave</tt></b> becomes the default. Maybe that the size of the
ESC/P2 code becomes smaller, but I have never observed faster printing
speed. Things tend to become slower with <b><tt>deltarow</tt></b> compared
to <b><tt>Softweave</tt></b>.
<h4><a name="STC_model"></a><b><tt>Model</tt></b></h4>
<p>
Some ESC/P2 printers such as the Stylus 800 do not offer
<b><tt>Microweave</tt></b> or the commands required to do
<b><tt>Softweave</tt></b>. Setting <b><tt>Model</tt></b> just changes the
defaults and omits some parts of the initialization sequence which are not
compatible with the given printer model. Currently only
"<b><tt>st800</tt></b>" is supported besides the default
<b><tt>stcolor</tt></b>.
<h3><a name="STC_Pitfalls"></a>Bugs and pitfalls</h3>
<ul>
<li>The given <b><tt>?coding</tt></b> and <b><tt>?transfer</tt></b> arrays
should be strictly monotonic.
<li>It is impossible to change <b><tt>WHITE</tt></b>: that's your paper.
Thus RGB transfer should end at 1.0 and CMYK transfer should start at 0.0.
<li>Usually 8 bits per component yields fastest operation.
<li>The <b><tt>ColorAdjustMatrix</tt></b> is not used in the reverse
transformation used when Ghostscript does the dithering
(<b><tt>gs</tt></b>* modes). Expect funny results.
<li>If <b><tt>BitsPerPixel</tt></b> is less than 6, the entire coding and
transfer process does not work. This is always true for the
<b><tt>gs</tt></b>* modes and becomes true for the other modes if
<b><tt>BitsPerPixel</tt></b> is forced to low values.
<li>720×720dpi printing should never select the <b><tt>gs</tt></b>*
modes and should always use <b><tt>stcolor.ps</tt></b>. (I prefer
360×720.)
</ul>
<h3><a name="STC_Tests"></a>Tests</h3>
<p>
This section gives an overview of performance in terms of processing and
printing times, from tests run after version 1.13. Printing was done
offline (simply copying a processed file to the printer) to measure real
printing speed without regard to speed of processing on the host, since at
high resolutions, processing time is the same order of magnitude and thus
may become the limiting factor.
<h4><a name="STC_OutputCodes"></a>The various OutputCodes</h4>
<p>
I ran several files though Ghostscript and recorded the size of the
resulting print code, the processing time, and the printing time, at least
for some of the files, always using these options:
<blockquote><b><tt>
gs -sDEVICE=stcolor -sPAPERSIZE=a4 stcolor.ps - < file.ps
</tt></b></blockquote>
<p>
(Actually "<b><tt>-sPAPERSIZE=a4</tt></b>" is in my
<b><tt>gs_init.ps</tt></b> since I'm a germ.)
<p>"<b><tt>deltarow</tt></b>" is the new encoding principle
("<b><tt>ESC . 3 10 10 1</tt></b>") with
<b><tt>Microweave</tt></b> on. It is activated with
"<b><tt>-sOutputCode=deltarow</tt></b>".
<p>"<b><tt>Softweave</tt></b>" actually means that nothing else was used:
it is the default, and implies that odd v=40/h=10/m=15 mode
("<b><tt>ESC . 1 40 10 15</tt></b>").
<p>"<b><tt>Microweave</tt></b>" means "<b><tt>-dMicroweave</tt></b>",
equivalent to "<b><tt>ESC . 1 10 10 1</tt></b>",
with full skip optimization and microweave activated.
<p>
Finally I wanted to see the plain Kathy Ireland, and used
"<b><tt>-sOutputCode=plain</tt></b>", which just replaces runlength
encoding (RLE) by no encoding, thus using
"<b><tt>ESC . 0 40 10 15</tt></b>". [So sorry
<b><tt>;-)</tt></b> Kathy was still dressed in blue in front of the blue
sea on a blue air cushion -- nice to see but hard to dither.]
<p>
So here are the results.
<blockquote><table cellpadding=0 cellspacing=0>
<tr><th colspan=9 bgcolor="#CCCC00"><hr><font size="+1">File sizes and printing speeds with various weaving methods</font><hr>
<tr valign=bottom>
<td>
<td>
<th><b><tt>golfer.ps</tt></b>
<td>
<th><b><tt>colorcir.ps</tt></b>
<td>
<th><b><tt>drawing.ps</tt></b>
<td>
<th><b><tt>brief.ps</tt></b>
<tr> <td colspan=9><hr>
<tr valign=top> <td><b><tt>deltarow</tt></b>
<td>
<td>572751/48.180u
<td>
<td>643374/41.690u
<td>
<td>90142/46.180u/1:50
<td>
<td>178563/49.350u/2:22
<tr valign=top> <td><b><tt>Softweave</tt></b>
<td>
<td>559593/46.810u
<td>
<td>669966/44.960u
<td>
<td>296168/48.160u/1:30
<td>
<td>269808/43.320u/1:55
<tr valign=top> <td><b><tt>Microweave</tt></b>
<td>
<td>590999/56.060u
<td>
<td>754276/42.890u
<td>
<td>338885/47.060u/1:50
<td>
<td>282314/44.690u/2:22
</table></blockquote>
<blockquote><table cellpadding=0 cellspacing=0>
<tr><th colspan=3 bgcolor="#CCCC00"><hr><font size="+1">Kathy Ireland</font><hr>
<tr valign=bottom>
<td>
<td>
<th><b><tt>kathy.ps</tt></b>
<tr> <td colspan=3><hr>
<tr valign=top> <td><b><tt>deltarow</tt></b>
<td>
<td>3975334/111.940u/5:35
<tr valign=top> <td><b><tt>Softweave</tt></b>
<td>
<td>3897112/101.940u/3:10
<tr valign=top> <td><b><tt>Microweave</tt></b>
<td>
<td>4062829/100.990u/3:15
<tr valign=top> <td><b><tt>plain/soft</tt></b>
<td>
<td>5072255/104.390u/3:05
</table></blockquote>
<p>
It may be that I've not chosen the optimal <b><tt>deltarow</tt></b> code,
but even if it saves at lot of bytes, printing-speed is not increased.
<p>
At least the printer prefers plain Kathy. In other words, sending 1
Megabyte or 20% more data has no impact on printing speed.
<b><tt>drawing.ps</tt></b> is an exception to this rule: plain prints
slower than RLE.
<p>
"Unclever" coding -- especially with <b><tt>deltarow</tt></b> -- can
significantly slow down printing. But even if very significant advantages
in the size of the code are achieved, "<b><tt>deltarow</tt></b>" is not
competitive. <b><tt>colorcir.ps</tt></b> shows savings with
<b><tt>deltarow</tt></b>, but printing is a mess.
<h4><a name="STC_printing_time"></a>Printing time related to other options</h4>
<p>
Full page halftone images printed, unless otherwise noted.
<blockquote><table cellpadding=0 cellspacing=0>
<tr><th colspan=11 bgcolor="#CCCC00"><hr><font size="+1">Printing time related to other options</font><hr>
<tr valign=top> <th>dpi
<td>
<th colspan=3>Print mode
<td>
<th>Size KB
<td>
<th>Time
<td>
<th align=left>Comments
<tr> <td colspan=11><hr>
<tr valign=top> <td>180x180
<td>
<td>mono
<td>
<td align=right>-/uni
<td>
<td align=right>358
<td>
<td align=right>1:15
<td>
<td>
<tr valign=top> <td>
<td>
<td align=right>
<td>
<td align=right>-/bi
<td>
<td align=right>358
<td>
<td align=right>0:45
<td>
<td>
<tr valign=top> <td>
<td>
<td align=right>
<td>
<td align=right>micro/bi
<td>
<td align=right>205
<td>
<td align=right>0:45
<td>
<td>Not weaving
<tr valign=top> <td>
<td>
<td align=right>
<td>
<td align=right>soft/bi
<td>
<td align=right>179
<td>
<td align=right>1:25
<td>
<td>
<tr valign=top> <td>
<td>
<td>color
<td>
<td align=right>-/bi
<td>
<td align=right>641
<td>
<td align=right>2:45
<td>
<td>
<tr valign=top> <td>
<td>
<td align=right>
<td>
<td align=right>soft/bi
<td>
<td align=right>556
<td>
<td align=right>1:32
<td>
<td>
<tr valign=top> <td>360x360
<td>
<td>mono
<td>
<td align=right>-/uni
<td>
<td align=right>269
<td>
<td align=right>0:50
<td>
<td>Monochrome text
<tr valign=top> <td>
<td>
<td align=right>
<td>
<td align=right>-/bi
<td>
<td align=right>269
<td>
<td align=right>0:35
<td>
<td>Monochrome text
<tr valign=top> <td>
<td>
<td align=right>
<td>
<td align=right>micro/bi
<td>
<td align=right>269
<td>
<td align=right>2:25
<td>
<td>Monochrome text
<tr valign=top> <td>
<td>
<td align=right>
<td>
<td align=right>soft/uni
<td>
<td align=right>250
<td>
<td align=right>3:15
<td>
<td>Monochrome text
<tr valign=top> <td>
<td>
<td align=right>
<td>
<td align=right>soft/bi
<td>
<td align=right>250
<td>
<td align=right>1:55
<td>
<td>Monochrome text
<tr valign=top> <td>
<td>
<td>color
<td>
<td align=right>-/bi
<td>
<td align=right>346
<td>
<td align=right>1:00
<td>
<td>Sparse-color page, visible displacements
<tr valign=top> <td>
<td>
<td align=right>
<td>
<td align=right>micro/bi
<td>
<td align=right>346
<td>
<td align=right>1:50
<td>
<td>Sparse-color page, looks buggy -- printer?
<tr valign=top> <td>
<td>
<td align=right>
<td>
<td align=right>soft/bi
<td>
<td align=right>294
<td>
<td align=right>1:30
<td>
<td>Sparse-color page, O.K.
<tr valign=top> <td>
<td>
<td align=right>
<td>
<td align=right>-/bi
<td>
<td align=right>2218
<td>
<td align=right>2:45
<td>
<td>Visible stripes
<tr valign=top> <td>
<td>
<td align=right>
<td>
<td align=right>micro/bi
<td>
<td align=right>5171
<td>
<td align=right>3:17
<td>
<td>
<tr valign=top> <td>
<td>
<td align=right>
<td>
<td align=right>soft/bi
<td>
<td align=right>3675
<td>
<td align=right>3:05
<td>
<td>
<tr valign=top> <td>360x720
<td>
<td>mono
<td>
<td align=right>soft/bi
<td>
<td align=right>2761
<td>
<td align=right>5:40
<td>
<td>
<tr valign=top> <td>
<td>
<td>color
<td>
<td align=right>soft/bi
<td>
<td align=right>7789
<td>
<td align=right>6:15
<td>
<td>Just a small difference!
<tr valign=top> <td>720x360
<td>
<td>color
<td>
<td align=right>soft/bi
<td>
<td align=right>7182
<td>
<td align=right>5:40
<td>
<td>
<tr valign=top> <td>720x720
<td>
<td>color
<td>
<td align=right>micro/bi
<td>
<td align=right>14748
<td>
<td align=right>30:26
<td>
<td>Actually beyond printer's capabilities
<tr valign=top> <td>
<td>
<td align=right>
<td>
<td align=right>soft/bi
<td>
<td align=right>14407
<td>
<td align=right>11:08
<td>
<td>
</table></blockquote>
<h3><a name="STC_acks"></a>Acknowledgments</h3>
<p>
This driver was copied from <b><tt>gdevcdj.c</tt></b> (Ghostscript 3.12),
which was contributed by George Cameron, Koert Zeilstra, and Eckhard
Rueggeberg. Some of the ESC/P2 code was drawn from Richard Brown's
<b><tt>gdevescp.c</tt></b>. The POSIX interrupt code (compilation option
<b><tt>-DSTC_SIGNAL</tt></b>) is from Frederic Loyer. Several improvements
are based on discussions with Brian Converse, Bill Davidson, Gero Guenther,
Jason Patterson, ? Rueschstroer, and Steven Singer.
<p>
While I wish to thank everyone mentioned above, they are by no means
responsible for bugs in the stcolor driver -- just for the features.
<address>
Gunther Hess<br>
Richard Wagner Strasse 112<br>
D-47057 Duisburg<br>
Germany<br>
+49 203 376273 telephone (MET evening hours)<br>
<<a href="mailto:ghess@elmos.de">ghess@elmos.de</a>>
</address>
<hr>
<h2><a name="Uniprint"></a>uniprint, a flexible unified printer driver</h2>
<p>
<b><tt>uniprint</tt></b> is a unified parametric driver by Gunther Hess
<<a href="mailto:ghess@elmos.de">ghess@elmos.de</a>> for several
kinds of printers and devices, including
<blockquote>
<ul>
<li>any Epson Stylus Color, Stylus, or Stylus Pro
<li>HP PCL/RTL
<li>Canon BubbleJet Color 610
<li>NEC P2X
<li>Sun raster file format
</ul></blockquote>
<p>
This driver is intended to <em>become</em> a unified printer driver. If you
consider it ugly, please send me your suggestions for improvements. The
driver will be updated with them. Thus the full explanation of the driver's
name is:
<blockquote>
Ugly- -> Updated- -> Unified Printer Driver
</blockquote>
<p>
But you probably want to know something about the functionality.
At the time of this writing uniprint drives:
<ul>
<li>NEC Pinwriter P2X (24-pin monochrome impact printer, ESC/P style)
<li>Several Epson Stylus Color models (ESC/P2 style)
<li>HP-DeskJet 550c (basic HP-RTL)
<li>Canon BJC 610
</ul>
<p>
It can be configured for various other printers without recompilation
and offers uncompressed (ugly) Sun rasterfiles as another format, but
this format is intended for testing purposes rather than real use.
The usage of this driver is quite simple. The typical command line looks
like this:
<blockquote>
<b><tt>gs @</tt></b>{MODEL}<b><tt>.upp -sOutputFile=</tt></b>{printable file}<b><tt> MyFile.ps -c quit</tt></b>
</blockquote>
<p>
For example, from my Linux box:
<blockquote><b><tt>
gs @stc.upp -sOutputFile=/dev/lp1 tiger.eps -c quit
</tt></b></blockquote>
<blockquote><table cellpadding=0 cellspacing=0>
<tr><th colspan=6 bgcolor="#CCCC00"><hr><font size="+1">Unified Printer Parameter files distributed with Ghostscript</font><hr>
<tr> <th align=left colspan=6>Canon BJC 610 (color, rendered)
<tr valign=top> <td>
<td><b><tt>bjc610a0.upp</tt></b>
<td>
<td>360×360dpi
<td>
<td>plain paper, high speed
<tr valign=top> <td>
<td><b><tt>bjc610a1.upp</tt></b>
<td>
<td>360×360dpi
<td>
<td>plain paper
<tr valign=top> <td>
<td><b><tt>bjc610a2.upp</tt></b>
<td>
<td>360×360dpi
<td>
<td>coated paper
<tr valign=top> <td>
<td><b><tt>bjc610a3.upp</tt></b>
<td>
<td>360×360dpi
<td>
<td>transparency film
<tr valign=top> <td>
<td><b><tt>bjc610a4.upp</tt></b>
<td>
<td>360×360dpi
<td>
<td>back print film
<tr valign=top> <td>
<td><b><tt>bjc610a5.upp</tt></b>
<td>
<td>360×360dpi
<td>
<td>fabric sheet
<tr valign=top> <td>
<td><b><tt>bjc610a6.upp</tt></b>
<td>
<td>360×360dpi
<td>
<td>glossy paper
<tr valign=top> <td>
<td><b><tt>bjc610a7.upp</tt></b>
<td>
<td>360×360dpi
<td>
<td>high gloss film
<tr valign=top> <td>
<td><b><tt>bjc610a8.upp</tt></b>
<td>
<td>360×360dpi
<td>
<td>high resolution paper
<tr> <td>
<tr valign=top> <td>
<td><b><tt>bjc610b1.upp</tt></b>
<td>
<td>720×720dpi
<td>
<td>plain paper
<tr valign=top> <td>
<td><b><tt>bjc610b2.upp</tt></b>
<td>
<td>720×720dpi
<td>
<td>coated paper
<tr valign=top> <td>
<td><b><tt>bjc610b3.upp</tt></b>
<td>
<td>720×720dpi
<td>
<td>transparency film
<tr valign=top> <td>
<td><b><tt>bjc610b4.upp</tt></b>
<td>
<td>720×720dpi
<td>
<td>back print film
<tr valign=top> <td>
<td><b><tt>bjc610b6.upp</tt></b>
<td>
<td>720×720dpi
<td>
<td>glossy paper
<tr valign=top> <td>
<td><b><tt>bjc610b7.upp</tt></b>
<td>
<td>720×720dpi
<td>
<td>high-gloss paper
<tr valign=top> <td>
<td><b><tt>bjc610b8.upp</tt></b>
<td>
<td>720×720dpi
<td>
<td>high resolution paper
<tr> <td>
<tr> <th align=left colspan=6>HP Ink-Printers
<tr valign=top> <td>
<td><b><tt>cdj550.upp</tt></b>
<td>
<td>300×300dpi
<td>
<td>32-bit CMYK
<tr valign=top> <td>
<td><b><tt>cdj690.upp</tt></b>
<td>
<td>300×300dpi
<td>
<td>Normal mode
<tr valign=top> <td>
<td><b><tt>cdj690ec.upp</tt></b>
<td>
<td>300×300dpi
<td>
<td>Economy mode
<tr valign=top> <td>
<td><b><tt>dnj750c.upp</tt></b>
<td>
<td>300×300dpi
<td>
<td>Color -- also good for 450C
<tr valign=top> <td>
<td><b><tt>dnj750m.upp</tt></b>
<td>
<td>600×600dpi
<td>
<td>Monochrome
<tr> <td>
<tr> <th align=left colspan=6>NEC P2X
<tr valign=top> <td>
<td><b><tt>necp2x.upp</tt></b>
<td>
<td>360×360dpi
<td>
<td>8-bit (Floyd-Steinberg)
<tr> <td>
<tr> <th align=left colspan=6>Any Epson Stylus Color
<tr valign=top> <td>
<td><b><tt>stcany.upp</tt></b>
<td>
<td>360×360dpi
<td>
<td>4-bit, PostScript halftoning
<tr valign=top> <td>
<td><b><tt>stcany_h.upp</tt></b>
<td>
<td>720×720dpi
<td>
<td>4-bit, PostScript halftoning
<tr> <td>
<tr> <th align=left colspan=6>Original Epson Stylus and Stylus Pro Color
<tr valign=top> <td>
<td><b><tt>stc.upp</tt></b>
<td>
<td>360×360dpi
<td>
<td>32-bit CMYK, 15-pin
<tr valign=top> <td>
<td><b><tt>stc_l.upp</tt></b>
<td>
<td>360×360dpi
<td>
<td>4-bit, PostScript halftoning, weaved noWeave
<tr valign=top> <td>
<td><b><tt>stc_h.upp</tt></b>
<td>
<td>720×720dpi
<td>
<td>32-bit CMYK, 15-pin Weave
<tr> <td>
<tr> <th align=left colspan=6>Epson Stylus Color II
<tr valign=top> <td>
<td><b><tt>stc2.upp</tt></b>
<td>
<td>360×360dpi
<td>
<td>32-bit CMYK, 20-pin, Epson Stylus Color II(s)
<tr valign=top> <td>
<td><b><tt>stc2_h.upp</tt></b>
<td>
<td>720×720dpi
<td>
<td>32-bit CMYK, 20-pin, Epson Stylus Color II
<tr valign=top> <td>
<td><b><tt>stc2s_h.upp</tt></b>
<td>
<td>720×720dpi
<td>
<td>32-bit CMYK, 20-pin, Epson Stylus Color IIs
<tr> <td>
<tr> <th align=left colspan=6>Epson Stylus Color 200
<tr valign=top> <td>
<td><b><tt>stc200.upp</tt></b>
<td>
<td>360×720dpi
<td>
<td>Plain Paper
<tr> <td>
<tr> <th align=left colspan=6>Epson Stylus Color 300
<tr valign=top> <td>
<td><b><tt>stc300.upp</tt></b>
<td>
<td>360×360dpi
<td>
<td>32-bit CMYK, plain paper
<tr valign=top> <td>
<td><b><tt>stc300bl.upp</tt></b>
<td>
<td>180×180dpi
<td>
<td>black only, plain paper
<tr valign=top> <td>
<td><b><tt>stc300bm.upp</tt></b>
<td>
<td>360×360dpi
<td>
<td>black only, plain paper
<tr> <td>
<tr> <th align=left colspan=6>Epson Stylus Color 500 (good transfer curves for plain paper)
<tr valign=top> <td>
<td><b><tt>stc500p.upp</tt></b>
<td>
<td>360×360dpi
<td>
<td>32-bit CMYK, noWeave, plain paper
<tr valign=top> <td>
<td><b><tt>stc500ph.upp</tt></b>
<td>
<td>720×720dpi
<td>
<td>32-bit CMYK, noWeave, plain paper
<tr> <td>
<tr> <th align=left colspan=6>Epson Stylus Color 600, 32/90-inch weaving
<tr valign=top> <td>
<td><b><tt>stc600pl.upp</tt></b>
<td>
<td>360×360dpi
<td>
<td>32-bit CMYK, 32-pin, plain paper
<tr valign=top> <td>
<td><b><tt>stc600p.upp</tt></b>
<td>
<td>720×720dpi
<td>
<td>32-bit CMYK, 32-pin, plain paper
<tr valign=top> <td>
<td><b><tt>stc600ih.upp</tt></b>
<td>
<td>1440×720dpi
<td>
<td>32-bit CMYK, 30-pin, inkjet paper
<tr> <td>
<tr> <th align=left colspan=6>Epson Stylus Color 640
<tr valign=top> <td>
<td><b><tt>stc640p.upp</tt></b>
<td>
<td>720×720dpi
<td>
<td>plain paper?
<tr valign=top> <td>
<td><b><tt>st640p.upp</tt></b>
<td>
<td>720×720dpi
<td>
<td>CMYK, plain paper
<tr valign=top> <td>
<td><b><tt>st640pg.upp</tt></b>
<td>
<td>720×720dpi
<td>
<td>grayscale, plain paper
<tr valign=top> <td>
<td><b><tt>st640pl.upp</tt></b>
<td>
<td>360×360dpi
<td>
<td>CMYK, plain paper
<tr valign=top> <td>
<td><b><tt>st640plg.upp</tt></b>
<td>
<td>360×360dpi
<td>
<td>grayscale, plain paper
<tr valign=top> <td>
<td><b><tt>st640ih.upp</tt></b>
<td>
<td>1440×720dpi
<td>
<td>CMYK, inkjet paper
<tr valign=top> <td>
<td><b><tt>st640ihg.upp</tt></b>
<td>
<td>1440×720dpi
<td>
<td>grayscale, inkjet paper
<tr> <td>
<tr> <th align=left colspan=6>Epson Stylus Color 800, 64/180-inch weaving
<tr valign=top> <td>
<td><b><tt>stc800pl.upp</tt></b>
<td>
<td>360×360dpi
<td>
<td>32-bit CMYK, 64-pin, plain paper
<tr valign=top> <td>
<td><b><tt>stc800p.upp</tt></b>
<td>
<td>720×720dpi
<td>
<td>32-bit CMYK, 64-pin, plain paper
<tr valign=top> <td>
<td><b><tt>stc800ih.upp</tt></b>
<td>
<td>1440×720dpi
<td>
<td>32-bit CMYK, 62-pin, inkjet paper
<tr valign=top> <td>
<td><b><tt>stc1520.upp</tt></b>
<td>
<td>1440×720dpi
<td>
<td>32-bit CMYK, 62-pin, inkjet paper
<tr> <td>
<tr> <th align=left colspan=6>Sun raster file
<tr valign=top> <td>
<td><b><tt>ras1.upp</tt></b>
<td>
<td>1-bit
<td>
<td>monochrome (Ghostscript)
<tr valign=top> <td>
<td><b><tt>ras3.upp</tt></b>
<td>
<td>3-bit
<td>
<td>RGB (Ghostscript)
<tr valign=top> <td>
<td><b><tt>ras4.upp</tt></b>
<td>
<td>4-bit
<td>
<td>CMYK (Ghostscript)
<tr valign=top> <td>
<td><b><tt>ras8m.upp</tt></b>
<td>
<td>8-bit
<td>
<td>grayscale (Floyd-Steinberg)
<tr valign=top> <td>
<td><b><tt>ras24.upp</tt></b>
<td>
<td>24-bit
<td>
<td>RGB (Floyd-Steinberg)
<tr valign=top> <td>
<td><b><tt>ras32.upp</tt></b>
<td>
<td>32-bit
<td>
<td>CMYK (CMYK-Floyd-Steinberg)
</table></blockquote>
<p>
Thanks to Danilo Beuche, Guido Classen, Mark Goldberg and Hans-Heinrich
Viehmann for providing the files for the stc200, hp690, stc500 and the
stc640. Thanks to Michael Lossin <losse@germanymail.com> for the
newer st640 parameter sets.
<p>
Please note the following:
<blockquote><ul>
<li>Changing the resolution with Ghostscript's
<a href="Use.htm#Resolution_switch"><b><tt>-r</tt></b> switch</a> is
usually not possible.
<li>For Epson Stylus Color models not listed above, the two
<b><tt>stc500</tt></b> variants are likely to work in addition to
<b><tt>stcany</tt></b>, but their gamma correction might be wrong.
</ul></blockquote>
<h3><a name="Uni_state"></a>The state of this driver</h3>
<p>
The coding of <b><tt>uniprint</tt></b> was triggered by the requirements of
the various Stylus Color models and some personal needs for HP and NEC
drivers. Thus the Epson models are well represented among the distributed
parameter files. When this driver entered the beta test phase, three other
drivers appreared on the scene that could be at least partially integrated
into <b><tt>uniprint</tt></b>: <b><tt>cdj850</tt></b> by Uli Wortmann
(available at <a href="http://www.erdw.ethz.ch/~bonk/hp850/hp850.html">http://www.erdw.ethz.ch/~bonk/hp850/hp850.html</a>),
<b><tt>hpdj</tt></b> by Martin Lottermoser, and <b><tt>bjc610</tt></b> by
Helmut Riegler.
<p>
Uli addresses features of the more recent DeskJet models that will not be
available in <b><tt>uniprint</tt></b> soon. Martin taught me a lesson on
HP-PCL3 headers that will be available in <b><tt>uniprint</tt></b>
soon. Helmut in turn followed an almost similar idea, but targetted
primarily for printing on Canon printers from the pbmplus library. Starting
with version 1.68 of uniprint, BJC support is available. Work on the
<b><tt>hpdj</tt></b> integration will start after the update of my website.
<h3><a name="Uni_background"></a>Notes on <b><tt>uniprint</tt></b>'s background</h3>
<p>
<b><tt>uniprint</tt></b> is actually an update of <b><tt>stcolor</tt></b>,
but much more versatile than its predecessor; <b><tt>stcolor</tt></b>, in
its turn, started as a clone of the color DeskJet family of drivers
(<b><tt>cdj</tt></b>*). Finally, <b><tt>cdj</tt></b>* can be considered an
addition of features to the simpler monochrome drivers of Ghostscript. This
addition of features is useful to get an idea of the functionality of
<b><tt>uniprint</tt></b>:
<blockquote>
<dl>
<dt>Monochrome to advanced color (<b><tt>cdj</tt></b>*):
<dd>This adds color mapping and rendering functions to the driver.
Error diffusion is especially important for the quality of printing.
</dl>
<dl>
<dt>HP color to Epson Color (<b><tt>stcolor</tt></b>)
<dd>The Epson Stylus Color offered two features simultaneously: it could
produce 720×720dpi output and it could soak the paper. In other
words, it required more color management features inside the driver. This
is still the major conceptual difference in the data generation for HP and
Epson printers.
</dl>
<dl>
<dt>Weaving techniques (<b><tt>stcolor</tt></b>)
<dd>Besides the internal color management, the Stylus Color did not provide
enough buffer space to operate the printer fast at 720×720dpi. The
use of weaving could yield triple the print speed. Weaving, also called
interleaving, is present in some monochrome drivers too. The new thing in
<b><tt>stcolor</tt></b> was the combination with error diffusion.
Unfortunately the weaving was somehow hard-coded, as the problems with the
newer members of the Stylus Color family of printers demonstrated.
</dl>
<dl>
<dt>Generalized output format and weaving (<b><tt>uniprint</tt></b>)
<dd>The features mentioned above yield about 90% of
<b><tt>stcolor</tt></b>'s source code; only 10% is related to the
formatting of the output. The idea to make the output format switchable
came up soon after completing <b><tt>stcolor</tt></b>, but its final design
was triggered by the (personal) necessity to drive a NEC P2X and a
Designjet 750c.
</dl></blockquote>
<p>
Thus <b><tt>uniprint</tt></b> accumulates almost any features that can be
found among the other printer drivers, which clearly has some disadvantage
in processing speed -- true in particular of version 1.75, since it was
targetted for functionality, and several speed-gaining features were
(knowingly) omitted.
<p>
To summarize and to introduce the terms used in the description of the
parameters, the features of <b><tt>uniprint</tt></b> that can be
parameterized are:
<blockquote><ul>
<li>color mapping,
<li>color rendering (error diffusion or Floyd-Steinberg),
<li>output format, including
<li>weaving.
</ul></blockquote>
<h3><a name="Uni_make_pfile"></a>Godzilla's guide to the creation of Unified Printer Parameter (<b><tt>.upp</tt></b>) files</h3>
<p>
Here is one of the distributed parameter files (<b><tt>stc_l.upp</tt></b>)
with some added comments. Also see the section that describes
<a href="#Uni_all_parameters">all <b><tt>uniprint</tt></b>'s parameters in
brief</a>.
<pre>
-supModel="Epson Stylus Color I (and PRO Series), 360x360DpI, noWeave"
-sDEVICE=uniprint -- Select the driver
-dNOPAUSE -- Useful with printers
-dSAFER -- Provides some security
-dupColorModel=/DeviceCMYK -- Selects the color mapping
-dupRendering=/ErrorDiffusion -- Selects the color rendering
-dupOutputFormat=/EscP2 -- Selects the output format
-r360x360 -- Adjusts the resolution
-dupMargins="{ 9.0 39.96 9.0 9.0}" -- Establishes (L/B/R/T margins in points)
-dupComponentBits="{1 1 1 1}" -- Map: bits per component (default: 8)
-dupWeaveYPasses=4 -- Weave: Y-passes (default: 1)
-dupOutputPins=15 -- Format/weave: scans per Command
-dupBeginPageCommand="< -- Goes to the printer
1b40 1b40 -- ESC '@' ESC '@' -> dual reset
1b2847 0100 01 -- ESC '(' 'G' 1 0 1 -> graphics
1b2869 0100 00 -- ESC '(' 'i' 1 0 1 -> no HW weave
1b2855 0100 0A -- ESC '(' 'U' 1 0 10 -> 360dpi
1b5500 -- ESC 'U' 0 -> bidir print
1b2843 0200 0000 -- ESC '(' 'C' 2 0 xx -> page length
1b2863 0400 0000 0000 -- ESC '(' 'c' 4 0 xxxx -> margins
>" -- as it is, unless:
-dupAdjustPageLengthCommand -- Adjust page length in BOP requested
-dupAdjustTopMarginCommand -- Adjust top margin in BOP
-dupAdjustBottomMarginCommand -- Adjust bottom margin in BOP
-dupEndPageCommand="(\033@\014)" -- Last (but one) data to the printer
-dupAbortCommand="(\033@\15\12\12\12\12 Printout-Aborted\15\014)"
</pre>
<p>
That's short, and if one removes <b><tt>upWeaveYPasses</tt></b> and
<b><tt>upOutputPins</tt></b> it becomes shorter, almost
<b><tt>stcany.upp</tt></b>. This miniature size is because I am most
familiar with ESC/P2, and was able to add defaults for the omitted
parameters. Now a few notes about the parameters used in this example:
<ul>
<li><b><tt>upModel</tt></b> is a string serving as a comment (and nothing else).
<li><a href="Use.htm#Output_device"><b><tt>DEVICE</tt></b></a>,
<a href="Use.htm#NoPause"><b><tt>NOPAUSE</tt></b></a>, <a
href="Use.htm#Safer"><b><tt>SAFER</tt></b></a> are well-known Ghostscript
parameters described in the <a href="Use.htm">usage documentation</a>.
<li><b><tt>upColorModel</tt></b> is one of major <b><tt>uniprint</tt></b>
parameters: it selects the color mapping and in turn the PostScript color
model. It supports the devices <b><tt>/DeviceGray</tt></b>, <b><tt>/DeviceRGBW</tt></b>, <b><tt>/DeviceRGB</tt></b>, <b><tt>/DeviceCMYK</tt></b>, and <b><tt>/DeviceCMYKgenerate</tt></b>.
<li><b><tt>upRendering</tt></b> selects the (color) rendering, supporting
the values <b><tt>/ErrorDiffusion</tt></b> and <b><tt>/FSCMYK32</tt></b>.
<b><tt>/ErrorDiffusion</tt></b> is similar to <b><tt>fsmono</tt></b>,
<b><tt>fsrgb</tt></b> and <b><tt>fsx4</tt></b> of <b><tt>stcolor</tt></b>,
while <b><tt>/FSCMYK32</tt></b> is (almost) identical to
<b><tt>fscmyk</tt></b> and <b><tt>hscmyk</tt></b>, but is restricted to
32-bit data and should be used in conjunction with
<b><tt>/DeviceCMYKgenerate</tt></b>.
<li><b><tt>upOutputFormat</tt></b> selects the output method, supporting the values
<b><tt>/SunRaster</tt></b>, <b><tt>/Epson</tt></b>, <b><tt>/EscP2</tt></b>, <b><tt>/EscP2XY</tt></b>, and<b><tt>/Pcl</tt></b>.
<blockquote><table cellpadding=0 cellspacing=0>
<tr valign=top> <td><b><tt>/SunRaster</tt></b>
<td>
<td>creates Sun raster files and requires no other parameters
<tr valign=top> <td><b><tt>/Epson</tt></b>
<td>
<td>is used for the elderly ESC/P format (used by many printers)
<tr valign=top> <td><b><tt>/EscP2</tt></b>
<td>
<td>is used by more recent Epson printers (no X weaving supported)
<tr valign=top> <td><b><tt>/EscP2XY</tt></b>
<td>
<td>supports X-Weaving, used with 1440dpi printers and in <b><tt>stc2s_h</tt></b>
<tr valign=top> <td><b><tt>/Pcl</tt></b>
<td>
<td>HP PCL/RTL-style output formatter without weaving
</table></blockquote>
<li><b><tt>-r360x360</tt></b> is Ghostscript's standard
<a href="Use.htm#Resolution_switch">resolution switch</a>.
<li><b><tt>upMargins="{ 9.0 39.96 9.0 9.0}"</tt></b>
has function similar to the Ghostscript parameter
<b><tt>.HWMargins</tt></b>: it sets the left, bottom, right, and top
margins in points. <b><tt>uniprint</tt></b> provides this parameter to
enable automatic left-right exchange if <b><tt>upYFlip</tt></b> is active.
<li><b><tt>upComponentBits</tt></b> is an array of integers that selects
the bits stored in raster memory, by default 8 bits per component. In this
example, 1 bit is selected for each component, thus turning down the
Floyd-Steinberg algorithm (but still carrying out the time-consuming
computation). The related parameter "<b><tt>upComponentShift</tt></b>"
controls positioning the components within raster memory. Each of the
numbers given corresponds to a component which depends on the selected
"<b><tt>upColorModel</tt></b>":
<blockquote><table cellpadding=0 cellspacing=0>
<tr valign=top> <td align=center>
<td>
<td align=center><b><tt>/DeviceGray</tt></b>
<td>
<td align=center><b><tt>/DeviceRGBW</tt></b>
<td>
<td align=center><b><tt>/DeviceRGB</tt></b>
<td>
<td align=center><b><tt>/DeviceCMYK</tt></b>
<td>
<td align=center><b><tt>/DeviceCMYKgenerate</tt></b>
<tr> <td colspan=11><hr>
<tr valign=top> <td align=center>0
<td>
<td align=center>White
<td>
<td align=center>White
<td>
<td align=center>Red
<td>
<td align=center>Black
<td>
<td align=center>Black
<tr valign=top> <td align=center>1
<td>
<td align=center>--
<td>
<td align=center>Red
<td>
<td align=center>Green
<td>
<td align=center>Cyan
<td>
<td align=center>Cyan
<tr valign=top> <td align=center>2
<td>
<td align=center>--
<td>
<td align=center>Green
<td>
<td align=center>Blue
<td>
<td align=center>Magenta
<td>
<td align=center>Magenta
<tr valign=top> <td align=center>3
<td>
<td align=center>--
<td>
<td align=center>Blue
<td>
<td align=center>--
<td>
<td align=center>Yellow
<td>
<td align=center>Yellow
</table>
<p>
This order may not be suitable for some printers, so another parameter
"<b><tt>upOutputComponentOrder</tt></b>", also an array of integers,
selects the output order using the numbers on the left.
</blockquote>
<p>
One group of very important parameters not used in the example above
deserves to be mentioned here: the transfer arrays, named
"<b><tt>up</tt><em>{color}</em><tt>Transfer</tt></b>", where
<b><em>{color}</em></b> is one of the names in the table above. These are
arrays of floats in the range 0.0 - 1.0 representing the color transfer
functions. They are used during mapping and rendering. In the simplest
case, these arrays ensure an equidistant distribution of the stored values
within the device space (which means a nonlinear mapping from Ghostscript's
point of view). If the given array does not cover the entire range from 0
to 1, which applies for the Stylus Color family at high resolution for some
media, only the relevant part gets mapped to raster memory (meaning that
is's fully utilized) and the rendering takes care of the "overhang" (in
this case the post-diffusion of 1-bit components makes sense).
<p>
Finally an important note on the transfer arrays: for monochrome devices
the stored component is <b><tt>White</tt></b>, which is the way PostScript
defines these devices, but most printers require <b><tt>Black</tt></b>.
Thus one has to provide a falling "<b><tt>upWhiteTransfer</tt></b>" for
such printers.
<li><b><tt>upWeaveYPasses</tt></b> is an integer that gives the number of
print head passes required to achieve the requested Ydpi. This makes sense
only if
<li><b><tt>upOutputPins</tt></b> is set to something greater than 1. Thus
multiple pins or nozzles are transferred with a single command, and of
course such a command must be supported by the device.
</ul>
<p>
If no other weave parameters are given, <b><tt>uniprint</tt></b> computes
several defaults which together do no weaving. The <b><tt>/Epson</tt></b>
and <b><tt>/EscP2XY</tt></b> formats take care of
"<b><tt>upWeaveXPasses</tt></b>" too.
<ul>
<li><b><tt>upBeginPageCommand</tt></b> represents the data transferred to
the printer whenever a new page begins. Before that,
"<b><tt>upBeginJobCommand</tt></b>" is written to the device only once per
output file. (Intended for the HP PJL sequences).
<li><b><tt>upAdjustBottomMarginCommand</tt></b>,
<b><tt>upAdjustMediaSize</tt></b>,
<b><tt>upAdjustPageLengthCommand</tt></b>,
<b><tt>upAdjustPageWidthCommand</tt></b>,
<b><tt>upAdjustResolutionCommand</tt></b>, and
<b><tt>upAdjustTopMarginCommand</tt></b>
<p>
Normally <b><tt>uniprint</tt></b> does not change the
"<b><tt>upBeginPageCommand</tt></b>", nor does it provide a default.
However, if the above boolean values are set, the corresponding values are
changed (provided that the code of the formatters supports this change and
the commands to be adjusted are included in the BOP string).
<li><b><tt>upEndPageCommand</tt></b> is the fixed termination sequence for
each page, and of course there is an "<b><tt>upEndJobCommand</tt></b>" too.
<li><b><tt>upAbortCommand</tt></b> is written if <b><tt>uniprint</tt></b>'s
interrupt detection is enabled and a signal is caught. It replaces
"<b><tt>upEndPageCommand</tt></b>" and "<b><tt>upEndJobCommand</tt></b>",
thus allowing the indication of an aborted job. (Ghostscript gets an error
return from <b><tt>uniprint</tt></b> in this case, and abandons further
processing.)
</ul>
<p>
For the ESC/P(2) formats all commands represent binary data, while for
the PCL/RTL formatter some of them are formats for <b><tt>fprintf</tt></b>. These strings
<b><em>must</em></b> explicitly have a trailing "\0'.
<p>
I should write more, but the only recommendation is to
take a look at the various parameter files. Here are a few more hints.
<ul>
<li>If the Driver rejects a configuration, nothing happens until
<b><tt>showpage</tt></b>; then an error is raised and a message with
"CALL-REJECTED upd_print_page..." is printed on stderr.
<li><b><tt>uniprint</tt></b> has lots of messages that can be activated by
setting bits in the preprocessor macro <b><tt>UPD_MESSAGES</tt></b>. I
usually use the compile-time option <b><tt>-DUPD_MESSAGES=0x17</tt></b> for
configuration development. (For the semantics, check the
<b><tt>UPD_M_</tt></b> macros in the source.)
<li>A program "<b><tt>uninfo.ps</tt></b>" distributed with Ghostscript
displays interactively in alphabetical order the contents of the current
pagedevice dictionary. This includes any parameters generated or changed by
<b><tt>uniprint</tt></b>.
</ul>
<h3><a name="Uni_all_parameters"></a>All parameters in brief</h3>
<p>
This table gives a brief explanation of every parameter known to
<b><tt>uniprint</tt></b>, listing them in alphabetical order. "[ ]"
denotes that a parameter is an array, and "(RO)" that it is read-only.
<blockquote><table cellpadding=0 cellspacing=0>
<tr><th colspan=5 bgcolor="#CCCC00"><hr><font size="+1">All <b><tt>uniprint</tt></b> parameters</font><hr>
<tr valign=bottom>
<th align=left>Parameter
<td>
<th align=left>Type
<td>
<th align=left>Use
<tr> <td colspan=5><hr>
<tr valign=top> <td><b><tt>upAbortCommand</tt></b>
<td>
<td>String
<td>
<td>End of page and file on interrupt
<tr valign=top> <td><b><tt>upAdjustBottomMarginCommand</tt></b>
<td>
<td>Bool
<td>
<td>Manipulate bottom margin in <b><tt>upBeginPageCommand</tt></b>
<tr valign=top> <td><b><tt>upAdjustMediaSizeCommand</tt></b>
<td>
<td>Bool
<td>
<td>Manipulate <b><tt>Mediasize</tt></b> [intended]
<tr valign=top> <td><b><tt>upAdjustPageLengthCommand</tt></b>
<td>
<td>Bool
<td>
<td>Manipulate page length in <b><tt>upBeginPageCommand</tt></b>
<tr valign=top> <td><b><tt>upAdjustPageWidthCommand</tt></b>
<td>
<td>Bool
<td>
<td>Manipulate page width in <b><tt>upBeginPageCommand</tt></b>
<tr valign=top> <td><b><tt>upAdjustResolutionCommand</tt></b>
<td>
<td>Bool
<td>
<td>Manipulate resolution
<tr valign=top> <td><b><tt>upAdjustTopMarginCommand</tt></b>
<td>
<td>Bool
<td>
<td>Manipulate top margin in <b><tt>upBeginPageCommand</tt></b>
<tr valign=top> <td><b><tt>upBeginJobCommand</tt></b>
<td>
<td>String
<td>
<td>Begin each output file
<tr valign=top> <td><b><tt>upBeginPageCommand</tt></b>
<td>
<td>String
<td>
<td>Begin each page
<tr valign=top> <td><b><tt>upBlackTransfer</tt></b>
<td>
<td>Float[ ]
<td>
<td>Black transfer (CMYK only!)
<tr valign=top> <td><b><tt>upBlueTransfer</tt></b>
<td>
<td>Float[ ]
<td>
<td>Blue transfer
<tr valign=top> <td><b><tt>upColorInfo</tt></b>
<td>
<td>Int[ ]
<td>
<td>struct <b><tt>gx_device_color_info</tt></b>
<tr valign=top> <td><b><tt>upColorModel</tt></b>
<td>
<td>Name
<td>
<td>Select color mapping
<tr valign=top> <td><b><tt>upColorModelInitialized</tt></b>
<td>
<td>Bool (RO)
<td>
<td>Color mapping OK
<tr valign=top> <td><b><tt>upComponentBits</tt></b>
<td>
<td>Int[ ]
<td>
<td>Bits stored per component
<tr valign=top> <td><b><tt>upComponentShift</tt></b>
<td>
<td>Int[ ]
<td>
<td>Positioning within <b><tt>gx_color_index</tt></b>
<tr valign=top> <td><b><tt>upCyanTransfer</tt></b>
<td>
<td>Float[ ]
<td>
<td>Cyan transfer
<tr valign=top> <td><b><tt>upEndJobCommand</tt></b>
<td>
<td>String
<td>
<td>End each file unless <b><tt>upAbortCommand</tt></b>
<tr valign=top> <td><b><tt>upEndPageCommand</tt></b>
<td>
<td>String
<td>
<td>End each page unless <b><tt>upAbortCommand</tt></b>
<tr valign=top> <td><b><tt>upErrorDetected</tt></b>
<td>
<td>Bool (RO)
<td>
<td>Severe (VM) error, not fully operational
<tr valign=top> <td><b><tt>upFSFixedDirection</tt></b>
<td>
<td>Bool
<td>
<td>Inhbits direction toggling in rendering
<tr valign=top> <td><b><tt>upFSProcessWhiteSpace</tt></b>
<td>
<td>Bool
<td>
<td>Causes white-space rendering
<tr valign=top> <td><b><tt>upFSReverseDirection</tt></b>
<td>
<td>Bool
<td>
<td>Run rendering in reverse (if fixed)
<tr valign=top> <td><b><tt>upFSZeroInit</tt></b>
<td>
<td>Bool
<td>
<td>Non-random rendering initialization
<tr valign=top> <td><b><tt>upFormatXabsolute</tt></b>
<td>
<td>Bool
<td>
<td>Write absolute X coordinates
<tr valign=top> <td><b><tt>upFormatYabsolute</tt></b>
<td>
<td>Bool
<td>
<td>Write absolute Y coordinates
<tr valign=top> <td><b><tt>upGreenTransfer</tt></b>
<td>
<td>Float[ ]
<td>
<td>Green transfer
<tr valign=top> <td><b><tt>upMagentaTransfer</tt></b>
<td>
<td>Float[ ]
<td>
<td>Magenta transfer
<tr valign=top> <td><b><tt>upMargins</tt></b>
<td>
<td>Float[ ]
<td>
<td>L/B/R/T margins in points
<tr valign=top> <td><b><tt>upModel</tt></b>
<td>
<td>String
<td>
<td>Comment string, holds some info
<tr valign=top> <td><b><tt>upOutputAborted</tt></b>
<td>
<td>Bool (RO)
<td>
<td>Caught an interrupt
<tr valign=top> <td><b><tt>upOutputBuffers</tt></b>
<td>
<td>Int
<td>
<td>Number of rendering buffers (2^<small><sup><b>N</b></sup></small>)
<tr valign=top> <td><b><tt>upOutputComponentOrder</tt></b>
<td>
<td>Int[ ]
<td>
<td>Order of components when printing
<tr valign=top> <td><b><tt>upOutputComponents</tt></b>
<td>
<td>Int
<td>
<td>Number of written components, not fully operational
<tr valign=top> <td><b><tt>upOutputFormat</tt></b>
<td>
<td>Name
<td>
<td>Select output format
<tr valign=top> <td><b><tt>upOutputFormatInitialized</tt></b>
<td>
<td>Bool (RO)
<td>
<td>Format data OK
<tr valign=top> <td><b><tt>upOutputHeight</tt></b>
<td>
<td>Int
<td>
<td>Output height in pixels
<tr valign=top> <td><b><tt>upOutputPins</tt></b>
<td>
<td>Int
<td>
<td>Number of pins / nozzles per command
<tr valign=top> <td><b><tt>upOutputWidth</tt></b>
<td>
<td>Int
<td>
<td>Output width in pixels
<tr valign=top> <td><b><tt>upOutputXOffset</tt></b>
<td>
<td>Int
<td>
<td>Offset in pixels, if <b><tt>upFormatXabsolute</tt></b>
<tr valign=top> <td><b><tt>upOutputXStep</tt></b>
<td>
<td>Int
<td>
<td>Divisor or multiplier for X coords
<tr valign=top> <td><b><tt>upOutputYOffset</tt></b>
<td>
<td>Int
<td>
<td>Offset in pixels, if <b><tt>upFormatYabsolute</tt></b>
<tr valign=top> <td><b><tt>upOutputYStep</tt></b>
<td>
<td>Int
<td>
<td>Divisor or multiplier for Y coords
<tr valign=top> <td><b><tt>upRasterBufferInitialized</tt></b>
<td>
<td>Bool (RO)
<td>
<td>GS buffer OK
<tr valign=top> <td><b><tt>upRedTransfer</tt></b>
<td>
<td>Float[ ]
<td>
<td>Red transfer
<tr valign=top> <td><b><tt>upRendering</tt></b>
<td>
<td>Name
<td>
<td>Select rendering algorithm
<tr valign=top> <td><b><tt>upRenderingInitialized</tt></b>
<td>
<td>Bool (RO)
<td>
<td>Rendering parameters OK
<tr valign=top> <td><b><tt>upSelectComponentCommands</tt></b>
<td>
<td>String[ ]
<td>
<td>Establish color (output order!)
<tr valign=top> <td><b><tt>upSetLineFeedCommand</tt></b>
<td>
<td>String
<td>
<td>Adjust linefeed (Epson only)
<tr valign=top> <td><b><tt>upVersion</tt></b>
<td>
<td>String (RO)
<td>
<td>Source code version
<tr valign=top> <td><b><tt>upWeaveFinalPins</tt></b>
<td>
<td>Int[ ]
<td>
<td>Number of bottom pins on EOP passes
<tr valign=top> <td><b><tt>upWeaveFinalScan</tt></b>
<td>
<td>Int
<td>
<td>Begin EOP passes (Y-coord)
<tr valign=top> <td><b><tt>upWeaveFinalXStarts</tt></b>
<td>
<td>Int[ ]
<td>
<td>X-pass indices for EOP passes
<tr valign=top> <td><b><tt>upWeaveFinalYFeeds</tt></b>
<td>
<td>Int[ ]
<td>
<td>Y increments for EOP passes
<tr valign=top> <td><b><tt>upWeaveInitialPins</tt></b>
<td>
<td>Int[ ]
<td>
<td>Number of top pins on BOP passes
<tr valign=top> <td><b><tt>upWeaveInitialScan</tt></b>
<td>
<td>Int
<td>
<td>End BOP passes (Y coord)
<tr valign=top> <td><b><tt>upWeaveInitialXStarts</tt></b>
<td>
<td>Int[ ]
<td>
<td>X-pass indices for BOP passes
<tr valign=top> <td><b><tt>upWeaveInitialYFeeds</tt></b>
<td>
<td>int[ ]
<td>
<td>Y increments for BOP passes
<tr valign=top> <td><b><tt>upWeavePasses</tt></b>
<td>
<td>Int
<td>
<td>XPasses × YPasses
<tr valign=top> <td><b><tt>upWeaveXPasses</tt></b>
<td>
<td>Int
<td>
<td>Number of X passes
<tr valign=top> <td><b><tt>upWeaveXStarts</tt></b>
<td>
<td>Int[ ]
<td>
<td>X-pass indices for normal passes
<tr valign=top> <td><b><tt>upWeaveYFeeds</tt></b>
<td>
<td>Int[ ]
<td>
<td>Y increments for normal passes
<tr valign=top> <td><b><tt>upWeaveYOffset</tt></b>
<td>
<td>Int
<td>
<td>Number of blank or incomplete scans at BOP
<tr valign=top> <td><b><tt>upWeaveYPasses</tt></b>
<td>
<td>Int
<td>
<td>Number of X passes
<tr valign=top> <td><b><tt>upWhiteTransfer</tt></b>
<td>
<td>Float[ ]
<td>
<td>White transfer (monochrome devices!)
<tr valign=top> <td><b><tt>upWriteComponentCommands</tt></b>
<td>
<td>String[ ]
<td>
<td>Commands to write each component
<tr valign=top> <td><b><tt>upWroteData</tt></b>
<td>
<td>Bool (RO)
<td>
<td>Something (<b><tt>BeginJob</tt></b>) written to output
<tr valign=top> <td><b><tt>upXMoveCommand</tt></b>
<td>
<td>String
<td>
<td>X positioning command
<tr valign=top> <td><b><tt>upXStepCommand</tt></b>
<td>
<td>String
<td>
<td>Single step to the right
<tr valign=top> <td><b><tt>upYFlip</tt></b>
<td>
<td>Bool
<td>
<td>Flips output along the Y axis
<tr valign=top> <td><b><tt>upYMoveCommand</tt></b>
<td>
<td>String
<td>
<td>Y positioning command
<tr valign=top> <td><b><tt>upYStepCommand</tt></b>
<td>
<td>String
<td>
<td>Single step down
<tr valign=top> <td><b><tt>upYellowTransfer</tt></b>
<td>
<td>Float[ ]
<td>
<td>Yellow transfer
</table></blockquote>
<h3><a name="Uni_honors"></a><b><tt>uniprint</tt></b>'s Roll of Honor</h3>
<p>
I should mention all of the people who were involved in
<b><tt>stcolor</tt></b>'s evolution, but I've decided to start from scratch
here for <b><tt>uniprint</tt></b>:
<blockquote>
<dl>
<dt>John P. Beale
<dd>for testing the <b><tt>stc600</tt></b> modes
<dt>Bill Davidson
<dd>who triggered some weaving research and tested <b><tt>stc2s_h</tt></b>
<dt>L. Peter Deutsch
<dd>who triggered ease of configuration
<dt>Mark Goldberg
<dd>who prepared the <b><tt>stc500</tt></b> transfers
<dt>Scott F. Johnston and Scott J. Kramer
<dd>for testing the <b><tt>stc800</tt></b> modes
<dt>Martin Lottermoser
<dd>for his great commented H-P DeskJet driver
<dt>Helmut Riegler
<dd>for the BJC extension
<dt>Hans-Gerd Straeter
<dd>for some measured transfer curves and more
<dt>Uli Wortmann
<dd>for discussions and his <b><tt>cdj850</tt></b> driver
<dt>My family
<dd>for tolerating my printer-driver hacking
</dl>
</blockquote>
<address>
Gunther Hess<br>
Duesseldorfer Landstr. 16b<br>
D-47249 Duisburg<br>
Germany<br>
+49 203 376273 telephone (MET evening hours)<br>
<<a href="mailto:ghess@elmos.de">ghess@elmos.de</a>>
</address>
<h3><a name="Uni_weaving_howto"></a><tt>Uniprint</tt> weaving parameters howto</h3>
This section was contributed by Glenn Ramsey.<p>
<p>I wrote this because the documentation was very brief and I really struggled
with it for a while, but it is very simple once you understand what is going
on.
<p>This only describes how to work out the Y parameters, I haven't looked
at the X parameters yet.
<ol>
<li>
<b>Determine the nozzle geometry (upOutputPins)</b>
<p>
You need to know how many nozzles the printer has and the spacing between
them. Usually you can find this out from the printer manual, or the printer
supplier, but you may have to dissect a couple of printer output files
produced with the driver supplied with the printer. There is a utility
called escp2ras<a href="#escp2ras"><sup>*</sup></a> that will help with that.
Sometimes the term pin is used instead of nozzle but they mean the same thing.
<p>The number of nozzles will be the value assigned to the upOutputPins
parameter.
<p>Actually you don't have to print with all the pins available but for
the purpose of demonstration I'll assume that we are using them all.
<p>
<a name="escp2ras"></a>* escp2ras is available from Gunther Hess' page at <a href="http://www-md.e-technik.uni-rostock.de/ma/gunther/gs/index.html">http://www-md.e-technik.uni-rostock.de/ma/gunther/gs/index.html</a>
</li>
<p>
<li><b>Determine how many passes are required (upWeaveYPasses)</b>
<p>The number of passes required is going to depend on the required resolution
and the nozzle spacing.
<blockquote>
<tt>passes = resolution * nozzle spacing
</tt>
</blockquote>
This will be the value assigned to the upWeaveYPasses parameter.
<p>For example if the desired resolution is 360 dpi and the nozzles are
spaced at 1/90in then 360 * 1/90 = 4 passes are required. For 720 dpi 8
passes would be required. The printer would, of course, have to be capable
of moving the paper in increments of either 360 or 720 dpi too.
</li>
<p>
<li>
<b>Determine the normal Y feed increment (upWeaveYFeeds)</b>
<p>
You need to work out how much to feed the paper so that when the paper
has moved by one head length in however many passes you have then each
row space on the paper has been passed over by at least one nozzle. There
will be one feed value for each pass and the feed values must comply with
the following rules:
<blockquote>
<tt>
<p>sum of feeds = passes * nozzles
<br>feed%passes != 0 (feed is not exactly divisible by passes)
<br>sum of (nozzles - feed) = 0
</tt>
</blockquote>
<p>For example if passes=4 and nozzles=15, then sum of feeds=60. The feed
values could be 1,1,1,57 or 15,15,15,15 or 14,15,18,13.
<p>These values will be assigned to the upWeaveYFeeds parameter.
<p>You would need to experiment to see what combination looks best on the
printer.
<p>I found it convenient to draw several lines of nozzles and then move
them around to see how the different combinations would fill the paper.
A computer drawing tool makes this easier than pencil and paper (I used
Dia, a GNOME app). The number of nozzles would probably be be a good place
to start.
<p>Remember that if the number of passes is more than 1 then the feed increment
will be less than the nozzle spacing and <tt>passes × feed increment size</tt>
must equal the physical distance between each nozzle.
</li>
<p>
<li>
<b>Determine the beginning of page pins (upWeaveInitialPins)</b>
<p>
These values will be assigned to the upWeaveInitialPins parameter and are
the numbers of nozzles to operate in each of the initial passes at the top
of a page. The nozzles that the values refer to are the topmost nozzles
on the head, nearest the top margin. If the image doesn't start at the
top margin then uniprint doesn't use these feeds.
<p>I don't know a mathematical relation for this except that at least one
of the values must be the number of nozzles, but I'm sure that there must
be one. I used a graphical method, the description that follows refers
to the ascii diagram in below.
<p>Draw a line of nozzles for each pass arranged as they would be using
the normal Y feed increment determined in step 3. In the diagram below
this would be passes 5-8.
<p>Draw a line of nozzles that would print just before the first normal
pass. The feed increment for this pass will be close to and most likely
1 or 2 units less than the feed increment of the last normal pass. In the
example below this line is pass 4 and the feed increment is 13 whereas
the normal feed increment is 15.
<p>Draw each pass before that with a small feed increment so that if all
of the nozzles appearing above the first nozzle of the first normal pass
operate then all of the spaces will be filled. This feed increment is usually
1 except in cases where some jiggery pokery is going on to make the printer
print at an apparent higher resolution than the nozzle diameter.
<p>Now select the nozzles that will operate in each of theses initial passes
so that the paper is filled. In each pass the nozzles must be adjacent
to each other and at least one of the passes will have all the nozzles
operating. I suspect that for each combination of normal Y feed increments
there will only be one set of valid beginning of page increments.
</li>
</ol>
<h4>Example: stc.upp from Aladdin Ghostscript 6.01</h4>
15 nozzles spaced at 1/90 in, 360 dpi requires 4 passes.
<blockquote><tt><pre>
-dupWeaveYPasses=4
-dupOutputPins=15
-dupWeaveYFeeds="{15 15 15 15}"
-dupWeaveInitialYFeeds="{1 1 1 13}"
-dupWeaveInitialPins="{ 4 15 11 7}"
</pre></tt></blockquote>
The following diagram shows which nozzles operate during each pass.
<br>Passes 1-4 are beginning of page passes and passes 5-8 are normal passes.
<blockquote>
<p>x=nozzle operates, o=nozzle not used in this pass<tt></tt>
<p><tt> 1 2 3 4 5 6 7 8 - pass no</tt>
<br><tt>0 x</tt>
<br><tt>1 x</tt>
<br><tt>2 x</tt>
<br><tt>3 x</tt>
<br><tt>4 x</tt>
<br><tt>5 x</tt>
<br><tt>6 x</tt>
<br><tt>7 x</tt>
<br><tt>8 x</tt>
<br><tt>9 x</tt>
<br><tt>0 x</tt>
<br><tt>1 x</tt>
<br><tt>2 x</tt>
<br><tt>3 x</tt>
<br><tt>4 x</tt>
<br><tt>5 x</tt>
<br><tt>6 o x</tt>
<br><tt>7 x</tt>
<br><tt>8 x</tt>
<br><tt>9 x</tt>
<br><tt>0 o x</tt>
<br><tt>1 x</tt>
<br><tt>2 x</tt>
<br><tt>3 x</tt>
<br><tt>4 o x</tt>
<br><tt>5 x</tt>
<br><tt>6 x</tt>
<br><tt>7 x</tt>
<br><tt>8 o x</tt>
<br><tt>9 x</tt>
<br><tt>0 x</tt>
<br><tt>1 o x</tt>
<br><tt>2 o x</tt>
<br><tt>3 x</tt>
<br><tt>4 x</tt>
<br><tt>5 o x</tt>
<br><tt>6 o x</tt>
<br><tt>7 x</tt>
<br><tt>8 x</tt>
<br><tt>9 o x</tt>
<br><tt>0 o x</tt>
<br><tt>1 x</tt>
<br><tt>2 x</tt>
<br><tt>3 o x</tt>
<br><tt>4 o x</tt>
<br><tt>5 x</tt>
<br><tt>6 o
x</tt>
<br><tt>7 o x</tt>
<br><tt>8 o x</tt>
<br><tt>9 x</tt>
<br><tt>0 o
x</tt>
<br><tt>1 o x</tt>
<br><tt>2 o x</tt>
<br><tt>3 x</tt>
<br><tt>4 o
x</tt>
<br><tt>5 o x</tt>
<br><tt>6 o x</tt>
<br><tt>7 x</tt>
<br><tt>8 o
x</tt>
<br><tt>9 o x</tt>
<br><tt>0 x</tt>
<br><tt>1
x</tt>
<br><tt>2
x</tt>
<br><tt>3 x</tt>
<br><tt>4 x</tt>
<br><tt>5
x</tt>
<br><tt>6
x</tt>
<br><tt>7 x</tt>
<br><tt>8 x</tt>
<br><tt>9
x</tt>
<br><tt>0
x</tt>
<br><tt>1 x</tt>
<br><tt>2 x</tt>
<br><tt>3
x</tt>
<br><tt>4
x</tt>
<br><tt>5 x</tt>
<br><tt>6</tt>
<br><tt>7
x</tt>
<br><tt>8
x</tt>
<br><tt>9 x</tt>
<br><tt>0</tt>
<br><tt>1
x</tt>
<br><tt>2
x</tt>
<br><tt>3 x</tt>
<br><tt>4</tt>
<br><tt>5
x</tt>
<br><tt>6
x</tt>
<br><tt>7 x</tt>
<br><tt>8</tt>
<br><tt>9
x</tt>
<br><tt>0
x</tt>
<br><tt>1</tt>
<br><tt>2</tt>
<br><tt>3
x</tt>
<br><tt>4
x</tt>
<br><tt>5</tt>
<br><tt>6</tt>
<br><tt>7
x</tt>
<br><tt>8
x</tt>
<br><tt>9</tt>
<br><tt>0</tt>
<br><tt>1
x</tt>
<br><tt>2
x</tt>
<br><tt>3</tt>
<br><tt>4</tt>
<br><tt>5
x</tt>
<br><tt>6</tt>
<br><tt>7</tt>
<br><tt>8</tt>
<br><tt>9
x</tt>
<br><tt>0</tt>
<br><tt>1</tt>
<br><tt>2</tt>
<br><tt>3
x</tt>
<br><tt>4</tt>
<br><tt>5</tt>
<br><tt>6</tt>
<br><tt>7
x</tt>
</blockquote>
<p>These parameters would also work:
<blockquote><tt><pre>
-dupWeaveYPasses=4
-dupOutputPins=15
-dupWeaveYFeeds="{14 15 18 13}"
-dupWeaveInitialYFeeds="{1 1 1 13}"
-dupWeaveInitialPins="{ 4 11 7 15}"
</pre></tt></blockquote>
<p>
<hr>
<h3><a name="Uni_esc300"></a>Extension to <tt>uniprint</tt> for the Epson Stylus Color 300</h3>
This section was contributed by Glenn Ramsey.<p>
The Epson Stylus Color 300 uses a different command set to other Epson
Stylus Color printers that use the ESC/P2 language. As far as I can
tell its commands are a subset of ESC/P2. In ESC/P2 the colour to be
printed is selected by a 'set colour' command and then the data sent
is only printed in that colour until the colour is changed with another
'set colour' command. The Stylus Color 300 lacks this functionality.
The data sent to the printer maps directly to the ink nozzles and colour
of an output scan line in the printed output is determined by the position
of the scan line within the data. This means that the driver must know
how the nozzles are arranged and must format the output accordingly.
The extension adds a format that I have called EscNozzleMap and adds some
additional parameters to uniprint.<br>
<ul>
<li><b><tt>upOutputFormat</tt></b>selects the output method, and should be set to the value
<b><tt>/EscNozzleMap</tt></b> to select this format.
<blockquote>
<table cellpadding="0" cellspacing="0">
<tbody>
<tr valign="Top">
<td><b><tt>/EscNozzleMap</tt></b></td>
<td> </td>
<td>produces output for the Epson Stylus Color 300
</td>
</tr>
<tbody>
</table>
</blockquote>
</ul>
<blockquote>
<table cellpadding="0" cellspacing="0">
<tbody>
<tr>
<th colspan="5" bgcolor="#cccc00">
<hr><font size="+1"><b><tt>uniprint</tt></b> parameters for the
EscNozzleMap format</font>
<hr></th>
</tr>
<tr valign="Bottom">
<th align="Left">Parameter
</th>
<td>
</td>
<th align="Left">Type
</th>
<td>
</td>
<th align="Left">Use
</th>
</tr>
<tr>
<td colspan="5">
<hr></td>
</tr>
<tr valign="Top">
<td><b><tt>upNozzleMapRowsPerPass</tt></b></td>
<td>
</td>
<td>Int
</td>
<td>
</td>
<td>output rows to generate for each pass of the head
</td>
</tr>
<tr valign="Top">
<td><b><tt>upNozzleMapPatternRepeat</tt></b></td>
<td>
</td>
<td>Int
</td>
<td>
</td>
<td>no. of rows that correspond to the repeat pattern of the
nozzles
</td>
</tr>
<tr valign="Top">
<td><b><tt>upNozzleMapRowMask</tt></b></td>
<td>
</td>
<td>Int[]
</td>
<td>
</td>
<td>mask indicating the colour of the nozzles
</td>
</tr>
<tr valign="Top">
<td><b><tt>upNozzleMapMaskScanOffset</tt></b></td>
<td>
</td>
<td>Int[]
</td>
<td>
</td>
<td>mask indicating the physical position of the nozzles
</td>
</tr>
</tbody>
</table>
</blockquote>
<h4>A more detailed description of the new parameters</h4>
<ul>
<li><b><tt>upNozzleMapRowsPerPass</tt></b><br>
The number of rows of data that are required to address all nozzles for a
single pass of the head. There will always be this number of rows of output
data generated. I'd expect it to be the same as the total number of nozzles but
it wouldn't break the formatter if it wasn't. So if you wanted to print with
only the 10th nozzle then row 10 would contain data corresponding to the bit
pattern and all of the others would be padded with zeros.
</li>
<li><b><tt>upNozzleMapPatternRepeat</tt></b><br>
The number of nozzles in each repeated group on the printing head.
This parameter must correspond with the length of the upNozzleMapRowMask array.
</li>
<li><b><tt>upNozzleMapRowMask</tt></b><br>
An array of integers that defines the colour of the nozzles on the
head and whether the nozzles will be used to print. The array index
defines the row index for the nozzle in the output data
and the value defines the colour of the nozzle. The mapping
of colours to values is defined in the table below.
<blockquote>
<table cellpadding="0" cellspacing="0">
<tbody>
<tr valign="Bottom">
<th align="Left">colour
</th>
<td>
</td>
<th align="center">mask value
</th>
</tr>
<tr>
<td colspan="5">
<hr></td>
</tr>
<tr valign="Top" align="middle">
<td><b><tt>K</tt></b></td>
<td>
</td>
<td>1
</td>
</tr>
<tr valign="Top" align="middle">
<td><b><tt>C</tt></b></td>
<td>
</td>
<td>2
</tr>
<tr valign="Top" align="middle">
<td><b><tt>M</tt></b></td>
<td>
</td>
<td>3
</td>
</tr>
<tr valign="Top" align="middle">
<td><b><tt>Y</tt></b></td>
<td>
</td>
<td>4
</td>
</tr>
<tr valign="Top" align="middle">
<td><b><tt>no data</tt></b></td>
<td>
</td>
<td>0
</td>
</tr>
</tbody>
</table>
</blockquote>
A value of 0 means that the nozzle is not used and the row in the output data will be
padded with zeros.<br>
</li>
<li><b><tt>upNozzleMapMaskScanOffset</tt></b><br>
An array of integers that defines the physical position of the nozzles relative
to the first nozzle in the repeated group. The relative distance is measured in
printed line widths and will be different for different printing resolutions.
This parameter is used because the physical spacing of the nozzles may not
correspond to their mapping in the output data. For example the ESC300 has nozzles
physically arranged something like this:
<table>
<tr>
<td bgcolor="#00ffff">
</td>
<td bgcolor="#ffff00">
</td>
<td bgcolor="#000000">
</td>
<td bgcolor="#ff00ff">
</td>
<td bgcolor="#000000">
</td>
<td>
</td>
<td bgcolor="#000000">
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td bgcolor="#00ffff">
</td>
<td bgcolor="#ffff00">
</td>
<td bgcolor="#000000">
</td>
<td bgcolor="#ff00ff">
</td>
<td bgcolor="#000000">
</td>
<td>
</td>
<td bgcolor="#000000">
</td>
<td bgcolor="#ffffff">
</td>
</tr>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td bgcolor="#00ffff">
</td>
<td bgcolor="#ffff00">
</td>
<td bgcolor="#000000">
</td>
<td bgcolor="#ff00ff">
</td>
<td bgcolor="#000000">
</td>
<td>
</td>
<td bgcolor="#000000">
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td bgcolor="#00ffff">
</td>
<td bgcolor="#ffff00">
</td>
<td>etc ...
</td>
<tr>
</tr>
</table>
There is a one nozzle width space between the last two nozzles in each group.
In the output data the data for the last nozzle in the group would be in row 5
(numbering starts at 0) but the nozzle is physically positioned at 6 spaces from
the first nozzle.
</ul>
<h4>Example 1 - Epson Stylus Color 300 - 360 dpi colour</h4>
<blockquote><pre>
-dupWeaveYPasses=6
-dupOutputPins=11
-dupWeaveYFeeds="{ 11 11 11 11 11 11 }"
-dupWeaveInitialYFeeds="{ 1 1 1 1 1 7 }"
-dupWeaveInitialPins="{ 2 11 9 7 5 3 }"
-dupNozzleMapRowsPerPass=64
-dupNozzleMapPatternRepeat=6
-dupNozzleMapRowMask="{ 2 4 1 3 0 0 }"
-dupNozzleMapMaskScanOffset="{ 0 1 2 3 0 0 }"
</pre></blockquote>
The weaving parameters are the same as for any other uniprint driver
but they must be consistent with the nozzle map parameters. In this printer
the coloured nozzles are spaced at 1/60" so 6 passes are required for 360
dpi resolution.
<p>
In the example there are 64 rows of data required for each head pass. Each
row must be completely filled with data for each pass so if certain nozzles
do not print in the pass then the rows for those nozzles will be padded
with zeroes.
<P>
The row mask translates to "C Y K M 0 0" so in the output data rows 0,7,13,...
will contain data for cyan, rows 1,8,14,... will contain data for yellow, etc. Rows 4,10,16,...
and 5, 11,15,... will always be padded with zeroes. The <i>upNozzleMapPatternRepeat</i>
parameter defines the length of the mask.
<p>
The row mask is repeated for each group of <i>upNozzleMapPatternRepeat</i> rows
in the output data. In this case there are 64 rows so there will be 10 groups
of "C Y K M 0 0" followed by "C Y K M" which is equivalent to 11 output
pins.
<P>
The <i>upNozzleMaskScanOffset</i> array indicates how the data from the scan
buffer is mapped to the output data. The data is presented to the formatter
as a buffer of four colour scanlines. The index of the scanline being printed,
lets call it y, always corresponds, in this example, to the physical position of
the cyan nozzle but since the nozzles are not on the same horizontal
line then the other colours for the current pass must come from other
scanlines in the scan buffer. The example is { 0 1 2 3 0 0 }, this means that
when printing a 4 colour image the magenta data would come from scanline y+3,
the black from scanline y+2, etc. It would have been possible in this case
to use the array index instead of the <i>upNozzleMaskScanOffset</i> parameter
however the parameter is necessary to be able to use the full capability of the
printer in black only mode.
<h4>Example 2 - Epson Stylus Color 300 - 180 dpi black only</h4>
<blockquote>
<pre>
-dupMargins="{ 9.0 39.96 9.0 9.0}"
-dupWeaveYPasses=1
-dupOutputPins=31
-dupNozzleMapRowsPerPass=64
-dupNozzleMapPatternRepeat=6
-dupNozzleMapRowMask="{ 0 0 1 0 1 1}"
-dupNozzleMapMaskScanOffset="{ 0 0 0 0 1 2 }"
</pre>
</blockquote>
In this example there is no weaving.
<p>
The ESC300 has black nozzles evenly physically arranged as K K K but the data must
be sent to the printer as 00K0KK. This is handled by the <i>upNozzleMapRowMask</i>
and <i>upNozzleMaskScanOffset</i> arrays. The <i>upNozzleMapRowMask</i> array is
{ 0 0 1 0 1 1} which translates to { 0 0 K 0 K K } so rows 0, 1 and 3 will always
contain zeros and the other rows will contain data.
<p>
The <i>upNozzleMaskScanOffset</i> array
in this case is { 0 0 0 0 1 2 } so if the data for the 1st nozzle comes from row
y in the scan buffer then the data for the 2nd and 3rd nozzles will come from rows
y+1 and y+2.
<h4>Example 3 - Epson Stylus Color 300 - 360 dpi black only</h4>
<blockquote>
<pre>
-dupWeaveYPasses=2
-dupOutputPins=31
-dupWeaveYFeeds="{31 31}"
-dupWeaveInitialYFeeds="{1 31}"
-dupWeaveInitialPins="{16 31}"
-dupNozzleMapRowsPerPass=64
-dupNozzleMapPatternRepeat=6
-dupNozzleMapRowMask="{ 0 0 1 0 1 1}"
-dupNozzleMapMaskScanOffset="{ 0 0 0 0 2 4 }"
</pre>
</blockquote>
In this example 2 weave passes are required to achieve the desired resolution.
<p>
The <i>upNozzleMaskScanOffset</i> array in this case is { 0 0 0 0 2 4 } because
there are two weave passes so if the data for the first nozzle comes from row y
in the scan buffer then the data for the 2nd and 3rd nozzles must come from rows
y+(1*2) and y+(2*2).
<p>
<address>
Glenn Ramsey<br>
glennr at users.sourceforge.net<br>
February 2001
</address>
<br>
<hr>
<h2><a name="SPARCprinter"></a>Sun SPARCprinter</h2>
<p>
This section was contributed by Martin Schulte.
<p>
With a SPARCprinter you always buy software that enables you to do
PostScript printing on it. A page image is composed on the host, which
sends a bitmap to the SPARCprinter through a special SBUS video interface.
So the need for a Ghostscript interface to the SPARCPrinter seems low, but
on the other hand, Sun's software prints some PostScript drawings
incorrectly: some pages contain a thin vertical line of rubbish, and on
some Mathematica drawings the text at the axes isn't rotated. Ghostscript,
however, gives the correct results. Moreover, replacing proprietary
software should never be a bad idea.
<p>
The problem is that there has yet been no effort to make the SPARCPrinter
driver behave like a BSD output filter. I made my tests using the script
shown here.
<h3><a name="SPARC_install"></a>Installation</h3>
<p>
Add <b><tt>sparc.dev</tt></b> to <b><tt>DEVICE_DEVS</tt></b> and compile
Ghostscript as described in the documentation on <a href="Make.htm">how to
build Ghostscript</a>. Afterwards you can use the following script as an
example for printing after modifying it with the right pathnames --
including for <b>{GSPATH}</b> the full pathname of the Ghostscript
executable:
<blockquote>
<pre>outcmd1='/vol/local/lib/troff2/psxlate -r'
outcmd2='<b><em>{GSPATH}</em></b> -sDEVICE=sparc -sOUTPUTFILE=/dev/lpvi0 -'
if [ $# -eq 0 ]
then
$outcmd1 | $outcmd2
else
cat $* | $outcmd1 | $outcmd2
fi
</pre></blockquote>
<h3><a name="SPARC_problems"></a>Problems</h3>
<p>
Since <b><tt>/dev/lpi</tt></b> can be opened only for exclusive use, if
another job has it open (engine_ctl_sparc or another Ghostscript are the
most likely candidates), Ghostscript stops with "Error: /invalidfileaccess
in --.outputpage--"
<p>
In case of common printer problems like being out of paper, a warning
describing the reason is printed to stdout. The driver tries access again
each five seconds. Due to a problem with the device driver (in the kernel)
the reason for printer failure isn't always reported correctly to the
program. This is the case, for instance, if you open the top cover (error
E5 on the printer's display). Look at the display on the printer itself if
a "Printer problem with unknown reason" is reported. Fatal errors cause
the print job to be terminated.
<p>
Note: there is some confusion whether the resolution setting should be
the integers 300 and 400, or the symbolic constants DPI300 and DPI400
(defined in lpviio.h). Ghostscript releases have had it both ways. It
is currently the latter. However, INOUE Namihiko reports (in
SourceForge bug #215256) that the former works better for him. If anyone
has a definitive answer, please let us know.
<hr>
<h2><a name="Apple"></a>Apple dot matrix printer</h2>
<p>
This section was contributed by Mark Wedel
<<a href="mailto:master@cats.ucsc.edu">master@cats.ucsc.edu</a>>.
<p>
The Apple Dot Matrix Printer (DMP) was a parallel predecessor to the
Imagewriter printer. As far as I know, Imagewriter commands are a superset
of the Dot Matrix printer's, so the driver should generate output that can
be printed on Imagewriters.
<p>
To print images, the driver sets the printer for unidirectional printing
and 15 characters per inch (cpi), or 120dpi. It sets the line feed to 1/9
inch. When finished, it sets the printer to bidirectional printing,
1/8-inch line feeds, and 12 cpi. There appears to be no way to reset the
printer to initial values.
<p>
This code does not set for 8-bit characters (which is required). It also
assumes that carriage return-newline is needed, and not just carriage
return. These are all switch settings on the DMP, and I have configured
them for 8-bit data and carriage return exclusively. Ensure that the Unix
printer daemon handles 8-bit (binary) data properly; in my SunOS 4.1.1
<b><tt>printcap</tt></b> file the string "<b><tt>ms=pass8,-opost</tt></b>"
works fine for this.
<p>
Finally, you can search <b><tt>devdemp.c</tt></b> for
"<b><tt>Init</tt></b>" and "<b><tt>Reset</tt></b>" to find the strings that
initialize the printer and reset things when finished, and change them to
meet your needs.
<!-- [2.0 end contents] ==================================================== -->
<!-- [3.0 begin visible trailer] =========================================== -->
<hr>
<p>
<small>Copyright © 1996, 2000 Aladdin Enterprises.
All rights reserved.</small>
<p>
This software is provided AS-IS with no warranty, either express or
implied.
This software is distributed under license and may not be copied,
modified or distributed except as expressly authorized under the terms
of the license contained in the file LICENSE in this distribution.
For more information about licensing, please refer to
http://www.ghostscript.com/licensing/. For information on
commercial licensing, go to http://www.artifex.com/licensing/ or
contact Artifex Software, Inc., 101 Lucas Valley Road #110,
San Rafael, CA 94903, U.S.A., +1(415)492-9861.
<p>
<small>Ghostscript version 7.21, 8 July 2002
<!-- [3.0 end visible trailer] ============================================= -->
</body>
</html>
|