summaryrefslogtreecommitdiff
blob: 68227e5e77fbcb6f2f6a73e808bccf91fbf43a7f (plain)
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
<!doctype html>
<html lang="en">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <meta name="viewport" content="user-scalable=yes, initial-scale=1, width=device-width">
    <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
    <link rel="shortcut icon" href="images/favicon.svg">
    <title>How to Use Ghostscript</title>
    <link href="default.css" rel="stylesheet" type="text/css">
</head>

<body>
    <header><div class="title"><a href="index.html"><h1 aria-label="title">Ghostscript documentation</h1><h2 aria-label="version"></h2></a></div><a href="Search.htm" aria-label="Search" id="searchSite"><div class="search"></div></a></header>
    <main>
        <article>
            <div class="outer">

                <div class="inner">
<!--START EDITING HERE-->

<h1>How to Use Ghostscript</h1>

<h2><a name="toc"></a>Table of contents</h2>
<ul class="toc">
    <li><a href="#Invoking">Invoking Ghostscript</a></li>
    <li>
        <ul>
            <li><a href="#Help_command">Help at the command line: <code>gs -h</code></a></li>
        </ul>
    </li>
    <li><a href="#Output_device">Selecting an output device</a></li>
    <li>
        <ul>
            <li><a href="#Output_resolution">Output resolution</a></li>
            <li><a href="#File_output">Output to files</a></li>
            <li>
                <ul>
                    <li><a href="#One_page_per_file">One page per file</a></li>
                </ul>
            </li>
            <li><a href="#Paper_size">Choosing paper size</a></li>
            <li><a href="#Change_default_size">Changing the installed default paper size</a></li>
        </ul>
    </li>
    <li><a href="#Pipes">Interacting with pipes</a></li>
    <li><a href="#PDF">Using Ghostscript with PDF files</a></li>
    <li>
        <ul>
            <li><a href="#PDF_switches">Switches for PDF files</a></li>
            <li><a href="#PDF_problems">Problems interpreting a PDF file</a></li>
            <li><a href="#PDF_stdin">PDF files from standard input</a></li>
        </ul>
    </li>
    <li><a href="#EPS">Using Ghostscript with EPS files</a></li>
    <li><a href="#SPOT">Using Ghostscript with overprinting and spot colors</a></li>
    <li><a href="#Finding_files">How Ghostscript finds files</a></li>
    <li>
        <ul>
            <li><a href="#PS_resources">Finding PostScript Level 2 resources</a></li>
            <li><a href="#Font_lookup">Font lookup</a></li>
            <li><a href="#CIDFonts">CID fonts</a></li>
            <li><a href="#CIDFontSubstitution">CID font substitution</a></li>
            <li><a href="#UnicodeTT">Using Unicode True Type fonts</a></li>
            <li><a href="#Temp_files">Temporary files</a></li>
        </ul>
    </li>
    <li><a href="#Platforms">Notes on specific platforms</a></li>
    <li>
        <ul>
            <li><a href="#Word size">Word size (32 or 64 bits)</a></li>
            <li><a href="#Unix">Unix</a></li>
            <li><a href="#VMS">VMS</a></li>
            <li>
                <ul>
                    <li><a href="#VMS_X_Windows">Using X Windows on VMS</a></li>
                </ul>
            </li>
            <li><a href="#MS_Windows">MS Windows</a></li>
            <li><a href="#X_Windows">X Windows</a></li>
            <li>
                <ul>
                    <li><a href="#X_resources">X resources</a></li>
                    <li><a href="#X_server_bugs">Working around bugs in X servers</a></li>
                    <li><a href="#X_device_parameters">X device parameters</a></li>
                </ul>
            </li>
            <li><a href="#SCO_Unix">SCO Unix</a></li>
        </ul>
    </li>

    <li><a href="#Options">Command line options</a></li>
    <li>
        <ul>
            <li><a href="#General_switches">General switches</a></li>
            <li>
                <ul>
                    <li><a href="#Input_control">Input control</a></li>
                    <li><a href="#File_searching">File searching</a></li>
                    <li><a href="#Parameters">Setting parameters</a></li>
                    <li><a href="#Quiet">Suppress messages</a></li>
                </ul>
            </li>
            <li><a href="#Parameter_switches">Parameter switches (<code>-d</code> and <code>-s</code>)</a></li>
            <li>
                <ul>
                    <li><a href="#Rendering_parameters">Rendering parameters</a></li>
                    <li><a href="#Page_parameters">Page parameters</a></li>
                    <li><a href="#Font_related_parameters">Font-related parameters</a></li>
                    <li><a href="#Resource_related_parameters">Resource-related parameters</a></li>
                    <li><a href="#Interaction_related_parameters">Interaction-related parameters</a></li>
                    <li><a href="#Output_selection_parameters">Device and output selection parameters</a></li>
                    <li><a href="#EPS_parameters">EPS parameters</a></li>
                    <li><a href="#Deferred_Page_Rendering">Deferred Page Rendering</a></li>
                    <li><a href="#ICC_color_parameters">ICC color parameters</a></li>
                    <li><a href="#Other_parameters">Other parameters</a></li>
                </ul>
            </li>
        </ul>
    </li>
    <li><a href="#Improving_performance">Improving performance</a></li>
    <li><a href="#Environment_variables">Summary of environment variables</a></li>

    <li><a href="#Debugging">Debugging</a></li>
    <li>
        <ul>
            <li><a href="#Debug_switches">Debug Switches</a></li>
            <li><a href="#Visual_trace">Visual Trace</a></li>
        </ul>
    </li>
    <li><a href="#Known_paper_sizes">Appendix: Paper sizes known to Ghostscript</a></li>
    <li><a href="#X_font_mappings">Appendix: X default font mappings</a></li>
    <li>
        <ul>
            <li><a href="#Standard_X_server_fonts">Standard X servers</a></li>
            <li>
                <ul>
                    <li><a href="#X_regular_fonts">Regular fonts</a></li>
                    <li><a href="#X_symbol_fonts">Symbol fonts</a></li>
                    <li><a href="#X_dingbat_fonts">Dingbat fonts</a></li>
                </ul>
            </li>
            <li><a href="#OpenWindows_fonts">Sun OpenWindows</a></li>
        </ul>
    </li>
    <li><a href="#FAPI_run">Appendix: Running Ghostscript with third-party
    font renderers</a></li>

</ul>

<!-- [1.2 end table of contents] =========================================== -->

<!-- [1.3 begin hint] ====================================================== -->

<p>For other information, see the <a href="Readme.htm">Ghostscript
overview</a> and, if necessary, how to
    <a href="Install.htm">install Ghostscript</a>.</p>

<!-- [1.3 end hint] ======================================================== -->

<hr>

<!-- [1.0 end visible header] ============================================== -->

<!-- [2.0 begin contents] ================================================== -->

<h2><a name="Invoking"></a>Invoking Ghostscript</h2>

<p>This document describes how to use the command line Ghostscript client.
Ghostscript is also used as a general engine inside other applications (for viewing files for example).
Please refer to the documentation for those applications for using Ghostscript in other contexts.</p>

<p><a name="Command_line"></a> The command line to invoke Ghostscript is
essentially the same on all systems, although the name of the executable
program itself may differ among systems.  For instance, to invoke
Ghostscript on unix-like systems type:</p>

<blockquote>
        <pre><code>gs</code> [options] {filename 1} ... [options] {filename <em>N</em>} ...
</pre></blockquote>

<p>Here are some basic examples. The details of how these work are described below.</p>

<p>To view a file:</p>
<blockquote><pre>gs -dSAFER -dBATCH document.pdf</pre></blockquote>
<p>You'll be prompted to press <em>return</em> between pages.</p>

<p>To convert a figure to an image file:</p>
<blockquote><pre>gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=png16m -dGraphicsAlphaBits=4 \
    -sOutputFile=tiger.png tiger.eps</pre></blockquote>

<p>To render the same image at 300 dpi:</p>
<blockquote><pre>gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=png16m -r300 \
                -sOutputFile=tiger_300.png tiger.eps
</pre></blockquote>

<p>To render a figure in grayscale:</p>
<blockquote><pre>gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pnggray -sOutputFile=figure.png figure.pdf
</pre></blockquote>

<p>To rasterize a whole document:</p>
<blockquote><pre>gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pgmraw -r150 \
                -dTextAlphaBits=4 -sOutputFile='paper-%00d.pgm' paper.ps</pre></blockquote>

<p>There are also a number of utility scripts for common to convert a PostScript document to PDF:</p>
<blockquote><pre>ps2pdf file.ps</pre></blockquote>
<p>The output is saved as file.pdf.</p>

<p>There are other utility scripts besides <code>ps2pdf</code>, including <code>pdf2ps</code>, <code>ps2epsi</code>, <code>pdf2dsc</code>, <code>ps2ascii</code>,
<code>ps2ps</code> and <code>ps2ps2</code>. These just call Ghostscript with the appropriate
(if complicated) set of options. You can use the 'ps2' set with eps files.</p>

<p>
Ghostscript is capable of interpreting PostScript, encapsulated PostScript
(EPS), DOS EPS (EPSF), and Adobe Portable Document Format (PDF).  The interpreter reads and executes the files in sequence, using the method described under "<a href="#File_searching">File searching</a>" to find them.</p>

<p>The interpreter runs in interactive mode by default. After processing the files given on the command line (if any) it reads further lines of PostScript language commands from the primary input stream, normally the keyboard, interpreting each line separately. To quit the interpreter, type "<code>quit</code>". The <code>-dBATCH -dNOPAUSE</code> options in the examples above disable the interactive prompting. The interpreter also quits gracefully if it encounters end-of-file or control-C.</p>

<p>
The interpreter recognizes many options. An option may appear anywhere in the command line, and applies to all files named after it on the line. Many of them include "<code>=</code>"
followed by a parameter. The most important are described in detail here. Please see the reference sections on <a href="#Options">options</a> and <a href="Devices.htm">devices</a> for a more complete listing.</p>

<h3><a name="Help_command"></a>Help at the command line: <code>gs -h</code></h3>

<p>
You can get a brief help message by invoking Ghostscript with the
<code>-h</code> or <code>-?</code> switch, like this:</p>

<blockquote><pre>
gs -h
gs -?
</pre></blockquote>

<p>
The message shows for that version of the Ghostscript executable:</p>

<ul>
<li>the version and release information</li>
<li>the general format of the command line</li>
<li>a few of the most useful options</li>
<li>the formats it can interpret</li>
<li>the available output devices</li>
<li>the search path</li>
<li>the bug report address</li>
</ul>

<p>
On other systems the executable may have a different name:</p>

<blockquote><table>
<tr>
    <th align="left">System</th>
    <th align="left">Invocation Name</th></tr>
<tr><td>Unix</td>
    <td><code>gs</code></td></tr>
<tr><td>VMS</td>
    <td><code>gs</code></td></tr>
<tr><td>MS Windows 95 and later</td>
    <td><code>gswin32.exe</code><br/>
    <code>gswin32c.exe</code><br/>
    <code>gswin64.exe</code><br/>
    <code>gswin64c.exe</code></td>
</tr>
<tr><td>OS/2</td>
    <td><code>gsos2</code></td></tr>
</table></blockquote>
<p>On Windows, the two digit number indicates the word length of the system for which the binary was built (so
<code>gswin32.exe</code> is for x86 Windows systems, whilst <code>gswin64.exe</code> is for x86_64 Windows
systems). And the <code>&quot;c&quot;</code> suffix indicates a Windows console based binary (note that the
<code>&quot;display device&quot;</code> window will still appear).
<hr>
<h2><a name="Output_device"></a>Selecting an output device</h2>

<p>
Ghostscript has a notion of 'output devices' which handle saving or displaying the results in a particular format. Ghostscript comes with a diverse variety of such devices supporting vector and raster file output, screen display, driving various printers and communicating with other applications.</p>

<p>
The command line option '<code>-sDEVICE=</code><em>device</em>' selects which output device Ghostscript should use. If this option isn't given the default device (usually a display device) is used. Ghostscript's built-in help message (<code>gs&nbsp;-h</code>) lists the available output devices. For complete description of the devices distributed with Ghostscript and their options, please see the <a href="Devices.htm">devices section</a> of the documentation.</p>

<p><a name="Device_output"></a>
Note that this switch must precede the name of the first input file, and
only its first use has any effect.  For example, for printer output in a
configuration that includes an Epson printer driver, instead of just
<code>'gs&nbsp;myfile.ps'</code> you might use</p>

<blockquote>
        <code>gs -sDEVICE=epson myfile.ps</code>
</blockquote>

<p><a name="GS_DEVICE"></a>
The output device can also be set through the <code>GS_DEVICE</code> environment variable.</p>

<p>
Once you invoke Ghostscript you can also find out what devices are available by typing
'<code>devicenames&nbsp;==</code>' at the interactive prompt.
You can set the output device and process a file from the interactive prompt as well:</p>


<blockquote><pre>
(epson) selectdevice
(myfile.ps) run
</pre></blockquote>

<p>All output then goes to the Epson printer instead of the display until you
do something to change devices.  You can switch devices at any time by
using the <code>selectdevice</code> procedure, for
instance like one of these:</p>

<blockquote><pre>
(x11alpha) selectdevice
(epson) selectdevice
</pre></blockquote>

<h3><a name="Output_resolution"></a>Output resolution</h3>

<p>
Some printers can print at several different resolutions, letting you
balance resolution against printing speed.  To select the resolution on
such a printer, use the <code>-r</code> switch:</p>

<blockquote>
        <code>gs -sDEVICE=</code><em>printer</em><code> -r</code><em>XRES</em><code>x</code><em>YRES</em>
</blockquote>

<p>where <em>XRES</em> and <em>YRES</em> are the requested number of dots (or pixels) per inch. Where the two resolutions are same, as is the common case, you can simply use <code>-r</code><em>res</em>.</p>

<p>
The <code>-r</code> option is also useful for controlling the density of pixels when rasterizing to an image file. It is used this way in the examples at the beginning of this document.</p>

<h3><a name="File_output"></a>Output to files</h3>

<p>
Ghostscript also allows you to control where it sends its output. With a display device this isn't necessary as the device handles presenting the output on screen internally. Some specialized printer drivers operate this way as well, but most devices are general and need to be directed to a particular file or printer.</p>

<p>
To send the output to a file, use the <code>-sOutputFile=</code> switch or the <a href="#o_option"><code>-o</code> switch</a> (below).
For instance, to direct all output into the file <code>ABC.xyz</code>, use</p>

<blockquote><code>
gs -sOutputFile=ABC.xyz
</code></blockquote>

<p>
When printing on MS Windows systems, output normally goes directly to the printer, <code>PRN</code>. On Unix and VMS systems it normally goes to a temporary file which is sent to the printer in a separate step. When using Ghostscript as a file rasterizer (converting PostScript or PDF to a raster image format) you will of course want to specify an appropriately named file for the output.</p>

<p>
Ghostscript also accepts the special filename '<code>-</code>' which indicates the output should be written to standard output (the command shell).</p>

<p>
Be aware that filenames beginning with the character <code>%</code> have a special meaning in PostScript. If you need to specify a file name that actually
begins with <code>%</code>, you must prepend the <code>%os%</code> filedevice explicitly. For example to output to a file named <code>%abc</code>, you need to specify</p>

<blockquote>
<code>gs -sOutputFile=%os%%abc</code>
</blockquote>

<p>Please see <a href="Language.htm">Ghostscript and the PostScript Language</a> and the PostScript Language Reference Manual for more details on <code>%</code> and filedevices.</p>

<p><b>
Note that on MS Windows systems, the <code>%</code> character also has a special meaning for the command processor (shell), so you will have to double it.</b></p>

<blockquote>
<code>gs -sOutputFile=%%os%%%%abc</code> (on MS Windows)
</blockquote>

<p><b>
Note, some devices (e.g. pdfwrite, ps2write, ...) only write the output file
upon exit, but changing the OutputFile device parameter will cause these
devices to emit the pages received up to that point and then open the new
file name given by OutputFile.
</b></p>
<p>
For example, in order to create two PDF files from a single invocation of
ghostscript the following can be used:</p>
<blockquote>
<code>gs -sDEVICE=pdfwrite -o tiger.pdf examples/tiger.eps -c "<< /OutputFile (colorcir.pdf) >> setpagedevice" -f examples/colorcir.ps</code>
</blockquote>

<h4><a name="One_page_per_file"></a>One page per file</h4>

<p>
Specifying a single output file works fine for printing and rasterizing
figures, but sometimes you want images of each page of a multi-page
document. You can tell Ghostscript to put each page of output in a
series of similarly named files. To do this place a template
'<code>%d</code>' in the filename which Ghostscript will replace with the
page number.</p>

<p>
<b>Note: Since the <code>%</code> character is used to precede the page number
format specification, in order to represent a file name that contains a <code>%</code>,
double <code>%</code> characters must be used. For example for the file <code>my%foo</code>
the OutputFile string needs to be <code>my%%foo</code>.</b></p>

<p>
The format can in fact be more involved than a simple '<code>%d</code>'.
The format specifier is of a form similar to the C <code>printf</code> format.
The general form supported is:</p>
<pre><code>            %[flags][width][.precision][l]type

    where:  flags    is one of:  #+-
            type     is one of:  diuoxX
</code></pre>

<p>For more information, please refer to documentation on the C printf format
specifications. Some examples are:</p>

<blockquote><dl>
    <dt><code>-sOutputFile=ABC-%d.png</code></dt>
    <dd>produces '<code>ABC-1.png</code>', ... , '<code>ABC-10.png</code>', ..</dd>
    <dt><code>-sOutputFile=ABC-%03d.pgm</code></dt>
    <dd>produces '<code>ABC-001.pgm</code>', ... , '<code>ABC-010.pgm</code>', ...</dd>
    <dt><code>-sOutputFile=ABC_p%04d.tiff</code></dt>
<dd>produces '<code>ABC_p0001.tiff</code>', ... , '<code>ABC_p0510.tiff</code>', ... , '<code>ABC_p5238.tiff</code>'</dd>
</dl></blockquote>


<p><b>
Note, however that the one page per file feature may not supported by all devices.
Also, since some devices write output files when opened, there may be an extra
blank page written (pdfwrite, ps2write, eps2write, pxlmono, pxlcolor, ...).
</b></p>

<p>
As noted above, when using MS Windows console (command.com or cmd.exe), you
will have to double the <code>%</code> character since the <code>%</code> is used by
that shell to prefix variables for substitution, e.g.,</p>

<blockquote><code>
gswin32c -sOutputFile=ABC%%03d.xyz
</code></blockquote>

<h4><a name="o_option"></a>-o option:</h4>
<p>
As a convenient shorthand you can use the <code>-o</code> option followed by the output
file specification as discussed above. The <code>-o</code> option also sets the
<a href="#Interaction_related_parameters"><code>-dBATCH</code> and <code>-dNOPAUSE</code> options</a>.
This is intended to be a quick way to invoke ghostscript to convert one or more
input files.</p>

<p>For instance, to convert somefile.ps to JPEG image files, one per page, use:</p>

<blockquote><code>
gs -sDEVICE=jpeg -o out-%d.jpg somefile.ps
</code></blockquote>

<p>is equivalent to:</p>

<blockquote><code>
gs -sDEVICE=jpeg -sOutputFile=out-%d.jpg -dBATCH -dNOPAUSE somefile.ps
</code></blockquote>

<h3><a name="Paper_size"></a>Choosing paper size</h3>

<p>
Ghostscript is distributed configured to use U.S. letter paper as its
default page size.  There are two ways to select other paper sizes from the
command line:</p>

<ul>

<li>
If the desired paper size is listed in the section on <a
href="#Known_paper_sizes">paper sizes known to Ghostscript</a> below, you
can select it as the default paper size for a single invocation of
Ghostscript by using the <code>-sPAPERSIZE=</code> switch, for instance:<p>


<blockquote><code>
-sPAPERSIZE=a4<br>
-sPAPERSIZE=legal
</code></blockquote>
</li>

<li>
Otherwise you can set the page size using the
pair of switches:<p>


<blockquote>
<code>-dDEVICEWIDTHPOINTS=</code><em>w</em>
<code>-dDEVICEHEIGHTPOINTS=</code><em>h</em>
</blockquote>

<p>Where <em>w</em> be the desired paper width and <em>h</em> be the
desired paper height in <em>points</em> (units of 1/72 of an inch).</p>
</li>
</ul>

<p>
Individual documents can (and often do) specify a paper size, which takes
precedence over the default size.  To force a specific paper size and
ignore the paper size specified in the document, select a paper size as
just described, and also include the
<a href="#FIXEDMEDIA"><code>-dFIXEDMEDIA</code> switch</a> on the
command line.</p>

<p>
The default set of paper sizes will be included in the <code>currentpagedevice</code>
in the <code>InputAttributes</code> dictionary with each paper size as
one of the entries. The last entry in the dictionary (which has numeric keys)
is a non-standard (Ghostscript extension) type of PageSize where the array
has four elements rather than the standard two elements. This four element
array represents a page size range where the first two elements are the lower
bound of the range and the second two are the upper bound. By default these
are [0, 0] for the lower bound and [16#fffff, 16#fffff] for the upper bound.</p>
<p>
The range type of PageSize is intended to allow flexible page size sepcification
for non-printer file formats such as JPEG, PNG, TIFF, EPS, ...</p>
<p>
For actual printers, either the entire <code>InputAttributes</code> dictionary
should be replaced or the range type entry should not be included. To simplify
using the default page sizes in the <code>InputAttributes</code> dictionary,
the command line option <code>-dNORANGEPAGESIZE</code> can be used. Using
this option will result in automatic rotation of the document page if the requested
page size matches one of the default page sizes.</p>

<p>
When the <a href="#FIXEDMEDIA"><code>-dFIXEDMEDIA</code> switch</a> is given on the
command line, the  <code>InputAttributes</code> dictionary will only be populated
with the single page size. This allows the <code>-dPSFitPage</code> option to fit
the page size requested in a PostScript file to be rotated, scaled and centered
for the best fit on the specified page.</p>

<h3><a name="Change_default_size"></a>Changing the installed default paper size</h3>

<p>
You can change the installed default paper size on an installed version of Ghostscript, by editing the initialization file <code>gs_init.ps</code>.
This file is usually in the <code>Resource/Init</code> directory somewhere in the search path. See the section on <a href="#Finding_files">finding files</a> for details.</p>

<p>
Find the line</p>

<blockquote><pre>
% /DEFAULTPAPERSIZE (a4) def
</pre></blockquote>

<p>
Then to make A4 the default paper size, uncomment the line to change
this to</p>

<blockquote><pre>
/DEFAULTPAPERSIZE (a4) def
</pre></blockquote>

<p>
For <code>a4</code> you can substitute any
<a href="#Known_paper_sizes">paper size Ghostscript knows</a>.</p>

<p>
This supecedes the previous method of uncommenting the line
<code>% (a4) ...</code>.</p>

<p>
Sometimes the initialization files are compiled into Ghostscript and cannot be changed.</p>

<p>
On Windows and some Linux builds, the default paper size will be
selected to be a4 or letter depending
on the locale.</p>
<hr>
<h2><a name="Pipes"></a>Interacting with pipes</h2>

<p>
As noted above, input files are normally specified on the command
line.  However, one can also "pipe" input into Ghostscript from another
program by using the special file name '<code>-</code>' which is interpreted as standard input. Examples:</p>

<blockquote>
{<em>some program producing ps</em>} <code>| gs</code> [options] <code>-</code>
<br>
<code>zcat paper.ps.gz</code> <code>| gs</code> <code>-</code>
</blockquote>

<p>
When Ghostscript finishes reading from the pipe, it quits rather than
going into interactive mode.  Because of this, options and files after the '<code>-</code>' in the command line will be ignored.</p>

<p>
On Unix and MS Windows systems you can send output to a pipe in the same way.  For example, to pipe the output to <code>lpr</code>, use the command</p>

<blockquote><code>
        <b>gs -q -sOutputFile=- |</b> lpr
</code></blockquote>

<p>
In this case you must also use the <a href="#Quiet"><code>-q</code>
switch</a> to prevent Ghostscript from writing messages to standard output
which become mixed with the intended output stream.</p>
<p>
Also, using the <b>-sstdout=%stderr</b> option is useful, particularly with
input from PostScript files that may print to stdout.</p>

<p>
Similar results can be obtained with the <code>%stdout</code> and <code>%pipe%</code> filedevices. The example above would become</p>

<blockquote><code>
        <b>gs -sOutputFile=%stdout -q |</b> lpr
</code></blockquote>
or
<blockquote><code>
        <b>gs -sOutputFile=%pipe%</b>lpr
</code></blockquote>

<p>(again, doubling the <code>%</code> character on MS Windows systems.)</p>

<p>
In the last case, <code>-q</code> isn't necessary since Ghostscript handles the pipe itself and messages sent to stdout will be printed as normal.</p>
<hr>
<h2><a name="PDF"></a>Using Ghostscript with PDF files</h2>

<p>
Ghostscript is normally built to interpret both PostScript and PDF files, examining each file to determine automatically whether its contents are PDF or PostScript.  All the normal switches and procedures for interpreting PostScript files also apply to PDF files, with a few exceptions. In addition, the
<code>pdf2ps</code> utility uses Ghostscript to convert PDF to (Level 2) PostScript.</p>

<h3><a name="PDF_switches"></a>Switches for PDF files</h3>

<p>Here are some command line options specific to PDF</p>

 <dl>
<dt><code>-dNEWPDF</code></dt>
<dd>From release 9.55.0 Ghostscript incorporates two complete PDF interpreters; the original
long-standing interpreter is written in PostScript but there is now a new interpreter written
in C.
<p>At present the old PostScript-based interpreter remains the default, in future releases the
new C-based interpreter will become the default, though we would encourage people to experiment
with the new interpreter and send us feedback. While there are two interpreters the command-line
switch NEWPDF will allow selection of the existing interpreter when false and the new interpreter
when true.</p>

</dd>
</dl>

 <dl>
<dt><code>-dPDFFitPage</code></dt>
<dd>Rather than selecting a PageSize given by the PDF MediaBox, BleedBox (see -dUseBleedBox),
TrimBox (see -dUseTrimBox), ArtBox (see -dUseArtBox), or CropBox (see -dUseCropBox),
the PDF file will be scaled to fit the current device page size
(usually the default page size).
<p>
This is useful for creating fixed size images of PDF files that may have
a variety of page sizes, for example thumbnail images.</p>
<p>
This option is also set by the <code>-dFitPage</code> option.</p>
</dd>
</dl>

<dl>
    <dt><code>-dPrinted</code></dt>
    <dt><code>-dPrinted=false</code></dt>
    <dd>Determines whether the file should be displayed or printed using the
    "screen" or "printer" options for annotations and images.  With
    <code>-dPrinted</code>, the output will use the file's "print"
    options; with <code>-dPrinted=false</code>, the output will use the
    file's "screen" options.  If neither of these is specified, the output will
    use the screen options for any output device that doesn't have an
    <code>OutputFile</code> parameter, and the printer options for
    devices that do have this parameter.</dd>
</dl>

<dl>
    <dt><code>-dUseBleedBox</code></dt>
    <dd>Sets the page size to the BleedBox rather than the MediaBox.
    defines the region to which the contents of the page should be
    clipped when output in a production environment. This may include
    any extra bleed area needed to accommodate the physical limitations
    of cutting, folding, and trimming equipment. The actual printed page
    may include printing marks that fall outside the bleed box.</dd>
</dl>

<dl>
    <dt><code>-dUseTrimBox</code></dt>
    <dd>Sets the page size to the TrimBox rather than the MediaBox.
    The trim box defines the intended dimensions of the finished page
    after trimming. Some files have a TrimBox that is smaller than the
    MediaBox and may include white space, registration or cutting marks
    outside the CropBox. Using this option simulates appearance of the
    finished printed page.</dd>
</dl>

<dl>
    <dt><code>-dUseArtBox</code></dt>
    <dd>Sets the page size to the ArtBox rather than the MediaBox.
    The art box defines the extent of the page's meaningful content
    (including potential white space) as intended by the page's creator.
    The art box is likely to be the smallest box. It can be useful
    when one wants to crop the page as much as possible
    without losing the content.</dd>
</dl>

<dl>
    <dt><code>-dUseCropBox</code></dt>
    <dd>Sets the page size to the CropBox rather than the MediaBox.
    Unlike the other "page boundary" boxes, CropBox does not have a
    defined meaning, it simply provides a rectangle to which the
    page contents will be clipped (cropped). By convention, it is
    often, but not exclusively, used to aid the positioning of content
    on the (usually larger, in these cases) media.</dd>
</dl>

<dl>
    <dt><code>-sPDFPassword=</code><em>password</em></dt>
    <dd>Sets the user or owner password to be used in decoding encrypted
    PDF files. For files created with encryption method 4 or earlier, the
    password is an arbitrary string of bytes; with encryption method 5 or
    later, it should be text in either UTF-8 or your locale's character
    set (Ghostscript tries both).</dd>
</dl>

<dl>
    <dt><code>-dShowAnnots=false</code></dt>
    <dd>
    Don't enumerate annotations associated with the page
    <code>Annots</code> key. Annotations are shown by default.
<p> In addition, finer control is available by defining an array
<code>/ShowAnnotTypes</code>. Annotation types listed in this array will
be drawn, whilst those not listed will not be drawn.</p>
<p> To use this feature:
<code>-c "/ShowAnnotTypes [....] def" -f &ltinput file&gt</code>
<br> Where the array can contain one or more of the following names:
<code>/Stamp</code>, <code>/Squiggly</code>, <code>/Underline</code>, <code>/Link</code>, <code>/Text</code>, <code>/Highlight</code>, <code>/Ink</code>, <code>/FreeText</code>, <code>/StrikeOut</code> and <code>/stamp_dict</code>.</p>
<p> For example, adding the follow to the command line:
<code>-c "/ShowAnnotTypes [/Text /UnderLine] def" -f &ltinput file&gt</code>
    <br> would draw only annotations with the subtypes &quotText&quot and &quotUnderLine&quot</p>
    </dd>
</dl>

<dl>
    <dt><code>-dShowAcroForm=false</code></dt>
    <dd>
    Don't show annotations from the Interactive Form Dictionary (AcroForm dictionary).
    By default, AcroForm processing is now enabled because Adobe Acrobat does this. This option
    is provided to restore the previous behavior which corresponded to older Acrobat.</dd>
</dl>

<dl>
    <dt><code>-dNoUserUnit</code></dt>
<dd>
    Ignore <code>UserUnit</code> parameter. This may be useful for backward
    compatibility with old versions of Ghostscript and Adobe Acrobat,
    or for processing files with large values of <code>UserUnit</code>
    that otherwise exceed implementation limits.</dd>
</dl>

<dl>
    <dt><code>-dRENDERTTNOTDEF</code></dt>
    <dd>
    If a glyph is not present in a font the normal behaviour is to use the /.notdef
    glyph instead. On TrueType fonts, this is often a hollow sqaure. Under some
    conditions Acrobat does not do this, instead leaving a gap equivalent to the
    width of the missing glyph, or the width of the /.notdef glyph if no /Widths
    array is present. Ghostscript now attempts to mimic this undocumented feature
    using a user parameter <code>RenderTTNotdef</code>. The PDF interpreter sets this
    user parameter to the value of <code>RENDERTTNOTDEF</code> in systemdict,
    when rendering PDF files. To restore rendering of /.notdef glyphs from TrueType fonts in PDF files, set this parameter to true.</dd>
</dl>

<p>These command line options are no longer specific to PDF, but have some specific differences with PDF files</p>

<dl>
    <dt><code>-dFirstPage=</code><em>pagenumber</em></dt>
    <dd>Begin on the designated page of the document.
    Pages of all documents in PDF collections are numbered sequentionally.</dd>
</dl>

<dl>
    <dt><code>-dLastPage=</code><em>pagenumber</em></dt>
    <dd>Stop after the designated page of the document.
    Pages of all documents in PDF collections are numbered sequentionally.</dd>
</dl>

<dl>
    <dt><code>-sPageList=</code><em>pagenumber</em></dt>

<dd>There are three possible values for this; even, odd or a list of pages to be processed.
A list can include single pages or ranges of pages.
Ranges of pages use the minus sign '-', individual pages and ranges of pages are separated
by commas ','. A trailing minus '-' means process all remaining pages. For example;
<p><blockquote><pre>
-sPageList=1,3,5 indicates that pages 1, 3 and 5 should be processed.
-sPageList=5-10 indicates that pages 5, 6, 7, 8, 9 and 10 should be processed.
-sPageList=1,5-10,12- indicates that pages 1, 5, 6, 7, 8, 9, 10 and 12 onwards should be processed.
</pre></blockquote>
Note: Use of PageList overrides FirstPage and/or LastPage, if you set these as well as PageList they will be ignored. The
 list of pages should be given in increasing order, you cannot process pages out of order and inserting higher numbered pages before lower numbered
 pages in the list will generate an error.
</p>

<p>The PDF interpreter and the other language interpreters handle these in slightly different ways. Because
PDF files enable random access to pages in the document the PDF inerpreter only interprets and renders
the required pages. PCL and PostScript cannot be handled in ths way, and so all the pages must be interpreted.
However only the requested pages are rendered, which can still lead to savings in time. Be aware that
using the '%d' syntax for OutputFile does not reflect the page number in the original document. If you
chose (for example) to process even pages by using <code>-sPageList=even</code>, then the output of
<code>-sOutputFile=out%d.png</code> would still be
out0.png, out1.png, out2.png etc......
</p>
<p>
Because the PostScript and PCL interpreters cannot determine when a document terminates, sending multple
files as input on the command line does not reset the PageList between each document, each page in the second and
subsequent documents is treated as following on directly from the last page in the first document. The PDF
interpreter, however, does not work this way. Since it knows about individual PDF files the PageList
is applied to each PDF file separately. So if you were to set <code>-sPageList=1,2</code> and
 then send two PDF files, the result would be pages 1 and 2 from the first file, and then pages 1 and 2 from the second
 file. The PostScript interpreter, by contrast, would only render pages 1 and 2 from the first file. This means you must
 exercise caution when using this switch, and probably should not use it at all when processing a mixture of PostScript
 and PDF files on the same command line.
</p>
<p>
The XPS language like the PDF language allows random access to pages.  The XPS interpreter handles all the PageList cases
discussed above.  It also handles cases such as:
<blockquote><pre>
-sPageList=1,2,1,2 indicates repeated pages.  Pages processed in order 1, 2, 1, 2.
-sPageList=10-5 indicates pages will be processed in the order 10, 9, 8, 7, 6, 5.
-sPageList=1-,-1 indicates first processing from page 1 to end and then from end to page 1.
</pre></blockquote>
In addition, the XPS interpreter allows the use of a -dLastPage < -dFirstPage.  In this
case the pages will be processed backwards from LastPage to FirstPage.
</p>

</dd>
</dl>

<h3><a name="PDF_problems"></a>Problems interpreting a PDF file</h3>

<p>
Occasionally you may try to read or print a 'PDF' file that
Ghostscript doesn't recognize as PDF, even though the same file
<b><em>can</em></b> be opened and interpreted by an Adobe Acrobat viewer.
In many cases, this is because of incorrectly generated PDF. Acrobat
tends to be very forgiving of invalid PDF files. Ghostscript tends to
expect files to conform to the standard. For example, even though
valid PDF files must begin with <code>%PDF</code>, Acrobat will
scan the first 1000 bytes or so for this string, and ignore any preceding
garbage.</p>

<p>
In the past, Ghostscript's policy has been to simply fail with an
error message when confronted with these files. This policy has, no
doubt, encouraged PDF generators to be more careful. However, we now
recognize that this behavior is not very friendly for people who just
want to use Ghostscript to view or print PDF files. Our new policy is
to try to render broken PDF's, and also to print a warning, so that
Ghostscript is still useful as a sanity-check for invalid files.</p>

<h3><a name="PDF_stdin"></a>PDF files from standard input</h3>

<p>
The PDF language, unlike the PostScript language, inherently requires
random access to the file.
If you provide PDF to standard input using the
special filename <a href="#Pipes">'<code>-</code>'</a>,
Ghostscript will copy it to a temporary file before interpreting the PDF.</p>
<hr>
<h2><a name="EPS"></a>Using Ghostscript with EPS files</h2>
<p>
Encapsulated PostScript (EPS) files are intended to be incorporated
in other PostScript documents and may not display or print on their
own.  An EPS file must conform to the Document Structuring Conventions,
must include a <code>%%BoundingBox</code> line to indicate the
rectangle in which it will draw, must not use PostScript commands
which will interfere with the document importing the EPS,
and can have either zero pages or one page.
Ghostscript has support for handling EPS files, but requires
that the <code>%%BoundingBox</code> be in the header,
not the trailer.
To customize EPS handling, see <a href="#EPS_parameters">EPS parameters</a>.</p>

<p>
For the official description of the EPS file format, please
refer to the Adobe documentation in their tech note #5002. It
is available from:
<a href="http://partners.adobe.com/public/developer/ps/index_specs.html"
class="offsite">
http://partners.adobe.com/public/developer/ps/index_specs.html</a></p>
<hr>
<h2><a name="SPOT"></a>Using Ghostscript with overprinting and spot colors</h2>

<p>
In general with PostScript and PDF interpreters, the handling of
<b>overprinting</b> and <b>spot colors</b> depends upon the
process color model of the <a href="#Output_device">output device</a>. Devices
that produce gray or RGB output have an <b>additive</b> process color model.
Devices which produce CMYK output have a <b>subtractive</b> process color model.
Devices may, or may not, have support for spot colors.</p>

<blockquote><i>
Note: The differences in appearance of files with overprinting and spot colors
caused by the differences in the color model of the output device are part of the
PostScript and PDF specifications. They are not due to a limitation in the
implementation of Ghostscript or its output devices.
</i></blockquote>

<p>
With devices which use a subtractive process color model, both PostScript
and PDF allow the drawing of objects using colorants (inks) for one or more planes
without affecting the data for the remaining colorants. Thus the inks for one
object may <code>overprint</code> the inks for another object. In some cases
this produces a transparency like effect. (The effects of overprinting should
not be confused with the PDF 1.4 blending operations which are supported for
all output devices.) Overprinting is not allowed for devices with an additive
process color model. With files that use overprinting, the appearance of the
resulting image can differ between devices which produce RGB output versus devices
which produce CMYK output. Ghostscript automatically overprints (if needed)
when the output device uses a subtractive process color model. For example,
if the file is using overprinting, differences can be seen in the appearance
of the output from the <a href="Devices.htm#TIFF">tiff24nc and tiff32nc devices</a>
which use an RGB and a CMYK process color models.</p>

<p>
Most of the Ghostscript <a href="Devices.htm">output devices</a> do not have
file formats which support spot colors. Instead spot colors are converted using
the tint transform function contained within the color space definition.. However
there are several devices which have support for spot colors. The PSD format
(Adobe Photoshop) produced by the <a href="Devices.htm#PSD">psdcmyk device</a>
contains both the raster data plus an equivalent CMYK color for each spot color.
This allows Photoshop to simulate the appearance of the spot colors. The <a href="Devices.htm#display_device">display
device (MS Windows, OS/2, gtk+)</a> can be used with different color models:
Gray, RGB, CMYK only, or CMYK plus spot colors (separation). The display device,
when using its CMYK plus spot color (separation) mode, also uses an equivalent
CMYK color to simulate the appearance of the spot color. The
<a href="Devices.htm#TIFF">tiffsep
device</a> creates output files for each separation (CMYK and any spot colors
present). It also creates a composite CMYK file using an equivalent CMYK color
to simulate the appearance of spot colors. The
<a href="Devices.htm#XCF">xcfcmyk device</a>
creates output files with spot colors placed in separate alpha channels. (The
XCF file format does not currently directly support spot colors.)</p>

<p>
Overprinting with spot colors is not allowed if the tint transform function
is being used to convert spot colors. Thus if spot colors are used with overprinting,
then the appearance of the result can differ between output devices. One result
would be obtained with a CMYK only device and another would be obtained with
a CMYK plus spot color device. In a worst case situation where a file has overprinting
with both process (CMYK) and spot colors, it is possible to get three different
appearances for the same input file using the
<a href="Devices.htm#TIFF">tiff24nc</a> (RGB),
<a href="Devices.htm#TIFF">tiff32nc</a> (CMYK), and
<a href="Devices.htm#TIFF">tiffsep</a> (CMYK plus spot colors) devices.</p>

<blockquote><i>
In Adobe Acrobat, viewing of the effects of overprinting is enabled by the
'Overprint Preview' item in the 'Advanced' menu. This feature is not available
in the free Acrobat Reader. The free Acrobat Reader also uses the tint transform
functions to convert spot colors to the appropriate alternate color space.
</i></blockquote>


<hr>

<h2><a name="Finding_files"></a>How Ghostscript finds files</h2>

<p>
When looking for initialization files (<code>gs_*.ps</code>,
<code>pdf_*.ps</code>), font files, the <code>Fontmap</code> file,
files named on the command line, and resource files, Ghostscript first tests whether the
file name specifies an absolute path.</p>

<blockquote><table>
<tr><th colspan="2">Testing a file name for an absolute path</th></tr>
<tr><th align="left">System</th>

    <th align="left">Does the name ...</th></tr>
<tr><td colspan="2"></td></tr>
<tr><td valign="top">Unix</td>

    <td>Begin with <code><u>/</u></code> ?</td></tr>
<tr><td valign="top">MS Windows</td>

    <td>Have <code><u>:</u></code> as its second character, or
    begin with <code><u>/</u></code>, <code><u>\</u></code>,
        or <code><u>//servername/share/</u></code> ?</td></tr>
<tr><td valign="top">VMS</td>

    <td>Contain a node, device, or root specification?</td></tr>
</table></blockquote>

<p>If the test succeeds, Ghostscript tries to open the file
using the name given.  Otherwise it tries directories in this order:</p>

<ol>
<li>The current directory if enabled by the
<a href="#P-_switch"><code>-P</code> switch</a>;</li>

<li>The directories specified by <a href="#I_switch"><code>-I</code>
switches</a> in the command line, if any;</li>

<li>The directories specified by the <code>GS_LIB</code>
environment variable, if any;</li>

<li>If built with COMPILE_INITS=1 (currently the default build) the files in the
<code>%rom%Resource/</code> and <code>%rom%iccprofiles/</code> directories are
built into the executable.</li>

<li>The directories specified by the <code>GS_LIB_DEFAULT</code> macro
(if any) in the makefile when this executable was built.</li>
</ol>

<p>
<code>GS_LIB_DEFAULT</code>,
<code>GS_LIB</code>, and the
<code>-I</code> parameter may specify either a single
directory or a list of directories separated by a character appropriate for
the operating system ("<code>:</code>" on Unix systems,
"<code>,</code>" on VMS systems, and
"<code>;</code>" on MS Windows systems).
By default, Ghostscript no longer searches the current directory first
but provides <a href="#P_switch"><code>-P</code> switch</a> for a degree
of backward compatibility.</p>

<p>
Note that Ghostscript does not use this file searching algorithm for the
<code>run</code> or <code>file</code> operators: for these operators, it
simply opens the file with the name given.  To run a file using the searching
algorithm, use <code>runlibfile</code> instead of <code>run</code>.</p>

<h3><a name="PS_resources"></a>Finding PostScript Level 2 resources</h3>

<p>
Adobe specifies that resources are installed in a single directory.
Ghostscript instead maintains a list of resource directories,
and uses an extended method for finding resource files.</p>

<p>
The search for a resource file depends on whether
the value of the system parameter <code>GenericResourceDir</code>
specifies an absolute path. The user may set it as explained in
<a href="#Resource_related_parameters">Resource-related parameters</a>.</p>

<p>
If the user doesn't set the system parameter <code>GenericResourceDir</code>,
or use the <code>-sGenericResourceDir=</code> command line option, Ghostscript
creates a default value for it by looking on the directory paths explained in
<a href="#Finding_files">How Ghostscript finds files</a>, excluding the current directory.
The first path with <code>Resource</code> in it is used, including any prefix
up to the path separator character following the string <code>Resource</code>.
For example, when COMPILE_INITS=1 (the current default build), if the first path
is <code>%rom%Resource/Init/</code>, then the <code>GenericResourceDir</code>
systemparam will be set to <code>%rom%Resource/</code> by default.</p>

<p>
If the value of the system parameter <code>GenericResourceDir</code>
is an absolute path (the default),
Ghostscript assumes a single resource directory.
It concatenates :</p>

<ol>
<li>The value of the system parameter <code>GenericResourceDir</code>;</li>
<li>The name of the resource category (for instance, <code>CMap</code>);</li>
<li>The name of the resource instance (for instance, <code>Identity-H</code>).</li>
</ol>

<p>If the value of the system parameter <code>GenericResourceDir</code>
is not an absolute path,
Ghostscript assumes multiple resource directories.
In this case it concatenates :</p>

<ol>
<li>A directory listed in the section
<a href="#Finding_files">How Ghostscript finds files</a>,
except the current directory;</li>

<li>The value of the system parameter <code>GenericResourceDir</code>;</li>

<li>The name of the resource category (for instance, <code>CMap</code>);</li>

<li>The name of the resource instance (for instance, <code>Identity-H</code>)</li>
</ol>

<p>Due to possible variety of the part 1, the first successful combination is used.
For example, if the value of the system parameter <code>GenericResourceDir</code>
is the string  <code>../Resource/</code>
(or its equivalent in the file path syntax of the underlying platform),
Ghostscript searches for <code>../Resource/CMap/Identity-H</code>
from all directories listed in
<a href="#Finding_files">How Ghostscript finds files</a>.
So in this example, if the user on a Windows platform specifies
the command line option <code>-I.;../gs/lib;c:/gs8.50/lib</code>,
Ghostscript searches for <code>../gs/Resource/CMap/Identity-H</code> and
then for <code>c:/gs8.50/Resource/CMap/Identity-H</code>.</p>

<p>
To get a proper platform dependent syntax Ghostscript inserts
the value of the system parameter
<code>GenericResourcePathSep</code> (initially
"<code>/</code>" on Unix and Windows, "<code>:</code>" on MacOS,
"<code>.</code>" or "<code>]</code>" on OpenVMS).
The string <code>../Resource</code> is replaced with a
platform dependent equivalent.</p>

<p>
In the case of multiple resource directories,
the default <code>ResourceFileName</code> procedure retrieves either a path
to the first avaliable resource, or if the resource is not available it
returns a path starting with <code>GenericResourceDir</code>.
Consequently Postscript installers of Postscript resources
will overwrite an existing resource or add a new one to the first resource directory.</p>

<p>
To look up fonts, after exhausting the search method described in <a href="#Font_lookup">the
next section</a>, it concatenates together</p>

<ol>
<li>the value of the system parameter
<code>FontResourceDir</code> (initially
<code>/Resource/Font/</code>)</li>

<li>the name of the resource font (for instance, <code>Times-Roman</code>)</li>
</ol>

<p>
Note that even although the system parameters are named "somethingDir", they
are not just plain directory names: they have "<code>/</code>" on the
end, so that they can be concatenated with the category name or font name.</p>

<h3><a name="Font_lookup"></a>Font lookup</h3>

<p>
Ghostscript has a slightly different way to find the file containing a font
with a given name.  This rule uses not only the search path defined by
<code>-I</code>, <code>GS_LIB</code>, and
<code>GS_LIB_DEFAULT</code> <a href="#Finding_files">as described
above</a>, but also the directory that is the value of the
<code>FontResourceDir</code> system parameter, and an additional list of
directories that is the value of the <code>GS_FONTPATH</code> environment
variable (or the value provided with the <code>-sFONTPATH=</code> switch,
if present).</p>

<p>
At startup time, Ghostscript reads in the <code>Fontmap</code> files in
every directory on the search path (or in the list provided with the
<code>-sFONTMAP=</code> switch, if present): these files are catalogs of
fonts and the files that contain them.  (See <a href="Fonts.htm#Fontmap">the
documentation of fonts</a> for details.)  Then, when Ghostscript needs to
find a font that isn't already loaded into memory, it goes through a series
of steps.</p>

<ul>

<li>
First, it looks up the font name in the combined Fontmaps.  If there is an
entry for the desired font name, and the file named in the entry can be
found in some directory on the general search path (defined by
<code>-I</code>, <code>GS_LIB</code>, and
<code>GS_LIB_DEFAULT</code>), and the file is loaded successfully, and
loading it defines a font of the desired name, that is the end of the
process.</li>

<li>
If this process fails at any step, Ghostscript looks for a file whose name
is the concatenation of the value of the <code>FontResourceDir</code>
system parameter and the font name, with no extension.  If such a file
exists, can be loaded, and defines a font of the desired name, that again is
the end.  The value of <code>FontResourceDir</code> is normally the
string <code>/Resource/Font/</code>, but it can be changed with the
<code>setsystemparams</code> operator: see the PostScript Language
Reference Manual for details.</li>

<li>
If that fails, Ghostscript then looks for a file on the general search path
whose name is the desired font name, with no extension.  If such a file
exists, can be loaded, and defines a font of the desired name, that again is
the end.</li>

<li>
If that too fails, Ghostscript looks at the <code>GS_FONTPATH</code>
environment variable (or the value provided with the
<code>-sFONTPATH=</code> switch, if present), which is also a list of
directories.  It goes to the first directory on the list, and it's descendants,
looking for all files that appear to contain PostScript fonts (also Truetype
fonts); it then adds all those files and fonts to the combined Fontmaps, and
starts over.</li>

<li>
If scanning the first FONTPATH directory doesn't produce a file that
provides the desired font, it adds the next directory on the FONTPATH list,
and so on until either the font is defined successfully or the list is
exhausted.</li>

<li>
Finally, if all else fails, it will try to find a substitute for the font
from among the standard 35 fonts.</li>

</ul>

<p>
<a href="#CIDFonts">CID fonts</a> (e.g. Chinese, Japanese and Korean)
are found using a different method.</p>

<blockquote><table>
<tr><th colspan="2">Differences between search path and font path</th></tr>
<tr><th>Search path</th>

    <th>Font path</th></tr>
<tr><td><code>-I</code> switch</td>

    <td><code>-sFONTPATH=</code> switch</td></tr>
<tr><td><code>GS_LIB</code> and <code>GS_LIB_DEFAULT</code>
            environment variables</td>

    <td><code>GS_FONTPATH</code> environment variable</td></tr>
<tr><td valign="top">Consulted first</td>

    <td valign="top">Consulted only if search path and
    <code>FontResourceDir</code> don't provide the file.</td></tr>
<tr><td valign="top">Font-name-to-file-name mapping given in Fontmap
     files; aliases are possible, and there need not be any relation
     between the font name in the Fontmap and the
    <code>FontName</code> in the file.</td>
    <td valign="top">Font-name-to-file-name mapping is
     implicit – the <code>FontName</code> in the file is
     used. Aliases are not possible.</td></tr>
<tr><td valign="top">Only fonts and files named in Fontmap are used.</td>

    <td valign="top">Every Type 1 font file in each directory is
     available; if TrueType fonts are supported (the
     <code>ttfont.dev</code> feature was included when the
     executable was built), they are also available.</td></tr>
</table></blockquote>

<p>
If you are using one of the following types of computer, you may wish to
set the environment variable <code>GS_FONTPATH</code> to
the value indicated so that Ghostscript will automatically acquire all the
installed Type 1 (and, if supported, TrueType) fonts (but see below for
notes on systems marked with "*"):</p>

<blockquote><table>
<tr><th colspan="3">Suggested GS_FONTPATH for different systems</th></tr>
<tr><th>&nbsp;</th>

    <th align="left">System type</th>

    <th valign="bottom" align="left">GS_FONTPATH</th></tr>
<tr><td>&nbsp;</td>

    <td valign="top">Digital Unix</td>

    <td><code>/usr/lib/X11/fonts/Type1Adobe</code></td></tr>
<tr><td>&nbsp;</td>

    <td valign="top">Ultrix</td>

    <td><code>/usr/lib/DPS/outline/decwin</code></td></tr>
<tr><td>&nbsp;</td>

    <td valign="top">HP-UX 9</td>

    <td><code>/usr/lib/X11/fonts/type1.st/typefaces</code></td></tr>
<tr><td>&nbsp;</td>

    <td valign="top">IBM AIX</td>

    <td><code>/usr/lpp/DPS/fonts/outlines
    <br>/usr/lpp/X11/lib/X11/fonts/Type1
    <br>/usr/lpp/X11/lib/X11/fonts/Type1/DPS</code></td></tr>
<tr><td>&nbsp;</td>

    <td valign="top">NeXT</td>

    <td><code>/NextLibrary/Fonts/outline</code></td></tr>
<tr><td>*</td>

    <td valign="top">SGI IRIX</td>

    <td><code>/usr/lib/DPS/outline/base
    <br>/usr/lib/X11/fonts/Type1</code></td></tr>
<tr><td>&nbsp;</td>

    <td valign="top">SunOS 4.x<br>(NeWSprint only)</td>

    <td valign="top"><code>newsprint_2.5/SUNWsteNP/reloc/&#36;BASEDIR/NeWSprint/<br>&nbsp;&nbsp;&nbsp;&nbsp;small_openwin/lib/fonts</code></td></tr>
<tr><td>**</td>

    <td valign="top">SunOS 4.x</td>

    <td><code>/usr/openwin/lib/X11/fonts/Type1/outline</code></td></tr>
<tr><td>**</td>

    <td valign="top">Solaris 2.x</td>

    <td><code>/usr/openwin/lib/X11/fonts/Type1/outline</code></td></tr>
<tr><td>&nbsp;</td>

    <td valign="top">VMS</td>

    <td><code>SYS&#36;COMMON:[SYSFONT.XDPS.OUTLINE]</code></td></tr>
</table>

<p>
<b>*</b> On SGI IRIX systems, you must use <code>Fontmap.SGI</code> in
place of <code>Fontmap</code> or <code>Fontmap.GS</code>, because
otherwise the entries in <code>Fontmap</code> will take precedence over
the fonts in the FONTPATH directories.</p>

<p>
<b>**</b> On Solaris systems simply setting <code>GS_FONTPATH</code> or
using <code>-sFONTPATH=</code> may not work, because for some reason some
versions of Ghostscript can't seem to find any of the Type1 fonts in
<code>/usr/openwin/lib/X11/fonts/Type1/outline</code>. (It says: "15
files, 15 scanned, 0 new fonts". We think this problem has been fixed in
Ghostscript version 6.0, but we aren't sure because we've never been able to
reproduce it.)  See <code>Fontmap.Sol</code> instead.  Also, on Solaris
2.x it's probably not worth your while to add Sun's fonts to your font path
and Fontmap.  The fonts Sun distributes on Solaris 2.x in the directories</p>

<blockquote><code>
        /usr/openwin/lib/X11/fonts/Type1<br>
        /usr/openwin/lib/X11/fonts/Type1/outline
</code></blockquote>

<p>
are already represented among the ones distributed as part of Ghostscript;
and on some test files, Sun's fonts have been shown to cause incorrect
displays with Ghostscript.</p>

</blockquote>

<p>
These paths may not be exactly right for your installation; if the indicated
directory doesn't contain files whose names are familiar font names like
Courier and Helvetica, you may wish to ask your system administrator where
to find these fonts.</p>

<p>
Adobe Acrobat comes with a set of fourteen Type 1 fonts, on Unix typically
in a directory called ...<code>/Acrobat3/Fonts</code>.  There is no
particular reason to use these instead of the corresponding fonts in the
Ghostscript distribution (which are of just as good quality), except to save
about a megabyte of disk space, but the installation documentation explains
how to do it <a href="Install.htm#Use_Acrobat_fonts_Unix">on Unix</a>.</p>

<h3><a name="CIDFonts"></a>CID fonts</h3>

<p>
CID fonts are PostScript resources containing a
large number of glyphs (e.g. glyphs for Far East languages,
Chinese, Japanese and Korean).
Please refer to the PostScript Language Reference,
third edition, for details.</p>

<p>
CID font resources are a different kind of PostScript resource from fonts.
In particular, they cannot be used as regular fonts.
CID font resources must first be combined with a CMap resource, which
defines specific codes for glyphs, before it can be used as a font. This
allows the reuse of a collection of glyphs with different encodings.</p>

<p>
The simplest method to request a font composed of a CID font resource
and a CMap resource in a PostScript document is
<blockquote><code>
/CIDFont-CMap findfont
</code></blockquote>
where <code>CIDFont</code> is a name of any
CID font resource, and <code>CMap</code> is a name of a CMap resource
designed for the same character collection. The interpreter will compose
the font automatically from the specified CID font and CMap resources.
Another method is possible using the <code>composefont</code> operator.</p>

<p>
CID fonts must be placed in the <code>/Resource/CIDFont/</code> directory.
They are not found using <a href="#Font_lookup">Font lookup</a>
on the search path or font path.</p>

<h3><a name="CIDFontSubstitution"></a>CID font substitution</h3>
<h4><a name="AutomaticCIDFontSubstitution"></a>Automatic CIDFont Substitution</h4>
<p>
In general, it is highly recommended that CIDFonts used in the creation of PDF
jobs should be embedded or available to Ghostscript as CIDFont resources, this
ensures that the character set, and typeface style are as intended by the
author.</p>
<p>
In cases where the original CIDFont is not available, the next best option is
to provide Ghostscript with a mapping to a suitable alternative CIDFont - see
below for details on how this is achieved. However, Ghostscript does provide the
ability to use a "fall back" CIDFont substitute. As shipped, this uses the
DroidSansFallback.ttf font. This font contains a large number of glyphs covering
several languages, but it is not comprehensive. There is, therefore, a chance
that glyphs may be wrong, or missing in the output when this fallback is used.</p>
<p>
Internally, the font is referenced as CIDFont resource called <code>CIDFallBack</code>, thus
a different fallback from DroidSansFallback.ttf can be specified adding a
mapping to your cidfmap file (see below for details) to map the name "CIDFallBack"
as you prefer. For <code>CIDFallBack</code> the mapping <bold>must</bold> be a TrueType
font or TrueType collection, it cannot be a Postscript CIDFont file.</p>
<p>
As with any font containing large numbers of glyphs, DroidSansFallback.ttf is
quite large (~3.5Mb at the of writing). If this is space you cannot afford in
your use of Ghostscript, you can simply delete the file from:
<code>Resource/CIDFSubst/DroidSansFallback.ttf</code>. The build system will cope with the
file being removed, and the initialization code will avoid adding the internal
fall back mapping if the file is missing.</p>
<p>
If DroidSansFallback.ttf is removed, and no other <code>CIDFallBack</code> mapping is supplied,
the final "fall back" is to use a "dumb" bullet CIDFont, called <code>ArtifexBullet</code>. As
the name suggests, this will result in all the glyphs from a missing CIDFont being replaced with
a simple bullet point.</p>
<p>
This type of generic fall back CIDFont substitution can be very useful for
viewing and proofing jobs, but may not be appropriate for a "production"
workflow, where it is expected that <b>only</b> the original font should be
used. For this situation, you can supply Ghostscript with the command line option:
<code>-dPDFNOCIDFALLBACK</code>. By combining <code>-dPDFNOCIDFALLBACK</code> with <code>-dPDFSTOPONERROR</code>
a production workflow can force a PDF with missing CIDFonts to error, and avoid
realising a CIDFont was missing only after printing.</p>
<p>
The directory in which the fallback TrueType font or collection can be specified by the
command line parameter <code>-sCIDFSubstPath="path/to/TTF"</code>, or with the environment
variable <code>CIDFSUBSTPATH</code>. The file name of the substitute TrueType font can be
specified using the command line parameter <code>-sCIDFSubstFont="TTF file name"</code> or
the environment variable <code>CIDFSUBSTFONT</code>.</p>

<h4><a name="ExplicitCIDFontSubstitution"></a>Explicit CIDFont Substitution</h4>
<p>Substitution of CID font resources is controlled, by default, by the Ghostscript
configuration file <code>Resource/Init/cidfmap</code>, which defines a CID font resource map.</p>
<p>
The file forms a table of records, each of which should use one of three formats,
explained below. Users may modify <code>Resource/Init/cidfmap</code> to configure
Ghostscript for a specific need. Note that the default Ghostscript build includes
such configuration and resource files in a rom file system built into the executable.
So, to ensure your changes have an effect, you should do one of the following: rebuild
the executable; use the "-I" command line option to add the directory containing your
modified file to Ghostscript's search path; or, finally, build Ghostscript to use disk
based resources.</p>

<h4>Format 1</h4>
<p> To substitute a CID font resource with another CID font resource, add a record like this :</p>

<blockquote><code>
/Substituted /Original ;
</code></blockquote>
<p>where <code>Substituted</code> is a name of CID font resource being used
by a document, and <code>Original</code> is a name of an available
CID font resource. Please pay attention that both them must be
designed for same character collection. In other words, you
cannot substitute a Japanese CID font resource with a Korean CID font resource,
etc. CMap resource names must not appear in
<code>lib/cidfmap</code>. The trailing semicolon and the space before it
are both required.</p>

<h4>Format 2</h4>
<p>To substitute (emulate) a CID font resource with a TrueType font file, add a record like this :</p>

<blockquote><code>
/Substituted &lt;&lt; keys&amp;values &gt;&gt; ;
</code></blockquote>

<p>Where <code>keys&amp;values</code> are explained in the table below.</p>

<table>

<tr valign="top">       <th>Key</th>
    <th>Type</th>
    <th>Description</th></tr>
<tr valign="top">       <td><code>/Path</code></td>
    <td>string</td>
    <td>A path to a TrueType font file. This must be an absolute path.
    If using <code><a href="#Safer">-dSAFER</a></code>, the directory
    containing the font file must be on one of the permitted paths.</td></tr>
<tr valign="top">       <td><code>/FileType</code></td>
    <td>name</td>
    <td>Must be <code>/TrueType</code>.</td></tr>
<tr valign="top">       <td><code>/SubfontID</code></td>
    <td>integer</td>
    <td>(optional) Index of the font in font collection, such as TTC.
    This is ignored if <code>Path</code> doesn't specify a collection.
    The first font in a collection is 0.
    Default value is 0.</td></tr>
<tr valign="top">       <td><code>/CSI</code>
        <td>array of 2 or 3 elements
        <td>(required) Information for building <code>CIDSystemInfo</code>.
            <p>
            If the array consists of 2 elements,
            the first element is a string, which specifies <code>Ordering</code>;
            the second element is a number, which specifies <code>Supplement</code>.
            <p>
            If the array consists of 3 elements,
            the first element is a string, which specifies <code>Registry</code>;
            the second element is a string, which specifies <code>Ordering</code>;
            the third element is a number, which specifies <code>Supplement</code>.
</table>

<p>
Currently only CIDFontType 2 can be emulated with a TrueType font.
The TrueType font must contain enough characters to cover an
Adobe character collection, which is specified in <code>Ordering</code> and used in documents.</p>

<h4>Format 3</h4>
<p> To point Ghostscript at a specific CIDFont file outside it's "normal" resource search path :</p>

<blockquote><code>
/CIDName (path/to/cid/font/file) ;
</code></blockquote>
<p>where <code>CIDName</code> is a name of CID font resource being used
by a document, and <code>"path/to/cid/font/file"</code> is the path to the
Postscript CIDFont file, including the file name. NOTE: the CIDFont file, when
executed by the Postscript interpreter, must result in a CIDFont resource being
defined whose CIDFontName matches the "CIDName" key for the current record.
I.E. an entry with the key /PingHei-Bold must reference a file which creates a
CIDFont resource called "PingHei-Bold". To substitute a file based CIDFont for
a differently named CIDFont, use formats 1 and 3 in combination (the order of the
entries is not important).</p>

<p>The trailing semicolon and the space before it are both required.</p>

<p>
Examples :</p>


<blockquote><code>
<h5>Format 1:</h5>
/Ryumin-Medium  /ShinGo-Bold ;<br>
/Ryumin-Light /MS-Mincho ;<br>
<h5>Format 2:</h5>
/Batang &lt;&lt; /FileType /TrueType /Path (C:/WINDOWS/fonts/batang.ttc) /SubfontID 0 /CSI [(Korea1) 3] &gt;&gt; ;<br>
/Gulim &lt;&lt; /FileType /TrueType /Path (C:/WINDOWS/fonts/gulim.ttc) /SubfontID 0 /CSI [(Korea1) 3] &gt;&gt; ;<br>
/Dotum &lt;&lt; /FileType /TrueType /Path (C:/WINDOWS/fonts/gulim.ttc) /SubfontID 2 /CSI [(Korea1) 3] &gt;&gt; ;<br>
<br>
<h5>Format 1 & 2</h5>
/SimSun &lt;&lt; /FileType /TrueType /Path (C:/WINDOWS/fonts/simsun.ttc) /SubfontID 0 /CSI [(GB1) 2] &gt;&gt; ;<br>
/SimHei &lt;&lt; /FileType /TrueType /Path (C:/WINDOWS/fonts/simhei.ttf) /SubfontID 0 /CSI [(GB1) 2] &gt;&gt; ;<br>
/STSong-Light /SimSun ;<br>
/STHeiti-Regular /SimHei ;<br>
<h5>Format 3:</h5>
/PMingLiU (/usr/local/share/font/cidfont/PMingLiU.cid) ;<br>
<h5>Format 1 & 3</h5>
/Ryumin-Light /PMingLiU ;<br>
/PMingLiU (/usr/local/share/font/cidfont/PMingLiU.cid) ;<br>
</code></blockquote>

<p>The win32 installer of recent version of ghostscript has a checkbox for
"Use Windows TrueType fonts for Chinese, Japanese and Korean" to optionally update
lib/cidfmap with the common CJK fonts provided by Microsoft products. The script
can also be run separately (e.g. against a network drive with windows CJK fonts):</p>

<blockquote><code>
gswin32c -q -dBATCH -sFONTDIR=c:/windows/fonts -sCIDFMAP=lib/cidfmap lib/mkcidfm.ps
</code></blockquote>

<p>
Note that the font file path uses Postscript syntax.
Because of this, backslashes in the paths must be
represented as a double backslash.</p>

<p>
This can complicate substitutions for fonts with non-Roman names.
For example, if a PDF file asks for a font with the name
<code>/#82l#82r#83S#83V#83b#83N</code>. This cannot be used directly
in a cidfmap file because the #xx notation in names is a PDF-only
encoding. Instead, try something like:</p>
<blockquote>
<code>&lt;82C68272835383568362834E&gt;cvn &lt;&lt; /Path
(C:/WINDOWS/Fonts/msmincho.ttc) /FileType /TrueType /SubfontID 0 /CSI
[(Japan1) 3] &gt;&gt; ;</code>
</blockquote>
<p>Where <code>&lt;82C68272835383568362834E&gt;</code> is the same byte
sequence converted to a hex string. This lets you specify a name
using any sequence of bytes through the encodings available for
Postscript strings.</p>

<p>
Note that loading truetype fonts directly from
<code>/Resources/CIDFont</code> is no longer supported.
There is no reliable way to generate a character ordering for truetype
fonts. The 7.0x versions of Ghostscript supported this by assuming a Japanese
character ordering. This is replaced in the 8.0x and later releases with
the more general <code>cidfmap</code> mechanism.</p>

<p>
The PDF specification requires CID font files to be embedded,
however some documents omit them. As a workaround
the PDF interpreter applies an additional substitution method when
a requested CID font resource is not embedded and it is not available.
It takes values of the keys <code>Registry</code> and <code>Ordering</code>
from the <code>CIDFontSystem</code> dictionary,
and concatenates them with a dash inserted.
For example, if a PDF CID font resource specifies
<blockquote><code>
/CIDSystemInfo &lt;&lt; /Registry (Adobe) /Ordering (CNS1) /Supplement 1 &gt;&gt;
</code></blockquote>
the generated subsitituite name is <code>Adobe-CNS1</code>.
The latter may look some confusing for a font name,
but we keep it for compatibility with older Ghostscript versions,
which do so due to a historical reason.
Add a proper record to <code>lib/cidfmap</code> to provide it.</p>

<p>
Please note that when a PDF font resource specifies
<blockquote><code>
/Registry (Adobe) /Ordering (Identity)
</code></blockquote>
there is no way to determine the language properly.
If the CID font file is not embedded, the <code>Adobe-Identity</code>
record depends on the document and a correct record isn't possible when
a document refers to multiple Far East languages.
In the latter case add individual records for specific CID font names used in the document.</p>

<p>
Consequently, if you want to handle any PDF document with
non-embedded CID fonts (which isn't a correct PDF),
you need to create a suitable <code>lib/cidfmap</code> by hand,
possibly a specific one for each document.</p>

<h3><a name="UnicodeTT"></a>Using Unicode True Type fonts</h3>

<p>Ghostscript can make use of Truetype fonts with a Unicode character set.
To do so, you should generate a (<b>NOTE:</b> non-standard!) Postscript or PDF
job where the relevant text is encoded as UTF-16. Ghostscript may be used for
converting such jobs to other formats (Postscript, PDF, PXL etc).
The resulting output will be compliant with the spec (unlike the input).</p>

<p>
To render an UTF-16 encoded text, one must do the following :</p>

<ul>

<li>
Provide a True Type font with Unicode Encoding.
It must have a <code>cmap</code> table with
<code>platformID</code> equals to 3 (Windows),
and <code>SpecificID</code> eqials to 1 (Unicode).</li>

<li>
Describe the font in <code>Resource/Init/cidfmap</code>
with special values for the <code>CSI</code> key :
<code>[(Artifex) (Unicode) 0]</code>.</li>

<li>
In the PS or PDF job combine the font
with one of CMap <code>Identity-UTF16-H</code>
(for the horizontal writing mode)
or <code>Identity-UTF16-V</code>
(for the vertical writing mode).
Those CMaps are distributed with Ghostscript
in <code>Resource/CMap</code>.</li>

</ul>

<p>Please note that <code>/Registry (Adobe) /Ordering (Identity)</code>
won't properly work for Unicode documents,
especially for the searchability feature
(see <a href="#CIDFontSubstitution">CID font substitution</a>).</p>

<h3><a name="Temp_files"></a>Temporary files</h3>

<blockquote><table>
<tr><th colspan="3">Where Ghostscript puts temporary files</th></tr>
<tr>
    <th align="left">Platform</th>

    <th align="left">Filename</th>

    <th align="left">Location</th></tr>
<tr valign="top"> <td>MS Windows and OpenVMS</td>

    <td><code>_temp_</code>XX.XXX</td>

    <td>Current directory</td></tr>
<tr valign="top"> <td>OS/2</td>

    <td><code>gs</code>XXXXXX</td>

    <td>Current directory</td></tr>
<tr valign="top"> <td>Unix</td>

    <td><code>gs_</code>XXXXX</td>

    <td><code>/tmp</code></td></tr>
</table></blockquote>

<p>
You can change in which directory Ghostscript creates temporary files by
setting the <code>TMPDIR</code> or <code>TEMP</code> environment
variable to the name of the directory you want used.  Ghostscript currently
doesn't do a very good job of deleting temporary files if it exits because
of an error; you may have to delete them manually from time to time.</p>


<hr>

<h2><a name="Platforms"></a>Notes on specific platforms</h2>

<h3><a name="Word size"></a>Word size (32 or 64 bits)</h3>

<p>
The original PostScript language specification, while not stating a specific word sise,
defines 'typical' limits which make it clear that it was intended to run as a 32-bit
environment. Ghostscript was originally coded that way, and the heritage remains
within the code base.
</p>
<p>
Because the Ghostscript PDF interpreter is currently written in PostScript, it proved
necessary to add support for 64-bit integers so that we could process PDF files which
exceed 2GB in size. This is the only real purpose in adding support for large integers,
however since that time, we have made some efforts to allow for the use of 64-bit words; in
particular the use of integers, but also lifting the 64K limit on strings and arrays,
among other areas.
</p>
However this is, obviously, dependent on the operating system and compiler support
available. Not all builds of Ghostscript will support 64-bit integers, though some
32-bit builds (eg Windows) will.
<p>
Even when the build supports 64-bit words, you should be aware that there are areas
of Ghostscript which do not support 64-bit values. Sometimes these are dependent
on the build and other times they are inherent in the architecture of Ghostscript (the graphics library does not
support 64-bit co-ordinates in device space for example, and most likely never will).
</p>
<p>
Note that the extended support for 64-bit word size can be disabled by executing 'true .setcpsimode',
This is important for checking the output of the Quality Logic test suite (and possibly other
test suites) as the tests make assumptions about the sizes of integers (amongst other things).
You can run /ghostpdl/Resource/Init/gs_cet.ps to change Ghostscript's behaviour so
that it matches the observed behaviour of Adobe CPSI interpreters.
</p>

<h3><a name="Unix"></a>Unix</h3>

<p>
The Ghostscript distribution includes some Unix shell scripts to use with
Ghostscript in different environments.  These are all user-contributed
code, so if you have questions, please contact the user identified in the
file, not Artifex Software.</p>

<dl>
    <dt><code>pv.sh</code></dt>
    <dd>Preview a specified page of a <code>dvi</code> file in an X window</dd>
</dl>

<dl>
    <dt><code>sysvlp.sh</code></dt>
    <dd>System V 3.2 lp interface for parallel printer</dd>
</dl>

<dl>
    <dt><code>pj-gs.sh</code></dt>
    <dd>Printing on an H-P PaintJet under HP-UX</dd>
</dl>

<dl>
    <dt><code>unix-lpr.sh</code></dt>
    <dd>Queue filter for <code>lpr</code> under Unix;
    <a href="Unix-lpr.htm">its documentation</a> is intended for system
    administrators</dd>
</dl>

<dl>
    <dt><code>lprsetup.sh</code></dt>
    <dd>Setup for <code>unix-lpr.sh</code></dd>
</dl>

<h3><a name="VMS"></a>VMS</h3>

<ul>
<li>To be able to specify switches and file names when invoking the
    interpreter, define <code>gs</code> as a foreign command:</li>

<li>
<blockquote>
<code>&#36; gs == "&#36;</code><em>disk</em><code>:[</code><em>directory</em><code>]gs.exe</code>"
</blockquote>
</li>

<li>
<p>
where the "<em>disk</em>" and "<em>directory</em>" specify where
    the Ghostscript executable is located.  For instance,</p>
</li>
<li>
<blockquote><code>
&#36; gs == "&#36;dua1:[ghostscript]gs.exe"
</code></blockquote>
</li>

<li>On VMS systems, the last character of each "directory" name indicates
what sort of entity the "directory" refers to.  If the "directory" name
ends with a colon "<code>:</code>", it is taken to refer to a logical
device, for instance</li>

<li>
<blockquote><code>
&#36; define ghostscript_device dua1:[ghostscript_510]<br>
&#36; define gs_lib ghostscript_device:
</code></blockquote>
</li>

<li>
<p>
If the "directory" name ends with a closing square bracket
"<code>]</code>", it is taken to refer to a real directory, for instance</p>
</li>
<li>
<blockquote><code>
&#36; define gs_lib dua1:[ghostscript]
</code></blockquote>
</li>
<li>Defining the logical <code>GS_LIB</code></li>
<li>
<blockquote>
<code>&#36; define gs_lib</code> <em>disk</em><code>:[</code><em>directory</em><code>]</code>
</blockquote>
</li>
<li>
<p>
allows Ghostscript to find its initialization files in the Ghostscript
directory even if that's not where the executable resides.</p>
</li>

<li>Although VMS DCL itself converts unquoted parameters to upper case, C
programs such as Ghostscript receive their parameters through the C runtime
library, which forces all unquoted command-line parameters to lower case.
That is, with the command</li>

<li>
<blockquote><code>
&#36; gs -Isys&#36;login:
</code></blockquote>
</li>

<li>
<p>
Ghostscript sees the switch as <code>-isys&#36;login</code>,
which doesn't work.  To preserve the case of switches, quote them like
this:</p>
</li>

<li>
<blockquote><code>
&#36; gs "-Isys&#36;login:"
</code></blockquote>
</li>

<li>If you write printer output to a file with
<code>-sOutputFile=</code> and then want to print the file later, use
"<code>PRINT/PASSALL</code>".</li>
</ul>

<ul>
<li>PDF files (or PostScript files that use the
<code>setfileposition</code> operator) must be "stream LF" type files to
work properly on VMS systems. (<b><em>Note:</em></b> This definitely matters
if Ghostscript was compiled with DEC C; we are not sure of the situation if
you use <code>gcc</code>.)  Because of this, if you transfer files by
FTP, you probably need to do one of these two things after the transfer:</li>

<li>
    <ol>
    <li>If the FTP transfer was in text (ASCII) mode:</li>

    <li>
    <blockquote>
    <code>&#36; convert/fdl=streamlf.fdl</code> input-file output-file
    </blockquote>


    <p>
    where the contents of the file <code>STREAMLF.FDL</code> are</p>

    <blockquote>
    <pre>FILE
            ORGANIZATION            sequential

    RECORD
            BLOCK_SPAN              yes
            CARRIAGE_CONTROL        carriage_return
            FORMAT                  stream_lf
    </pre></blockquote>
    </li>

    <li>If the FTP transfer was in binary mode:</li>

    <li>
    <blockquote><code>
         &#36; set file/attribute=(rfm:stmlf)
    </code></blockquote>
    </li>
    </ol>
</li>
</ul>

<h4><a name="VMS_X_Windows"></a>Using X Windows on VMS</h4>

<p>
If you are using on an X Windows display, you can set it up with the node
name and network transport, for instance</p>

<blockquote><code>
        &#36; set display/create/node="doof.city.com"/transport=tcpip
</code></blockquote>

<p>
and then run Ghostscript by typing <code>gs</code> at the command line.</p>

<h3><a name="MS_Windows"></a>MS Windows</h3>

<p>
The name of the Ghostscript command line executable on MS Windows is
<code>gswin32c</code>/<code>gswin64c</code> so use this instead of the
plain '<code>gs</code>' in the quickstart examples.</p>

<p>
To run the batch files in the ghostscript <code>lib</code> directory,
you must add <em>gs\</em><code>bin</code> and
<em>gs\</em><code>lib</code> to the <code>PATH</code>, where
<em>gs</em> is the top-level Ghostscript directory.</p>

<p>
When passing options to ghostcript through a batch file wrapper such as
<code>ps2pdf.bat</code> you need to substitute '#' for '=' as the separator
between options and their arguments. For example:</p>
<blockquote><pre>
ps2pdf -sPAPERSIZE#a4 file.ps file.pdf
</pre></blockquote>

<p>Ghostscript treats '#' the same internally, and the '=' is mangled by
the command shell.</p>

<p>
There is also an older version for MS Windows called just <code>gswin32</code>
that provides its own window for the interactive postscript prompt.
The executable <code>gswin32c</code>/<code>gswin64c</code> is usually the better
option since it uses the native command prompt window.</p>

<p>
For printer devices, the default output is the default printer.
This can be modified as follows.</p>

<blockquote>
<dl>
    <dt><code>-sOutputFile="%printer%printer name"</code></dt>
    <dd>Output to the named printer.  If your printer is named "HP DeskJet 500"
    then you would use <code>-sOutputFile="%printer%HP DeskJet 500"</code>.</dd>

</dl>
</blockquote>

<h3><a name="MS-DOS"></a>MS-DOS</h3>

<p>
<strong>Note:</strong> Ghostscript is no longer supported on MS-DOS.</p>

<p>
Invoking Ghostscript from the command prompt in Windows is supported by
the Windows executable described above.</p>

<h3><a name="X_Windows"></a>X Windows</h3>

<p>
Ghostscript looks for the following resources under the program name
<code>ghostscript</code> and class name
<code>Ghostscript</code>; the ones marked "**" are
calculated from display metrics:</p>

<blockquote><table>
<tr><th colspan="3">X Windows resources</th></tr>
<tr><th align="left">Name</th>

    <th align="left">Class</th>

    <th align="left">Default</th></tr>
<tr><td><code>background</code></td>

    <td><code>Background</code></td>

    <td><code>white</code></td></tr>
<tr><td><code>foreground</code></td>

    <td><code>Foreground</code></td>

    <td><code>black</code></td></tr>
<tr><td><code>borderColor</code></td>

    <td><code>BorderColor</code></td>

    <td><code>black</code></td></tr>
<tr><td><code>borderWidth</code></td>

    <td><code>BorderWidth</code></td>

    <td><code>1</code></td></tr>
<tr><td><code>geometry</code></td>

    <td><code>Geometry</code></td>

    <td><code>NULL</code></td></tr>
<tr><td><code>xResolution</code></td>

    <td><code>Resolution</code></td>

    <td>**</td></tr>
<tr><td><code>yResolution</code></td>

        <td><code>Resolution</code></td>

        <td>**</td></tr>
<tr><td><code>useExternalFonts</code></td>

        <td><code>UseExternalFonts</code></td>

        <td><code>true</code></td></tr>
<tr><td><code>useScalableFonts</code></td>

        <td><code>UseScalableFonts</code></td>

        <td><code>true</code></td></tr>
<tr><td><code>logExternalFonts</code></td>

        <td><code>LogExternalFonts</code></td>

        <td><code>false</code></td></tr>
<tr><td><code>externalFontTolerance</code></td>

        <td><code>ExternalFontTolerance</code></td>

        <td><code>10.0</code></td></tr>
<tr><td><code>palette</code></td>

        <td><code>Palette</code></td>

        <td><code>Color</code></td></tr>
<tr><td><code>maxGrayRamp</code></td>

        <td><code>MaxGrayRamp</code></td>

        <td><code>128</code></td></tr>
<tr><td><code>maxRGBRamp</code></td>

        <td><code>MaxRGBRamp</code></td>

        <td><code>5</code></td></tr>
<tr>    <td><code>maxDynamicColors</code></td>

        <td><code>MaxDynamicColors</code></td>

        <td><code>256</code></td></tr>
<tr><td><code>useBackingPixmap</code></td>

        <td><code>UseBackingPixmap</code></td>

        <td><code>true</code></td></tr>
<tr><td><code>useXPutImage</code></td>

        <td><code>UseXPutImage</code></td>

        <td><code>true</code></td></tr>
<tr><td><code>useXSetTile</code></td>

        <td><code>UseXSetTile</code></td>

        <td><code>true</code></td></tr>
</table></blockquote>

<h4><a name="X_resources"></a>X resources</h4>

<ul>
<li>
To set X resources, put them in a file (such as
<code>~/.Xdefaults</code> on Unix) in a form like this:</li>

<li>
<blockquote><table>
    <tr><td><code>Ghostscript*geometry:</code></td><td><code>595x842-0+0</code></td></tr>
    <tr><td><code>Ghostscript*xResolution:</code></td><td><code>72</code></td></tr>
    <tr><td><code>Ghostscript*yResolution:</code></td><td><code>72</code></td></tr>
</table></blockquote>

<p>
    Then merge these resources into the X server's resource database:</p>

<blockquote><code>
        xrdb -merge ~/.Xdefaults
</code></blockquote>

</li>

<li>
Ghostscript doesn't look at the default system background and foreground
colors; if you want to change the background or foreground color, you must
set them explicitly for Ghostscript.  This is a deliberate choice, so that
PostScript documents will display correctly by default -- with white as
white and black as black -- even if text windows use other colors.</li>

<li>
The <code>geometry</code> resource affects only window placement.</li>

<li>
Resolution is expressed in pixels per inch (1 inch = 25.4mm).</li>

<li>
The font tolerance gives the largest acceptable difference in height of the
screen font, expressed as a percentage of the height of the desired font.</li>

<li>
The <code>palette</code> resource can be used to restrict Ghostscript to
using a grayscale or monochrome palette.</li>

<li>
<code>maxRGBRamp</code> and
<code>maxGrayRamp</code> control the maximum number of
colors that ghostscript allocates ahead of time for the dither cube (ramp).
Ghostscript never preallocates more than half the cells in a colormap.
<code>maxDynamicColors</code> controls the maximum
number of colors that Ghostscript will allocate dynamically in the
colormap.</li>
</ul>

<h4><a name="X_server_bugs"></a>Working around bugs in X servers</h4>

<p>
The "<code>use</code>..." resources exist primarily to work around bugs
    in X servers.</p>

<ul>
<li>    Old versions of DEC's X server (DECwindows) have bugs that
        require setting <code>useXPutImage</code> or
        <code>useXSetTile</code> to
        <code>false</code>.</li>

<li>    Some servers do not implement backing pixmaps properly, or do not
        have enough memory for them.  If you get strange behavior or "out
        of memory" messages, try setting
        <code>useBackingPixmap</code> to
        <code>false</code>.</li>

<li>    Some servers do not implement tiling properly.  This appears
        as broad bands of color where dither patterns should appear.  If
        this happens, try setting
        <code>useXSetTile</code> to
        <code>false</code>.</li>

<li>    Some servers do not implement bitmap or pixmap displaying properly.
        This may appear as white or black rectangles where characters
        should appear; or characters may appear in "inverse video" (for
        instance, white on a black rectangle rather than black on white).
        If this happens, try setting
        <code>useXPutImage</code> to
        <code>false</code>.</li>
</ul>

<h4><a name="X_device_parameters"></a>X device parameters</h4>

<p>
In addition to the device parameters recognized by <a
href="Language.htm#Device_parameters">all devices</a>, Ghostscript's X
driver provides parameters to adjust its performance.  Users will rarely
need to modify these.  Note that these are parameters to be set with the
<code>-d</code> switch in the command line (e.g.,
<code>-dMaxBitmap=10000000</code>), not resources to be defined in the
<code>~/.Xdefaults</code> file.</p>

<dl>
    <dt><code>AlwaysUpdate &lt;boolean&gt;</code></dt>
<dd>If <code>true</code>, the driver updates the screen after each
primitive drawing operation; if <code>false</code> (the default), the
    driver uses an intelligent buffered updating algorithm.</dd>
</dl>

<dl>
    <dt><code>MaxBitmap &lt;integer&gt;</code></dt>
<dd>If the amount of memory required to hold the pixmap for the window is no
more than the value of <code>MaxBitmap</code>, the driver will draw to a
pixmap in Ghostscript's address space (called a "client-side pixmap") and
will copy it to the screen from time to time; if the amount of memory
required for the pixmap exceeds the value of <code>MaxBitmap</code>, the
driver will draw to a server pixmap.  Using a client-side pixmap usually
provides better performance -- for bitmap images, possibly much better
performance -- but since it may require quite a lot of RAM (e.g., about 2.2
Mb for a 24-bit 1024x768 window), the default value of
    <code>MaxBitmap</code> is 0.</dd>
</dl>

<dl>
    <dt><code>MaxTempPixmap, MaxTempImage &lt;integer&gt;</code></dt>
<dd>These control various aspects of the driver's buffering behavior.  For
    details, please consult the source file <code>gdevx.h</code>.</dd>
</dl>

<h3><a name="SCO_Unix"></a>SCO Unix</h3>

<p>
Because of bugs in the SCO Unix kernel, Ghostscript will not work if you
select direct screen output and also allow it to write messages on the
console.  If you are using direct screen output, redirect Ghostscript's
    terminal output to a file.</p>

<hr>

<h2><a name="Options"></a>Command line options</h2>

<p>
Unless otherwise noted, these switches can be used on all platforms.</p>

<h3><a name="General_switches"></a>General switches</h3>

<h4><a name="Input_control"></a>Input control</h4>

<dl>
    <dt><code>@</code><em>filename</em></dt>
<dd>Causes Ghostscript to read <em>filename</em> and treat its contents the
same as the command line.  (This was intended primarily for getting around
DOS's 128-character limit on the length of a command line.)  Switches or
file names in the file may be separated by any amount of white space
    (space, tab, line break); there is no limit on the size of the file.</dd>
</dl>

<dl>
    <dt><code>--</code> <em>filename arg1 ...</em>
<br><code>-+</code> <em>filename arg1 ...</em></dt>
<dd>Takes the next argument as a file name as usual, but takes all
remaining arguments (even if they have the syntactic form of switches) and
defines the name <code>ARGUMENTS</code> in userdict (not systemdict) as
an array of those strings, <em>before</em> running the file.  When
    Ghostscript finishes executing the file, it exits back to the shell.</dd>
</dl>

<dl>
    <dt><code>-@</code> <em>filename arg1 ...</em></dt>
<dd>Does the same thing as <code>--</code> and <code>-+</code>, but
    expands <code>@</code><em>filename</em> arguments.</dd>
</dl>

<dl>
<dt><code>-</code>
    <br><code>-_</code></dt>
<dd>These are not really switches: they tell Ghostscript to read from
standard input, which is coming from a file or a pipe,
with or without buffering.
On some systems, Ghostscript may read the input one character at a time,
which is useful for programs such as ghostview that generate input for
Ghostscript dynamically and watch for some response, but can slow processing.
If performance is significantly slower than with a named file,
try '<code>-_</code>' which always reads the input in blocks.
    However, '<code>-</code>' is equivalent on most systems.</dd>
</dl>

<dl>
<dt><code>-c</code> <em>token ...</em>
    <br><code>-c</code> <em>string ...</em></dt>
<dd>Interprets arguments as PostScript code up to the next argument that
begins with "<code>-</code>" followed by a non-digit, or with
"<code>@</code>".  For example, if the file <code>quit.ps</code>
contains just the word "<code>quit</code>", then
<code>-c&nbsp;quit</code> on the command line is equivalent to
<code>quit.ps</code> there.  Each argument must be valid PostScript,
either individual tokens as defined by the <code>token</code> operator,
    or a string containing valid PostScript.
<p>
Because Ghostscript must initialize the PostScript environment
before executing the commands specified by this option it should
be specified after other setup options.  Specifically this option
'bind's all operations and sets the systemdict to readonly.</p>
</dd>
</dl>

<dl>
    <dt><code>-f</code></dt>
<dd>Interprets following non-switch arguments as file names to be executed
using the normal <code>run</code> command.  Since this is the default
behavior, <code>-f</code> is useful only for terminating the list of
    tokens for the <code>-c</code> switch.</dd>
</dl>

<dl>
    <dt><code>-f</code><em>filename</em></dt>
<dd>Execute the given file, even if its name begins with a
    "<code>-</code>" or "<code>@</code>".</dd>
</dl>

<h4><a name="File_searching"></a>File searching</h4>

<p>
Note that by "library files" here we mean all the files identified using
the search rule under "<a href="#Finding_files">How Ghostscript finds
files</a>" above: Ghostscript's own initialization files, fonts, and files
    named on the command line.</p>

<dl>
    <dt><a name="I_switch"></a><code>-I</code><em>directories</em>
<br><code>-I </code><em>directories</em></dt>
<dd>Adds the designated list of directories at the head of the search path
    for library files.</dd>
</dl>

<dl>
    <dt><a name="P_switch"></a><code>-P</code></dt>
<dd>Makes Ghostscript look first in the current directory for library
    files.</dd>
</dl>

<dl>
    <dt><a name="P-_switch"></a><code>-P-</code></dt>
<dd>Makes Ghostscript <b><em>not</em></b> look first in the current
directory for library files (unless, of course, the first explicitly
    supplied directory is "<code>.</code>"). This is now the default.</dd>
</dl>

<h4><a name="Parameters"></a>Setting parameters</h4>

<dl>
<dt><code>-D</code><em>name</em>
    <br><code>-d</code><em>name</em></dt>
    <dd>Define a name in systemdict with value=true.</dd>
</dl>

<dl>
<dt><code>-D</code><em>name</em><code>=</code><em>token</em>
    <br><code>-d</code><em>name</em><code>=</code><em>token</em></dt>
<dd>Define a name in systemdict with the given value.  The value must be
a valid PostScript token (as defined by the <code>token</code> operator).
If the token is a non-literal name, it must be true, false, or null.
It is recommeded that this is used only for simple values -- use
<code>-c</code> (above) for complex values such as procedures,
arrays or dictionaries.
<br>Note that these values are defined <b>before</b> other names in
systemdict, so any name that that conflicts with one usually in
systemdict will be replaced by the normal definition during the
    interpreter initialization.</dd>
</dl>

<dl>
<dt><code>-S</code><em>name</em><code>=</code><em>string</em>
    <br><code>-s</code><em>name</em><code>=</code><em>string</em></dt>
<dd>Define a name in systemdict with a given string as value.  This is
different from <code>-d</code>.  For example, <code>-dXYZ=35</code>
    on the command line is equivalent to the program fragment

<blockquote><code>
/XYZ 35 def
</code></blockquote>

<p>
whereas <code>-sXYZ=35</code> is equivalent to</p>

<blockquote><code>
/XYZ (35) def
</code></blockquote>
</dd>
</dl>

<dl>
<dt><code>-p</code><em>name</em><code>=</code><em>string</em></dt>
<dd>Define a name in systemdict with the parsed version of the given string as value. The string takes a parameter definition in (something very close to) postscript format.
This allows more complex structures to be passed in than is possible with <code>-d</code> or <code>-s</code>. For example:

<blockquote><code>
-pFoo=&quot;&lt;&lt; /Bar[1 2 3]/Baz 0.1 /Whizz (string) /Bang &lt;0123&gt; &gt;&gt;&quot;
</code></blockquote>

<p>This means that <code>-p</code> can do the job of both <code>-d</code> and <code>-s</code>. For example:</p>

<blockquote><code>
-dDownScaleFactor=3
</code></blockquote>

<p>can be equivalently performed by</p>

<blockquote><code>
-pDownScaleFactor=3
</code></blockquote>

and

<blockquote><code>
-sPAPERSIZE=letter
</code></blockquote>

<p>can be equivalently performed by</p>

<blockquote><code>
-pPAPERSIZE=&quot;(letter)&quot;
</code></blockquote>

<p>Note, that there are some 'special' values that should be set using <code>-s</code>, not <code>-p</code>, such as <code>DEVICE</code> and <code>DefaultGrayProfile</code>. Broadly, only use <code>-p</code> if you cannot set what you want using <code>-s</code> or <code>-d</code>.</p>

<p>Also, internally, after setting an parameter with <code>-p</code> we perform an <code>initgraphics</code> operation. This is required to allow changes in parameters such as <code>HWResolution</code> to take effect. This means that attempting to use <code>-p</code> other than at the start of a page is liable to give unexpected results.</p>
</dl>

<dl>
    <dt><code>-u</code><em>name</em></dt>
    <dd>Un-define a name, cancelling <code>-d</code> or <code>-s</code>.

<p>
Note that the initialization file <code>gs_init.ps</code> makes
<code>systemdict</code> read-only, so the values of names defined with
<code>-D</code>, <code>-d</code>, <code>-S</code>, and
<code>-s</code> cannot be changed -- although, of course, they can be
superseded by definitions in <code>userdict</code> or other dictionaries.
However, device parameters set this way (<code>PageSize</code>,
<code>Margins</code>, etc.) are <em>not</em> read-only, and <em>can</em>
be changed by code in PostScript files.</p>
</dd>
</dl>

<dl>
    <dt><code>-g</code><em>number1</em><code>x</code><em>number2</em></dt>
<dd>Equivalent to <code>-dDEVICEWIDTH=</code><em>number1</em> and
<code>-dDEVICEHEIGHT=</code><em>number2</em>, specifying the device
width and height in pixels for the benefit of devices such as X11 windows
and VESA displays that require (or allow) you to specify width and height.
Note that this causes documents of other sizes to be clipped, not scaled:
    see <code>-dFIXEDMEDIA</code> below.
</dd>
</dl>

<dl>
<dt><a name="Resolution_switch"></a><code>-r</code><em>number</em> (same
as <code>-r</code><em>number</em><code>x</code><em>number</em>)
    <br><code>-r</code><em>number1</em><code>x</code><em>number2</em></dt>
<dd>Equivalent to <code>-dDEVICEXRESOLUTION=</code><em>number1</em> and
<code>-dDEVICEYRESOLUTION=</code><em>number2</em>, specifying the device
horizontal and vertical resolution in pixels per inch for the benefit of
    devices such as printers that support multiple X and Y resolutions.</dd>
</dl>

<h4><a name="Quiet"></a>Suppress messages</h4>

<dl>
    <dt><a name="Quiet"></a><code>-q</code></dt>
<dd>Quiet startup: suppress normal startup messages, and also do the
    equivalent of <a href="#dQUIET"><code>-dQUIET</code></a>.</dd>
</dl>

<h3><a name="Parameter_switches"></a>Parameter switches (<code>-d</code> and <code>-s</code>)</h3>

<p>
As noted above, <code>-d</code> and <code>-s</code> define initial
values for PostScript names.  Some of these names are parameters that
control the interpreter or the graphics engine.  You can also use
<code>-d</code> or <code>-s</code> to define a value for any device
parameter of the initial device (the one defined with
<code>-sDEVICE=</code>, or the default device if this switch is not
used).  For example, since the <code>ppmraw</code> device has a numeric
<code>GrayValues</code> parameter that controls the number of bits per
component, <code>-sDEVICE=ppmraw -dGrayValues=16</code> will make this
the default device and set the number of bits per component to 4 (log2(16)).</p>

<h4><a name="Rendering_parameters"></a>Rendering parameters</h4>

<dl>
<dt><code>-dCOLORSCREEN
<br>-dCOLORSCREEN=0
    <br>-dCOLORSCREEN=false</code></dt>
<dd>On high-resolution devices (at least 150 dpi resolution, or
<code>-dDITHERPPI</code> specified), <code>-dCOLORSCREEN</code>
forces the use of separate halftone screens with different angles for CMYK
or RGB if halftones are needed (this produces the best-quality output);
<code>-dCOLORSCREEN=0</code> uses separate screens with the same
frequency and angle; <code>-dCOLORSCREEN=false</code> forces the use of
a single binary screen.  The default if <code>COLORSCREEN</code> is not
specified is to use separate screens with different angles if the device
has fewer than 5 bits per color, and a single binary screen (which is never
    actually used under normal circumstances) on all other devices.</dd>
</dl>

<dl>
    <dt><code>-dDITHERPPI=</code><em>lpi</em></dt>
<dd>Forces all devices to be considered high-resolution, and forces use of
a halftone screen or screens with <em>lpi</em> lines per inch, disregarding
the actual device resolution.  Reasonable values for <em>lpi</em> are
<b><em>N</em></b>/5 to <b><em>N</em></b>/20, where <b><em>N</em></b> is the
    resolution in dots per inch.</dd>
</dl>

<dl>
    <dt><code>-dInterpolateControl=</code><em>control_value</em></dt>
    <dd>This allows control of the image interpolation.

<p>
By default <code>InterpolateControl</code> is 1 and the image rendering
for images that have <code>/Interpolate true</code> are interpolated to
the full device resolution. Otherwise, images are rendered using the nearest
neighbour scaling (Bresenham's line algorithm through the image, plotting
the closest texture coord at each pixel).  When downscaling this results
in some source pixels not appearing at all in the destination. When upscaling,
each source pixels will cover at least one destination pixel.</p>

<p>
When the <em>control_value</em> is 0 no interpolation is performed, whether
or not the file has images with <code>/Interpolate true</code>.</p>

<p>
When the <em>control_value</em> is greater than 1 interpolation is performed for
images with <code>/Interpolate true</code> as long as the image scaling
factor on either axis is larger than the <em>control_value</em>. Also, the
interpolation only produces images that have <em>(device resolution / control_value)</em>
maximum resolution rather than full device resolution. This allows for a performance
vs. quality tradeoff since the number of pixels produced by the interpolation
will be a fraction of the interpolated pixels at full device resolution. Every source
pixel will contribute partially to the destination pixels.</p>

<p>
When the <code>InterpolateControl</code> <em>control_value</em> is less than 0
interpolation is <b>forced</b> as if all images have <code>/Interpolate true</code>,
and the interpolation is controlled by the absolute value of the <em>control_value</em>
as described above. Thus, <code>-dInterpolateControl=-1</code> forces all images
to be interpolated at full device resolution.</p>

<p>
Computationally, image interpolation is much more demanding than without
interpolation  (lots of floating point muliplies and adds for every output
pixel vs simple integer additions, subtractions, and shifts).</p>

<p>
In all but special cases image interpolation uses a Mitchell filter function
to scale the contributions for each output pixel. When upscaling, every output
pixel ends up being the weighted sum of 16 input pixels, When downscaling more
source pixels will contribute to the interpolated pixels. Every source pixel has
some effect on the output pixels.</p>
</dd>
</dl>
<dl>
<dt><code>-dDOINTERPOLATE</code></dt>
<dd>This option still works, but is deprecated, and is the equivalent of
    <code>-dInterpolateControl=-1</code>.</dd>
</dl>
<dl>
<dt><code>-dNOINTERPOLATE</code></dt>
<dd>
This option still works, but is deprecated and is
the equivalent of <code>-dInterpolateControl=0</code>
</dd>
</dl>

<dl>
    <dt><code>-dTextAlphaBits=</code><em>n</em></dt>
    <dt><code>-dGraphicsAlphaBits=</code><em>n</em></dt>
<dd>These options control the use of subsample antialiasing. Their use is highly recommended for producing high quality rasterizations. The subsampling box size <em>n</em> should be 4 for optimum output, but smaller values can be used for faster rendering. Antialiasing is enabled separately for text and graphics content.
    Allowed values are 1, 2 or 4.
<p>
Note that because of the way antialiasing blends the edges of shapes into the background when
they are drawn some files that rely on joining separate filled polygons together to cover
an area may not render as expected with <code>GraphicsAlphaBits</code> at 2 or 4. If you encounter
strange lines within solid areas, try rendering that file again with
<code>-dGraphicsAlphaBits=1</code>.</p>
<p>Further note; because this feature relies upon rendering the input it is incompatible, and will generate
an error on attempted use, with any of the vector output devices.</p>
</dd>
</dl>

<dl>
    <dt><code>-dAlignToPixels=</code><em>n</em></dt>
<dd>Chooses glyph alignent to integral pixel boundaries (if set to the value 1)
or to subpixels (value 0). Subpixels are a smaller raster grid
which is used internally for text antialiasing.
The number of subpixels in a pixel usually is <code>2^TextAlphaBits</code>,
but this may be automatically reduced for big characters to save space
    in character cache.

<p>
The parameter has no effect if <code>-dTextAlphaBits=1</code>.
Default value is 0.</p>

<p>
Setting <code>-dAlignToPixels=0</code> can improve rendering
of poorly hinted fonts, but may impair the appearance of well-hinted fonts.</p>
</dd>
</dl>

<dl>
    <dt><code>-dGridFitTT=</code><em>n</em></dt>
<dd> This specifies the initial value for the implementation specific
user parameter <a href="Language.htm#GridFitTT">GridFitTT</a>.
It controls grid fitting of True Type fonts
(Sometimes referred to as "hinting", but strictly speaking
the latter is a feature of Type 1 fonts).
Setting this to 2 enables automatic grid fitting for True Type glyphs.
The value 0 disables grid fitting. The default value is 2.
For more information see the description of the user parameter
    <a href="Language.htm#GridFitTT">GridFitTT</a>.</dd>

</dl>

<dl>
    <dt><code>-dUseCIEColor</code></dt>
<dd>Set UseCIEColor in the page device dictionary, remapping device-dependent
color values through a Postscript defined CIE color space.  Document DeviceGray,
DeviceRGB and DeviceCMYK source colors will be substituted respectively by Postscript
CIEA, CIEABC and CIEDEFG color spaces.   See the document
<a href="GS9_Color_Management.pdf">GS9 Color Management</a> for details on how
this option will interact with Ghostscript's ICC-based color workflow.   If accurate colors
    are desired, it is recommended that an ICC workflow be used.</dd>
</dl>

<dl>
    <dt><code>-dNOCIE</code></dt>
<dd>Substitutes <code>DeviceGray</code> for CIEBasedA, <code>DeviceRGB</code> for CIEBasedABC and CIEBasedDEF spaces and <code>DeviceCMYK</code>
fpr CIEBasedDEFG color spaces.  Useful only on
    very slow systems where color accuracy is less important.</dd>
</dl>

<dl>
    <dt><code>-dNOSUBSTDEVICECOLORS</code></dt>
<dd>This switch prevents the substitution of the <code>ColorSpace</code>
resources (<code>DefaultGray</code>, <code>DefaultRGB</code>, and
<code>DefaultCMYK</code>) for the <code>DeviceGray</code>,
<code>DeviceRGB</code>, and <code>DeviceCMYK</code> color spaces.
This switch is primarily useful for PDF creation using the <code>pdfwrite</code>
device when retaining the color spaces from the original document is
    important.</dd>
</dl>

<dl>
    <dt><code>-dNOPSICC</code></dt>
<dd>Disables the automatic loading and use of an input color space that is
contained in a PostScript file as DSC comments starting with the %%BeginICCProfile:
comment. ICC profiles are sometimes embedded by applications to convey the exact
input color space allowing better color fidelity. Since the embedded ICC profiles
often use multidimensional RenderTables, color conversion may be slower than using
the Default color conversion invoked when the <code>-dUseCIEColor</code>
option is specified, therefore the <code>-dNOPSICC</code> option may result
    in improved performance at slightly reduced color fidelity.</dd>
</dl>

<dl>
    <dt><code>-dNOINTERPOLATE</code></dt>
<dd>Turns off image interpolation, improving performance on interpolated
images at the expense of image quality.  <code>-dNOINTERPOLATE</code>
    overrides <code>-dDOINTERPOLATE</code>.</dd>
</dl>

<dl>
    <dt><code>-dNOTRANSPARENCY</code></dt>
<dd>Turns off PDF 1.4 transparency, resulting in faster (but possibly
incorrect) rendering of pages containing PDF 1.4 transparency and
    blending.</dd>
</dl>

<a name="ALLOWPSTRANSPARENCY"></a>
<dl>
    <dt><code>-dALLOWPSTRANSPARENCY</code></dt>
<dd>
Enables the use of the Ghostscript custom transparency operators
(<a href="Language.htm#Transparency">Transparency</a>) from
Postscript input. Normally, these operators are not accessible from Postscript
jobs, being primarily intended to be called by the PDF interpreter. Using
<code>-dALLOWPSTRANSPARENCY</code> leaves them available. It is important that
these operators are used correctly, especially the order in which they are called,
otherwise unintended, even undefined behavior may result.
</dd>
</dl>

<dl>
    <dt><code>-dNO_TN5044</code></dt>
<dd>Turns off the TN 5044 psuedo operators. These psuedo operators are not a part
of the official Postscript specification. However they are defined in <i>Technical
Note #5044 Color Separation Conventions for PostScript Language Programs</i>.
These psuedo operators are required for some files from QuarkXPress. However some
files from Corel 9 and Illustrator 88 do not operate properly if these operators
    are present.</dd>
</dl>

<dl>
    <dt><code>-dDOPS</code></dt>
<dd>Enables processing of Subtype /PS streams in PDF files and the DoPS operator.
DoPS has in fact been deprecated for some time. Also the "PS" operator that was
removed from the 1.3 2nd edition specification is also disabled by default, and
enabled by <code>-dDOPS</code>. Use of this option is <b>NOT</b>
recommended in security-conscious applications, as it increases the
scope for malicious code. <code>-dDOPS</code> has no effect on
processing of PostScript source files. Note: in releases 7.30 and
    earlier, processing of DoPS was always enabled.</dd>
</dl>

<a name="BlackText"></a>
<dl>
    <dt><code>-dBlackText</code></dt>
<dd>Forces text to be drawn with black.  This occurs for text fill and
text stroke operations.  PDF output created with this setting will be
updated to be drawn with gray values of 0.  Type 3 fonts, which are
sometimes used for graphics, are not affected by this parameter. </dd>
</dl>

<h4><a name="Page_parameters"></a>Page parameters</h4>

<dl>
    <dt><code>-dFirstPage=</code><em>pagenumber</em></dt>
<dd>Begin on the designated page of the document.
    Pages of all documents in PDF collections are numbered sequentionally.</dd>
</dl>

<dl>
    <dt><code>-dLastPage=</code><em>pagenumber</em></dt>
<dd>Stop after the designated page of the document.
    Pages of all documents in PDF collections are numbered sequentionally.</dd>
</dl>

<dl>
<dt><code>-sPageList=</code><em>pagenumber</em></dt>
<dd>There are three possible values for this; even, odd or a list of pages to be processed.
A list can include single pages or ranges of pages.
Ranges of pages use the minus sign '-', individual pages and ranges of pages are separated
    by commas ','. A trailing minus '-' means process all remaining pages. For example;
<p><blockquote><pre>
-sPageList=1,3,5 indicates that pages 1, 3 and 5 should be processed.
-sPageList=5-10 indicates that pages 5, 6, 7, 8, 9 and 10 should be processed.
-sPageList=1, 5-10, 12- indicates that pages 1, 5, 6, 7, 8, 9, 10 and 12 onwards should be processed.
</pre></blockquote>
</p>

<p>The PDF interpreter and the other language interpreters handle these in slightly different ways. Because
PDF files enable random access to pages in the document the PDF inerpreter only interprets and renders
the required pages. PCL andPostScript cannot be handled in ths way, and so all the pages must be interpreted.
However only the requested pages are rendered, which can still lead to savings in time. Be aware that
using the '%d' syntax for OutputFile does not reflect the page number in the original document. If you
chose (for example) to process even pages by using <code>-sPageList=even</code>, then the output of
<code>-sOutputFile=out%d.png</code> would still be
out0.png, out1.png, out2.png etc......
</p>
<p>
Because the PostScript and PCL interpreters cannot determine when a document terminates, sending multple
files as input on the command line does not reset the PageList between each document, each page in the second and
subsequent documents is treated as following on directly from the last page in the first document. The PDF
interpreter, however, does not work this way. Since it knows about individual PDF files the PageList
is applied to each PDF file separately. So if you were to set <code>-sPageList=1,2</code> and
 then send two PDF files, the result would be pages 1 and 2 from the first file, and then pages 1 and 2 from the second
 file. The PostScript interpreter, by contrast, would only render pages 1 and 2 from the first file. This means you must
 exercise caution when using this switch, and probably should not use it at all when processing a mixture of PostScript
 and PDF files on the same command line.
</p>
</dd>
</dl>

<dl>
    <dt><a name="FIXEDMEDIA"></a><code>-dFIXEDMEDIA</code></dt>
<dd>Causes the media size to be fixed after initialization, forcing pages
of other sizes or orientations to be clipped.  This may be useful when
printing documents on a printer that can handle their requested paper size
but whose default is some other size.  Note that <code>-g</code>
automatically sets <code>-dFIXEDMEDIA</code>, but
    <code>-sPAPERSIZE=</code> does not.</dd>
</dl>

<dl>
    <dt><code>-dFIXEDRESOLUTION</code></dt>
<dd>Causes the media resolution to be fixed similarly.  <code>-r</code>
    automatically sets <code>-dFIXEDRESOLUTION</code>.</dd>
</dl>

<dl>
    <dt><code>-dPSFitPage</code></dt>
<dd>The page size from the PostScript file <code>setpagedevice</code> operator,
or one of the older  <code>statusdict</code> page size operators (such as
<code>letter</code> or <code>a4</code>) will be rotated, scaled and centered on the
"best fit" page size from those availiable in the InputAttributes list.
The <code>-dPSFitPage</code> is most easily used to fit pages when used with the
    <code>-dFIXEDMEDIA</code> option.

<p>
This option is also set by the <code>-dFitPage</code> option.</p>
</dd>
</dl>

<dl>
    <dt><code>-dORIENT1=true
<br>-dORIENT1=false</code></dt>
<dd>Defines the meaning of the 0 and 1 orientation values for the
setpage[params] compatibility operators.  The default value of
<code>ORIENT1</code> is true (set in <code>gs_init.ps</code>), which
is the correct value for most files that use setpage[params] at all,
namely, files produced by badly designed applications that "know" that the
output will be printed on certain roll-media printers: these applications
use 0 to mean landscape and 1 to mean portrait.
<code>-dORIENT1=false</code> declares that 0 means portrait and 1 means
landscape, which is the convention used by a smaller number of files
    produced by properly written applications.</dd>
</dl>

<dl>
<dt><code>-dDEVICEWIDTHPOINTS=</code><em>w</em>
    <br><code>-dDEVICEHEIGHTPOINTS=</code><em>h</em></dt>
<dd>Sets the initial page width to <em>w</em> or initial page height to
    <em>h</em> respectively, specified in 1/72" units.</dd>
</dl>

<dl>
    <dt><code>-sDEFAULTPAPERSIZE=</code><em>a4</em></dt>
<dd>
This value will be used to replace the device default papersize ONLY
if the default papersize for the device is 'letter' or 'a4' serving
to insulate users of A4 or 8.5x11 from particular device defaults
(the collection of contributed drivers in Ghostscript vary as to
the default size).
</dd>
</dl>

<dl>
    <dt><code>-dFitPage</code></dt>
<dd>This is a "convenience" operator that sets the various options to perform
    page fitting for specific file types.
<p>
This option sets the <code>-dEPSFitPage</code>, <code>-dPDFFitPage</code>, and
the <code>-dFitPage</code> options.</p>
</dd>
</dl>

<dl>
<dt><a name="NupControl"></a></dt>
    <dt><code>-sNupControl=</code><em>Nup_option_string</em></dt>
<dd>This option specifies the N-up nesting to be performed. The pages are scaled
and arranged on the current PageSize "master" page according the the option.
<p>
The only option strings are as follows:
    <ul>
    <li>
        <dl><dt></dt><dd><code>-sNupControl=</code><em>number1</em><code>x</code><em>number2</em></dd></dl>
    will fit <em>number1</em> nested pages across the master page, and <em>number2</em>
    down the master page, from the upper left, then to the right to fill the row, moving down
    to the leftmost place on the next row until the nest is complete.
    <p>
    A partially filled nest will be output when the <code>-sNupControl=</code> string is changed,
    when Ghostscript exits, or when the page size changes.
    <p>
    Pages are scaled to fit the requested number horizontally and vertically, maintaining the
    aspect ratio. If the scaling selected for fitting the nested pages leaves space horizontally
    on the master page, the blank area will be added to the left and right of the <b>entire</b>
    row of nested pages. If the fit results in vertical space, the blank area will be added
    above and below <b>all</b> of the rows.
    </li>
    <li>
        <dl><dt></dt><dd><code>-sNupControl=</code></dd></dl>
    An empty string will turn off nesting. If there are any nested pages on the master page,
    the partially filled master page will be output.
    </li>
    </ul>
<p>Printer devices typically reallocate their memory whenever the transparency use
of a page changes (from one page having transparency, to the next page not having
transparency, or vice versa). This would cause problems with Nup, possibly leading
to lost or corrupt pages in the output. To avoid this, the Nup device changes
the parameters of the page to always set the PageUsesTransparency flag. While this
should be entirely transparent for the user and not cause extra transparency blending
operations during the standard rendering processes for most devices, it may cause
devices to use the clist rather than PageMode.
</dd>
</dl>

<h4><a name="Font_related_parameters"></a>Font-related parameters</h4>

<dl>
    <dt><code>-dLOCALFONTS</code></dt>
<dd>Causes Type 1 fonts to be loaded into the current VM -- normally local
VM -- instead of always being loaded into global VM.  Useful only for
    compatibility with Adobe printers for loading some obsolete fonts.</dd>
</dl>

<dl>
    <dt><a name="FONTMAP_switch"></a><code>-dNOFONTMAP</code></dt>
<dd>Suppresses the normal loading of the Fontmap file.  This may be useful
    in environments without a file system.</dd>
</dl>

<dl>
    <dt><code>-dNOFONTPATH</code></dt>
<dd>Suppresses consultation of <code>GS_FONTPATH</code>.  This may be
    useful for debugging.</dd>
</dl>

<dl>
    <dt><code>-dNOPLATFONTS</code></dt>
<dd>Disables the use of fonts supplied by the underlying platform (X
Windows or Microsoft Windows).  This may be needed if the platform fonts
    look undesirably different from the scalable fonts.</dd>
</dl>

<dl>
    <dt><code>-dNONATIVEFONTMAP</code></dt>
<dd>Disables the use of font map and corresponding fonts supplied by the
underlying platform. This may be needed to ensure consistent rendering on
    the platforms with different fonts, for instance, during regression testing.</dd>
</dl>

<dl>
<dt><code>-sFONTMAP=</code><em>filename1</em><code>;</code><em>filename2</em><code>;</code><em>...</em></dt>
<dd>Specifies alternate name or names for the Fontmap file.  Note that the
names are separated by "<code>:</code>" on Unix systems, by
"<code>;</code>" on MS Windows systems, and by
"<code>,</code>" on VMS systems, just as for search paths.</dd>
</dl>

<dl>
    <dt><code>-sFONTPATH=</code><em>dir1</em><code>;</code><em>dir2</em><code>;</code><em>...</em></dt>
<dd>Specifies a list of directories that will be scanned when looking for
fonts not found on the search path, overriding the environment variable
    <code>GS_FONTPATH</code>.
<p>By implication, any paths specified by <code>FONTPATH</code> or <code>GS_FONTPATH</code> are automatically
added to the <code>permit file read</code> list (see "<a href="#Safer">-dSAFER</a>").
</dd>
</dl>

<dl>
    <dt><code>-sSUBSTFONT=</code><em>fontname</em></dt>
<dd>Causes the given font to be substituted for all unknown fonts, instead
of using the normal intelligent substitution algorithm.  Also, in this
case, the font returned by <code>findfont</code> is the actual font
named <em>fontname</em>, not a copy of the font with its
<code>FontName</code> changed to the requested one.
THIS OPTION SHOULD NOT BE USED WITH HIGH LEVEL (VECTOR) DEVICES, such as
<code>pdfwrite</code>, because it prevents such devices from
providing the original font names in the output document. The
font specified (<em>fontname</em>) will be embedded instead,
limiting all future users of the document to the same approximate
    rendering.</dd>
</dl>

<h4><a name="Resource_related_parameters"></a>Resource-related parameters</h4>

<dl>
    <dt><a name="GenericResourceDir"></a><code>-sGenericResourceDir=path</code></dt>
<dd>Specifies a path to resource files.
    The value is platform dependent. It must end with a directory separator.
<p>
<b><font size="+1">
A note for Windows users, Artifex recommends the use of the
forward slash delimiter due to the special interpretation of \" by
the Microsoft C startup code.  See
<a href="http://msdn.microsoft.com/en-us/library/a1y7w461.aspx">Parsing C Command-Line Arguments</a>
for more information.
    </font></b></p>
<p>
Adobe specifies <code>GenericResourceDir</code> to be an absolute path
to a single resource directory. Ghostscript instead maintains
multiple resource directories and uses an extended method for finding
resources, which is explained in
<a href="#PS_resources">"Finding PostScript Level 2 resources"</a>.</p>
<p>
Due to the extended search method, Ghostscript uses <code>GenericResourceDir</code>
only as a default directory for resources being not installed.
Therefore <code>GenericResourceDir</code> may be considered as a place
where new resources to be installed. The default implementation of the function
<code>ResourceFileName</code> uses <code>GenericResourceDir</code> when
(1) it is an absolute path, or (2) the resource file is absent.
The extended search method does not call <code>ResourceFileName</code> .</p>
<p>
Default value is <code>(./Resource/)</code> for Unix, and an equivalent one on other
platforms.</p>
</dd>
</dl>

<dl>
    <dt><a name="FontResourceDir"></a><code>-sFontResourceDir=path</code></dt>
<dd>Specifies a path where font files are installed.
    It's meaning is similar to <code>GenericResourceDir</code>.

<p>
Default value is <code>(./Font/)</code> for Unix, and an equivalent one on other
platforms.</p>
</dd>
</dl>



<h4><a name="Interaction_related_parameters"></a>Interaction-related parameters</h4>

<dl>
    <dt><code>-dBATCH</code></dt>
<dd>Causes Ghostscript to exit after processing all files named on the
command line, rather than going into an interactive loop reading PostScript
    commands.  Equivalent to putting -c quit at the end of the command line.</dd>
</dl>

<dl>
    <dt><code>-dNOPAGEPROMPT</code></dt>
<dd>Disables only the prompt, but not the pause, at the end of each page.
This may be useful on PC displays that get confused if a program attempts
    to write text to the console while the display is in a graphics mode.</dd>
</dl>

<dl>
    <dt><a name="NoPause"></a><code>-dNOPAUSE</code></dt>
<dd>Disables the prompt and pause at the end of each page.  Normally one
should use this (along with <code>-dBATCH</code>) when producing output
on a printer or to a file; it also may be desirable for applications where
    another program is "driving" Ghostscript.</dd>
</dl>

<dl>
    <dt><code>-dNOPROMPT</code></dt>
<dd>Disables the prompt printed by Ghostscript when it expects interactive
input, as well as the end-of-page prompt (<code>-dNOPAGEPROMPT</code>).
This allows piping input
directly into Ghostscript, as long as the data doesn't refer to
    <code>currentfile</code>.</dd>
</dl>

<dl>
    <dt><a name="dQUIET"></a><code>-dQUIET</code></dt>
<dd>Suppresses routine information comments on standard output.  This is
    currently necessary when redirecting device output to standard output.</dd>
</dl>

<dl>
    <dt><code>-dSHORTERRORS</code></dt>
    <dd>Makes certain error and information messages more Adobe-compatible.</dd>
</dl>

<dl>
    <dt><code>-sstdout=</code><em>filename</em></dt>
<dd>Redirect PostScript <code>%stdout</code> to a file or
<code>stderr</code>, to avoid it being mixed with device stdout.
To redirect stdout to stderr use <code>-sstdout=%stderr</code>.
To cancel redirection of stdout use <code>-sstdout=%stdout</code>
    or <code>-sstdout=-</code>.
<p>
Note that this redirects PostScript output to %stdout but <b>does not</b>
change the destination FILE of device output as with <code>-sOutputFile=-</code>
or even <code>-sOutputFile=%stdout</code> since devices write directly using
the stdout FILE * pointer with C function calls such as fwrite or fputs.</p>
</dd>
</dl>

<dl>
    <dt><code>-dTTYPAUSE</code></dt>
<dd>
Causes Ghostscript to read a character from <code>/dev/tty</code>,
rather than standard input, at the end of each page.  This may be useful if
input is coming from a pipe.  Note that <code>-dTTYPAUSE</code>
overrides <code>-dNOPAUSE</code>.
</dl>

<h4><a name="Output_selection_parameters"></a>Device and output selection parameters</h4>

<dl>
    <dt><code>-dNODISPLAY</code></dt>
<dd>Initializes Ghostscript with a null device (a device that discards the
output image) rather than the default device or the device selected with
<code>-sDEVICE=</code>.  This is usually useful only when running
PostScript code whose purpose is to compute something rather than to
    produce an output image.</dd>
</dl>

<dl>
    <dt><a name="DEVICE_switch"></a><code>-sDEVICE=</code><em>device</em></dt>
<dd>Selects an alternate <a href="#Output_device">initial output
    device</a>.</dd>
</dl>

<dl>
    <dt><code>-sOutputFile=</code><em>filename</em></dt>
<dd>Selects an alternate output file (or pipe) for the initial output
    device, as described above.</dd>
</dl>

<dl>
    <dt><code>-d.IgnoreNumCopies=true</code></dt>
<dd>Some devices implement support for "printing" multiple copies of the
input document and some do not, usually based on whether it makes sense
for a particular output format. This switch instructs all devices to
ignore a request to print multiple copies, giving more consistent
    behaviour.</dd>
</dl>

<h4><a name="Deferred_Page_Rendering"></a>Deferred Page Rendering</h4>
<dl>
    <dt></dt>
<dd>Raster printers and image formats that can use the "command list" (clist)
to store a representation of the page prior to rendering can use the
<code>--saved-pages=</code><em>string</em> on the command line for
    deferred rendering of pages.
<p>
Pages that are <em>saved</em> instead of printed are retained until the
list of saved pages is emptied by the <code>flush</code> command of the
<code>saved-pages=</code> command string.</p>
<p>
Pages can be printed in reverse or normal order, or selected pages,
including all even or all odd, and multiple collated copies can be produced.
Since pages are saved until the <code>flush</code> command, pages can be
printed multiple times, in any order.</p>
<p>
Refer to the <a href="SavedPages.htm">SavedPages</a> document for
details.</p>
</dd>
</dl>

<h4><a name="EPS_parameters"></a>EPS parameters</h4>

<dl>
    <dt><code>-dEPSCrop</code></dt>
<dd>Crop an EPS file to the bounding box.
    This is useful when converting an EPS file to a bitmap.</dd>
</dl>

<dl>
    <dt><code>-dEPSFitPage</code></dt>
<dd>Resize an EPS file to fit the page.
    This is useful for shrinking or enlarging an EPS file to fit the paper size when printing.
<p>
This option is also set by the <code>-dFitPage</code> option.</p>
</dd>
</dl>

<dl>
    <dt><code>-dNOEPS</code></dt>
<dd>Prevent special processing of EPS files.
This is useful when EPS files have incorrect Document
    Structuring Convention comments.
</dd>
</dl>

<h4><a name="ICC_color_parameters"></a>ICC color parameters</h4>

<dl>
<dt></dt>
<dd>
For details about the ICC controls see the document
<a href="GS9_Color_Management.pdf">GS9 Color Management</a>.
</dd>
</dl>

<dl>
    <dt><code>-sDefaultGrayProfile=</code><em>filename</em></dt>
<dd>Set the ICC profile that will be associated with
undefined device gray color spaces.  If this is not set,
the profile file name "default_gray.icc" will be used as
    the default.</dd>
</dl>

<dl>
    <dt><code>-sDefaultRGBProfile=</code><em>filename</em></dt>
<dd>Set the ICC profile that will be associated with
undefined device RGB color spaces.  If this is not set,
the profile file name "default_rgb.icc" will be used as
    the default.</dd>
</dl>

<dl>
    <dt><code>-sDefaultCMYKProfile=</code><em>filename</em></dt>
<dd>Set the ICC profile that will be associated with
undefined device CMYK color spaces.  If this is not set,
the profile file name "default_cmyk.icc" will be used as
    the default.</dd>
</dl>

<dl>
    <dt><code>-sDeviceNProfile=</code><em>filename</em></dt>
<dd>Associate a DeviceN color space contained in a PS or PDF
document with an ICC profile.  Note that neither PS nor PDF provide
in-document ICC profile definitions for DeviceN color spaces.
With this interface it is possible to provide this definition.
The colorants tag order in the ICC profile defines the lay-down
order of the inks associated with the profile.  A windows-based
tool for creating these source profiles is contained in
    ./toolbin/color/icc_creator.</dd>
</dl>

<dl>
    <dt><code>-sOutputICCProfile=</code><em>filename</em></dt>
<dd>Set the ICC profile that will be associated with
the output device.  Care should be taken to ensure that the
number of colorants associated with the device is the same
as the profile.  If this is not set, an appropriate profile
(i.e. one with the proper number of colorants) will be
selected from those in the directory specified by ICCProfilesDir (see below).
 Note that if the output device is CMYK + spot colorants, a CMYK
profile can be used to provide color management for the CMYK colorants only.
In this case, spot colors will pass through unprocessed assuming the
device supports those colorants.  It is also possible for these devices to
    specify NCLR ICC profiles for output.</dd>
</dl>

<dl>
    <dt><code>-sICCOutputColors=</code><em>"Cyan, Magenta, Yellow, Black, Orange, Violet"</em></dt>
<dd>For the psdcmyk and tiffsep separation devices, the device ICC profile can
be an NCLR profile, which means something that includes non-traditional inks
like Orange, Violet, etc.   In this case, the list of the color names in the
order that they exist in the profile must be provided with this command line
option.   Note that if a color name that is specified for the profile occurs also within
the document (e.g. "Orange" above), then these color names will be associated with
the same separation.  Additional names beyond those of the ICC profile component count
can be included.  In this case, those components will be installed into the tiffsep
or psdcmyk device list of colors, following the ICC profile colors.
The number of spot colors (those that go beyond the standard CMYK colors)
allowed by tiffsep or psdcmyk can be set using -dMaxSpots=#.  The default
value for this is currently set to 10 (GS_SOFT_MAX_SPOTS).
As an example consider the case where we wish to use a 6CLR ICC profile that
includes Orange and Violet, but
need the device to include a specialty color component such as
Varnish, which does not appear in the document and is not handled by the 6CLR ICC
profile.  In addition, we desire
to allow one more spot color of the document to come through to our device.  For
this case using
 <code>-sICCOutputColors=</code><em>"Cyan, Magenta, Yellow, Black, Orange, Violet, Varnish"</em>
  <code>-dMaxSpots=</code><em>4</em>
   <code>-sOutputICCProfile=</code><em>My_6CLR_Profile.icc</em>
would provide the desired outcome.  Note that it is up to the device or
through the use of -sNamedProfile (see below) to involve the setting
of any values in the Varnish channel.  However, if an All color value is encountered
in the document, the Varnish component will have its value
set as will the Orange and Violet values (Likewise if a spot color named Varnish is
encountered in the document the Varnish component will be used for the values).
The All value is typically used
for placing registration targets on separations.
Finally, note that if an NCLR ICC profile is specified
and ICCOutputColors is not used, then a set of default names will be used for
the extra colorants (non-CMYK) in the profile.  These names are given as ICC_COLOR_N for
the Nth non-CMYK channel.</dd>
</dl>

<dl>
    <dt><code>-sProofProfile=</code><em>filename</em></dt>
<dd>
Enable the specificiation of a proofing profile that will make the
color management system link multiple profiles together to emulate the
device defined by the proofing profile.  See the document
    <a href="GS9_Color_Management.pdf">GS9 Color Management</a> for details about this option.</dd>
</dl>

<dl>
    <dt><code>-sDeviceLinkProfile=</code><em>filename</em></dt>
<dd>Define a device link profile.  This profile is used following
the output device profile.  Care should be taken to ensure that the
output device process color model is the same as the output color
space for the device link profile.  In addition, the color space of
the OutputICCProfile should match the input color space of the device
link profile.  For example, the following would be a valid specification
-sDEVICE=tiff32nc -sOutputICCProfile=srgb.icc -sDeviceLinkProfile=linkRGBtoCMYK.icc.
In this case, the output device's color model is CMYK (tiff32nc) and the colors
are mapped through sRGB and through a devicelink profile that maps sRGB to
CMYK values.  See the document
    <a href="GS9_Color_Management.pdf">GS9 Color Management</a> for details about this option.</dd>
</dl>

<dl>
    <dt><code>-sNamedProfile=</code><em>filename</em></dt>
<dd>Define a structure that is to be used by the color management
module (CMM) to provide color management of named colors.  While
the ICC does define a named color format, this structure can in
practice be much more general.  Many developers wish to use
their own proprietary-based format for spot color management.
This command option is for developer use when an implementation
for named color management is designed for the function
gsicc_transform_named_color located in gsicccache.c .  An example
implementation is currently contained in the code for the handling of both
Separation and DeviceN colors.  For the general user this command option
    should really not be used.</dd>
</dl>

<dl>
    <dt><code>-sBlendColorProfile=</code><em>filename</em></dt>
<dd>With the PDF transparency imaging model, a color space can
be specified within which the color blending operations are to
take place. Some files lack this specification, in which case
the blending occurs in the output device's native color space.  This
dependency of blending color space on the device color model
can be avoided by using the above command to force a specific
color space in which to perform the blending. </dd>
</dl>

<dl>
    <dt><code>-dColorAccuracy=</code><em>0/1/2</em></dt>
<dd>Set the level of accuracy that should be used.  A setting of 0 will result in less accurate
color rendering compared to a setting of 2.  However, the creation of a transformation
will be faster at a setting of 0 compared to a setting of 2.
    Default setting is 2.</dd>
</dl>

<dl>
    <dt><code>-dRenderIntent=</code><em>0/1/2/3</em></dt>
<dd>Set the rendering intent that should be used with the
profile specified above by -sOutputICCProfile.  The
options 0, 1, 2, and 3 correspond to the ICC intents of Perceptual, Colorimetric,
    Saturation, and Absolute Colorimetric.</dd>
</dl>

<dl>
    <dt><code>-dBlackPtComp=</code><em>0/1</em></dt>
<dd>Specify if black point compensation should be used with the
    profile specified above by -sOutputICCProfile.</dd>
</dl>

<dl>
    <dt><code>-dKPreserve=</code><em>0/1/2</em></dt>
<dd>Specify if black preservation should be used when mapping
from CMYK to CMYK.   When using littleCMS as the CMM, the code 0
corresponds to no preservation, 1 corresponds to the PRESERVE_K_ONLY approach
described in the littleCMS documentation and 2 corresponds to the
PRESERVE_K_PLANE approach.   This is only valid when using littleCMS for
    color management.</dd>
</dl>

<dl>
    <dt><code>-sVectorICCProfile=</code><em>filename</em></dt>
<dd>Set the ICC profile that will be associated with
the output device for vector-based graphics (e.g. Fill,
Stroke operations).
Care should be taken to ensure that the
number of colorants associated with the device is the same
as the profile.  This can be used to obtain more saturated
    colors for graphics.</dd>
</dl>

<dl>
    <dt><code>-dVectorIntent=</code><em>0/1/2/3</em></dt>
<dd>Set the rendering intent that should be used with vector-based graphic objects.  The
    options are the same as specified for -dRenderIntent.</dd>
</dl>

<dl>
    <dt><code>-dVectorBlackPt=</code><em>0/1</em></dt>
    <dd>Specify if black point compensation should be used for vector-based graphic objects.</dd>
</dl>

<dl>
    <dt><code>-dVectorKPreserve=</code><em>0/1/2</em></dt>
<dd>Specify if black preservation should be used when mapping
from CMYK to CMYK for vector-based graphic objects.   The
    options are the same as specified for -dKPreserve.</dd>
</dl>

<dl>
    <dt><code>-sImageICCProfile=</code><em>filename</em></dt>
<dd>Set the ICC profile that will be associated with
the output device for images.
Care should be taken to ensure that the
number of colorants associated with the device is the same
as the profile.  This can be used to obtain perceptually
    pleasing images.</dd>
</dl>

<dl>
    <dt><code>-dImageIntent=</code><em>0/1/2/3</em></dt>
    <dd>Set the rendering intent that should be used for images.</dd>
</dl>

<dl>
    <dt><code>-dImageBlackPt=</code><em>0/1</em></dt>
    <dd>Specify if black point compensation should be used with images.</dd>
</dl>

<dl>
    <dt><code>-dImageKPreserve=</code><em>0/1/2</em></dt>
<dd>Specify if black preservation should be used when mapping
from CMYK to CMYK for image objects.   The
    options are the same as specified for -dKPreserve.</dd>
</dl>

<dl>
    <dt><code>-sTextICCProfile=</code><em>filename</em></dt>
<dd>Set the ICC profile that will be associated with
the output device for text.
Care should be taken to ensure that the
number of colorants associated with the device is the same
    as the profile.  This can be used ensure K only text.</dd>
</dl>

<dl>
    <dt><code>-dTextIntent=</code><em>0/1/2/3</em></dt>
<dd>Set the rendering intent that should be used text objects.  The
    options are the same as specified for -dRenderIntent.</dd>
</dl>

<dl>
<dt><code>-dTextBlackPt=</code><em>0/1</em></dt>
    <dd>Specify if black point compensation should be used with text objects.</dd>
</dl>

<dl>
    <dt><code>-dTextKPreserve=</code><em>0/1/2</em></dt>
<dd>Specify if black preservation should be used when mapping
from CMYK to CMYK for text objects.   The
    options are the same as specified for -dKPreserve.</dd>
</dl>

<dl>
    <dt><code>-dOverrideICC</code></dt>
<dd>Override any ICC profiles contained in the source
document with the profiles specified by
sDefaultGrayProfile, sDefaultRGBProfile, sDefaultCMYKProfile.
Note that if no profiles are specified for the default
Device color spaces, then
the system default profiles will be used.  For detailed override
control in the specification of source colors see
    <a href="#SourceObjectICC">SourceObjectICC</a>.</dd>
</dl>

<dl>
    <dt><a name="SourceObjectICC"></a><code>-sSourceObjectICC=</code><em>filename</em></dt>
<dd>
This option provides an extreme level of override control to
specify the source color spaces and rendering intents to use
with vector-based graphics, images and text for both RGB and CMYK source
objects.  The specification is made through a file that contains
on a line a key name to specify the object type (e.g. Image_CMYK)
followed by an ICC profile file name, a rendering intent
number (0 for perceptual, 1 for colorimetric, 2 for saturation,
3 for absolute colorimetric) and information for black point compensation,
black preservation, and source ICC override.   It is also possible to turn
off color management for certain object types, use device link profiles for
object types and do custom color replacements.  An example file is given in
./gs/toolbin/color/src_color/objsrc_profiles_example.txt.
Profiles to demonstrate this method of specification are also
included in this folder.  Note that if objects are colorimetrically
specified through this mechanism other operations like -dImageIntent,
-dOverrideICC, have no affect.  See further details in the document
    <a href="GS9_Color_Management.pdf">GS9 Color Management</a>.</dd>
</dl>

<dl>
    <dt><code>-dDeviceGrayToK=</code><em>true/false</em></dt>
<dd>
By default, Ghostscript will map DeviceGray color spaces to
pure K when the output device is CMYK based.  This may not
always be desired.  In particular, it may be desired to map
from the gray ICC profile specified by -sDefaultGrayProfile
to the output device profile.  To achieve this, one should
    specify -dDeviceGrayToK=false.</dd>
</dl>

<dl>
    <dt><code>-dUseFastColor=</code><em>true/false</em></dt>
<dd>
This is used to avoid the use of ICC profiles for source colors. This
includes those that are defined by DeviceGray, DeviceRGB and DeviceCMYK definitions
as well as ICC-based color spaces in the source document.  With
UseFastColor set to true, the traditional Postscript 255 minus operations
are used to convert between RGB and CMYK with black generation and undercolor
    removal mappings.</dd>
</dl>

<dl>
    <dt><code>-dSimulateOverprint=</code><em>true/false</em></dt>
<dd>
This option has been replaced by <code><b>-dOverprint=</b></code>
</dd>
</dl>


<dl>

    <dt><a name="Overprint"></a><code>-dOverprint=</code><em>/enable | /disable | /simulate</em></dt>
<dd>
This option provides control of overprinting.  The default setting is <em><b>/enable</b></em>
which allows devices such as CMYK that can support overprint to leave planes unchanged
under control of PostScript and PDF overprint settings.
<p>
The <em><b>/disable</b></em> setting ignores all overprint (and overprint mode) from the input.
<p>
If <em><b>/simulate</b></em> is set, then pages with overprint (or overprint mode) set for
CMYK or Separation colors will be internally maintained and output to RGB or Gray
devices.
<p>
Note that not all spot color overprint cases can be accurately simulated with a CMYK
only device.   For example, a case where you have a spot color overprinted with CMYK
colors will be indistiguishable from a case where you have spot color equivalent
CMYK colorants overprinted with CMYK colors, even though they may need to show
significantly different overprint simulations.  To obtain a full overprint simulation,
use the <em><b>/simulate</b></em> setting or the psdcmyk or tiffsep device, where the spot
colors are kept in their own individual planes.</dd>
</dl>

<dl>
    <dt><code>-dUsePDFX3Profile=</code><em>int</em></dt>
<dd>
This option enables rendering with an output intent defined in
the PDF source file.   If this option is included in the command line,
source device color values (e.g DeviceCMYK, DeviceRGB, or DeviceGray)
that match the color model of the output intent will be interpreted to
be in the output intent color space.   In addition, if the output device
color model matches the output intent color model, then the
destination ICC profile will be the output intent ICC profile.

If there is a mismatch between the device color model and the
output intent, the output intent profile will be used as a
proofing profile, since that is the intended rendering.

Note that a PDF document can have multiple
rendering intents per the PDF specification.  As such, with
the option -dUsePDFX3Profile the first output intent
encountered will be used.   It is possible to specify
a particular output intent where <em>int</em> is an
integer (a value of 0 is the same as not specifying a number).
Probing of the output intents for a particular file
is possible using extractICCprofiles.ps in ./gs/toolbin.

Finally, note that the ICC profile member entry is an option in
the output intent dictionary.   In these cases, the output intent
specifies a registry and a standard profile (e.g. Fogra39).  Ghostscript will
not make use of these output intents.  Instead, if desired, these standard
    profiles should be used with the commands specified above (e.g. -sOutputICCProfile).</dd>
</dl>

<dl>
    <dt><code>-sUseOutputIntent=</code><em>string</em></dt>
<dd>Like <code>UsePDFX3Profile</code> above, this option enables rendering with an output intent defined in the
    PDF source file.
<p>
This option behaves the same way as the <code>UsePDFX3Profile</code>, but the selection criteria are different.
Because its possible (as of PDF 2.0) for each page to have a different array, its not sufficient just to supply
an array index, as the same profile might potentially be at different indices in each array.</p>
<p>
Instead this option takes a string, which is first compared against the <code>OutputConditionIdentifier</code>
in each OutputIntent in the array. If the <code>OutputConditionIdentifier</code> is not a standard identifier
then it should be Custom and the <code>UseOutputIntent</code> string will be matched against the value of the
<code>Info</code> key instead. If the <code>OutputConditionIdentifier</code> or <code>Info</code> matches the
value of <code>UseOuttpuIntent</code>, then that OutputIntent is selected <b>if</b> the OutputIntent contains
a <code>DestOutputProfile</code> key.</p>
</dd>
</dl>

<dl>
    <dt><code>-sICCProfilesDir=</code><em>path</em></dt>
<dd>Set a directory in which to search for the above profiles.
    The directory path must end with a file system delimiter.
<p>
If the user doesn't use the -sICCProfilesDir= command line option,
Ghostscript creates a default value for it by looking on the
directory paths explained in <a href="#Finding_files">How
Ghostscript finds files</a>.  If the current directory is the first
path a test is made for the iccprofiles directory. Next, the remaining
paths with the string Resource in it are tested.  The prefix up to
the path separator character preceding the string Resource, concatenated
with the string iccprofiles is used and if this exists, then this
path will be used for ICCProfilesDir.</p>
<p>
Note that if the build is performed with COMPILE_INITS=1,
then the profiles contained in gs/iccprofiles will be placed in
the ROM file system.  If a directory is specified on the command
line using -sICCProfilesDir=, that directory is searched before
the iccprofiles/ directory of the ROM file system is searched.</p>
<p>
<b><font size="+1">
A note for Windows users, Artifex recommends the use of the
forward slash delimiter due to the special interpretation of \" by
the Microsoft C startup code.  See
<a href="http://msdn.microsoft.com/en-us/library/a1y7w461.aspx">Parsing C Command-Line Arguments</a>
for more information.
</font></b></p>
</dd>
</dl>

<h4><a name="Other_parameters"></a>Other parameters</h4>

<dl>
<dt><code>-dFILTERIMAGE</code></dt>
<dd>If set, ths will ignore all images in the input (in this context image means a bitmap), these will
therefore not be rendered.</dd>
</dl>

<dl>
<dt><code>-dFILTERTEXT</code></dt>
<dd>If set, ths will ignore all text in the input (just because it looks like text doesn't mean it is, it might be an image), text will
therefore not be rendered.</dd>
</dl>

<dl>
<dt><code>-dFILTERVECTOR</code></dt>
<dd>If set, ths will ignore anything whch is neither text nor an image..</dd>
</dl>

<dl>
    <dt><code>-dDELAYBIND</code></dt>
<dd>Causes <code>bind</code> to remember all its invocations, but not
actually execute them until the <code>.bindnow</code> procedure is
called.  Useful only for certain specialized packages like
<code>pstotext</code> that redefine operators. See the documentation
for <a href="Language.htm#bindnow"><code>.bindnow</code></a> for more information
    on using this feature.</dd>
</dl>

<dl>
    <dt><code>-dDOPDFMARKS</code></dt>
<dd>Causes <code>pdfmark</code> to be called for bookmarks,
annotations, links and cropbox when processing PDF files.
Normally, <code>pdfmark</code> is only called for these types
for PostScript files or when the output device requests it
    (e.g. pdfwrite device).</dd>
</dl>

<dl>
    <dt><code>-dJOBSERVER</code></dt>
<dd>Define <code>\004 (^D)</code> to start a new encapsulated job used for
compatibility with Adobe PS Interpreters that ordinarily run under a job
server. The <code>-dNOOUTERSAVE</code> switch is ignored if <code>-dJOBSERVER</code>
is specified since job servers <b>always</b> execute the input PostScript
under a save level, although the <code>exitserver</code> operator can
be used to escape from the encapsulated job and execute as if the
    <code>-dNOOUTERSAVE</code> was specified.
<p>
This also requires that the input be from stdin, otherwise an error will
result (<code>Error: /invalidrestore in --restore--</code>).</p>
<p>Example usage is:
<pre>
    gs ... -dJOBSERVER - &lt; inputfile.ps
                     -or-
    cat inputfile.ps | gs ... -dJOBSERVER -
</pre>
<b>Note: </b>The <code>^D</code> does not result in an end-of-file action
on stdin as it may on some PostScript printers that rely on TBCP (Tagged
Binary Communication Protocol) to cause an out-of-band <code>^D</code> to
signal EOF in a stream input data. This means that direct file actions
on stdin such as <code>flushfile</code> and <code>closefile</code>
will affect processing of data beyond the <code>^D</code> in the stream.</p>
</dd>
</dl>

<dl>
    <dt><code>-dNOCACHE</code></dt>
    <dd>Disables character caching.  Useful only for debugging.</dd>
</dl>

<dl>
    <dt><code>-dNOGC</code></dt>
<dd>Suppresses the initial automatic enabling of the garbage collector in
Level 2 systems.  (The <code>vmreclaim</code> operator is not disabled.)
    Useful only for debugging.</dd>
</dl>

<dl>
    <dt><code>-dNOOUTERSAVE</code></dt>
<dd>Suppresses the initial save that is used for compatibility with Adobe
PS Interpreters that ordinarily run under a job server. If a job server is
going to be used to set up the outermost save level, then <code>-dNOOUTERSAVE</code>
should be used so that the restore between jobs will restore global VM as
    expected.</dd>
</dl>

<a name="NoSafer"></a>
<dl>
    <dt><code>-dNOSAFER</code> (equivalent to <code>-dDELAYSAFER</code>).</dt>
<dd>This flag disables SAFER mode until the <code>.setsafe</code>
procedure is run. This is intended for clients or scripts that cannot
operate in SAFER mode. If Ghostscript is started with <code>-dNOSAFER</code>
or <code>-dDELAYSAFER</code>, PostScript programs are allowed to read, write,
rename or delete any files in the system that are not protected by operating
system permissions.
<p><b>This mode should be used with caution, and <code>.setsafe</code> should be
    run prior to running any PostScript file with unknown contents.</b></p>

    </dd>
</dl>
<a name="Safer"></a>
<dl>
    <dt><code>-dSAFER</code></dt>
<dd>
<strong>IMPORTANT NOTE:</strong> Ghostscript now (as of 9.50) defaults to SAFER being active.
<p>
Enables access controls on files. Access controls fall into three categories,
files from which Ghostscript is permitted to read, ones to which it is permitted
to write, and ones over which it has &quot;control&quot; (i.e. delete/rename). These
access controls apply to <strong>all</strong> files accessed via Ghostscript's internal
interface to the C library file handling. Whilst we have taken considerable pains to
ensure that all the code we maintain (as well as the so called &quot;contrib&quot; devices,
that are devices included in our release packages, but not strictly maintained by the
Ghostscript development team) uses this interface, we have no control over thirdparty
code.
<p>
This is an entirely new implementation of <code>SAFER</code> for Ghostscript versions
9.50 and later. Earlier versions (see "<a href="#OldSafer">-dOLDSAFER</a>") relied on
storing the file permission lists in Postscript VM (Virtual Memory), and only applied
file access permissions to the Postscript file related operators. It relied on restricting
the function of <code>setpagedevice</code> to avoid the device code from being manipulated
into opening arbitrary files. The application of the file permissions was done within the
internal context of the Postscript interpreter, and some other aspects of the Postscript
restrictions were applied in the Postscript environment. With so many of the feature's
capabilities relying on the Postscript context and environment, by using other (Ghostscript
specific) features maliciously, the restrictions could be overridden.
<p>
Whilst the path storage and application of the permissions is implemented entirely in C,
it is still possible for Postscript to add and remove paths from the permissions lists
(see <a href="Language.htm#.addcontrolpath">.addcontrolpath</a>) until such time as the
access controls are enabled (see <a href="Language.htm#.activatepathcontrol">.activatepathcontrol</a>),
any call to <code>.addcontrolpath</code> after <code>.activatepathcontrol</code> will result in a
<code>Fatal</code> error causing the interpreter to immediately exit.
<p>
An incompatibility exists between the pre-9.50 and 9.50 and later <code>SAFER</code>.
By removing storage and application entirely from the Postscript language
environment and internal context, SAFER is no longer affected by Postscript
<code>save</code>&sol;<code>restore</code> operations. Previously, it was possible
to do the equivalent of:
<blockquote>
<br><code>save</code>
<br><code>.setsafe</code>
<br><code>Postscript ops</code>
<br><code>restore</code>
</blockquote>
<p>
In that sequence, the <code>Postscript ops</code> would run with <code>SAFER</code> protection
but after the restore, <code>SAFER</code> would no longer be in force. This is no longer the case.
After the call to <code>.setsafe</code> the file controls are in force until the
interpreter exits. As the 9.50 and later implementation no longer restricts the
operation of <code>setpagedevice</code>, and because this capability is <i>extremely</i>
rarely used, we feel the improvement in security warrants the small reduction in
flexibility.
<p>
Path matching is very simple: it is case sensitive, and we do not implement full featured
&quot;globbing&quot; or regular expression matching (such complexity would significantly
and negatively impact performance). Further, the string parameter(s) passed to the
<code>--permit-file-*</code> option must exactly match the string(s) used to reference
the file(s): for example, you cannot use a absolute path to grant permission, and
then a relative path to reference the file (or vice versa) - the path match will fail.
Similarly, you cannot grant permission through one symlink, and then reference a file
directly, or through an alternative symlink - again, the matching will fail.
<p>
The following cases are handled:
<ul>
<li>
<dl><dt></dt><dd><code>&quot;&sol;path&sol;to&sol;file&quot;</code></dd></dl>
<p>Permits access only to the file: &quot;&sol;path&sol;to&sol;file&quot;
</li>
<li>
<dl><dt></dt><dd><code>&quot;&sol;path&sol;to&sol;directory&sol;&quot;</code></dd></dl>
<p>Permits access to any file in, and only in, the directory: &quot;&sol;path&sol;to&sol;directory&quot;
</li>
<li>
<dl><dt></dt><dd><code>&quot;&sol;path&sol;to&sol;directory&sol;*&quot;</code></dd></dl>
<p>Permits access to any file in the directory: &quot;&sol;path&sol;to&sol;directory&quot; and
any child of that directory.
</li>
</ul>
<p><strong>Important Note for Windows Users</strong>:
<br>
The file/path pattern matching is case sensitive, even on Windows. This is a
change in behaviour compared to the old code which, on Windows, was case
<i>in</i>sensitive. This is in recognition of changes in Windows behaviour,
in that it now supports (although does not enforce) case sensitivity.
<p>
Four command line parameters permit explicit control of the paths included in
the access control lists:
<ul>
<li><dl><dt></dt><dd><code>--permit-file-read=<em>pathlist</em></code></dd></dl>
<p> Adds a path, or list of paths, to the "permit read" list. A list
of paths is a series of paths separated by the appropriate path list separator
for your platform (for example, on Unix-like systems it is &quot;&colon;&quot;
and on MS Windows it is &quot;;&quot;).
</li>
<li><dl><dt></dt><dd><code>--permit-file-write=<em>pathlist</em></code></dd></dl>
<p> Adds a path, or list of paths, to the "permit write" list. A list
of paths is a series of paths separated by the appropriate path list separator
for your platform (for example, on Unix-like systems it is &quot;&colon;&quot;
and on MS Windows it is &quot;;&quot;).
</li>
<li><dl><dt></dt><dd><code>--permit-file-control=<em>pathlist</em></code></dd></dl>
<p> Adds a path, or list of paths, to the "permit control" list. A list
of paths is a series of paths separated by the appropriate path list separator
for your platform (for example, on Unix-like systems it is &quot;&colon;&quot;
and on MS Windows it is &quot;;&quot;).
</li>
<li><dl><dt></dt><dd><code>--permit-file-all=<em>pathlist</em></code></dd></dl>
<p> Adds a path, or list of paths, to the all the above lists. A list
of paths is a series of paths separated by the appropriate path list separator
for your platform (for example, on Unix-like systems it is &quot;&colon;&quot;
and on MS Windows it is &quot;;&quot;).
</li>
</ul>
<p>
'*' may be used as a wildcard in the above paths to mean "any
character other than the directory separator. Do not use two
or more *'s without intervening characters.
<p>
Finally, paths supplied on the command line (such as those in <code>-I</code>,
<code>-sFONTPATH</code> parameters) are added to the permitted reading list.
Similarly, paths read during initialisation from <code>Fontmap</code>, <code>cidfmap</code>,
and the platform specific font file enumeration (e.g. <code>fontconfig</code> on Unix systems)
are automatically added to the permit read lists.
</dd>
</dl>
<br>
<a name="OldSafer"></a>
<dl>
    <dt><code>-dOLDSAFER</code></dt>
<dd>
<strong>NOTE: This enables deprecated code which will shortly be removed</strong>
<p>Used in combination with <code>-dSAFER</code> (or <code>.setsafe</code>) enables
the pre-9.50 SAFER implementation. It is included (for now) in case any users find
a case where the 9.50 and later <code>SAFER</code> does not work for them. It means
such users can keep working until we have assessed the issue, and distributed a solution.
<p>
Disables the <code>deletefile</code> and <code>renamefile</code>
operators, and the ability to open piped commands (<code>%pipe%</code><em>cmd</em>)
at all. Only <code>%stdout</code> and <code>%stderr</code> can be opened
for writing.  Disables reading of files other than <code>%stdin</code>,
those given as a command line argument, or those contained on one of the paths
given by LIBPATH and FONTPATH and specified by the system params /FontResourceDir
and /GenericResourceDir.
<p>
This mode also sets the <a href="Language.htm#LockSafetyParams">.LockSafetyParams</a>
parameter of the default device, or the device specified with the <code>-sDEVICE= </code>
switch to protect against programs that attempt to write to files using the
OutputFile device parameter. Note that since the device parameters specified
on the command line (including OutputFile) are set prior to SAFER mode,
the <code>-sOutputFile=...</code> on the command line is unrestricted.</p>
<p>
SAFER mode also prevents changing the /GenericResourceDir, /FontResourceDir
and either the /SystemParamsPassword or the /StartJobPassword.</p>
<p>
When running -dNOSAFER it is possible to perform a <code>save</code>,
followed by <code>.setsafe</code>, execute a file or procedure in SAFER mode,
then use <code>restore</code> to return to NOSAFER mode. It is possible that the
a crafted foreign file could restore back to a point when NOSAFER was in operation.</p>
</dd>
</dl>

<dl>
    <dt><code>-dPreBandThreshold=true/false</code></dt>
<dd>If the target device is a halftone device, then images that are
normally stored in the command list during banded output will be halftoned during
the command list writing phase, if the resulting image will result in a smaller
command list.   The decision to halftone depends upon the output and source resolution as well as
    the output and source color space.</dd>
</dl>

<dl>
    <dt><code>-dWRITESYSTEMDICT</code></dt>
<dd>Leaves <code>systemdict</code> writable.  This is necessary when
running special utility programs such as <code>font2c</code> and
<code>pcharstr</code>, which must bypass normal PostScript access
    protection.</dd>
</dl>

<hr>

<h2><a name="Improving_performance"></a>Improving performance</h2>

<p>
Ghostscript attempts to find an optimum balance between speed and memory
consumption, but there are some cases in which you may get a very large
speedup by telling Ghostscript to use more memory.</p>

<p>Please note that this discussion relates to devices which produce a bitmap format as the output.
These parameters have no effect on the vector devices, such as pdfwrite.</p>

<ul>
<li>
For raster printers and image format (jpeg*, tiff*, png* ...) devices,
performance can be 'tuned' by adjusting some of the parameters related
to banding (clist) options (refer to: <a href="Language.htm#Banding_parameters">
Banding Parameters</a>).</li>
<li>
<p>
All devices may use a display list ("clist") and use banding when rendering
PDF 1.4 transparency. This prevents allocation of excessively large amounts of
memory for the transparency buffer stack. The <code>-dMaxBitmap=</code> option
is used to control when to use the display list, and the other banding parameters
mentioned above control the band size.</p>

<p>In general, page buffer mode is faster than banded/clist mode (a full page
buffer is used when <code>-dMaxBitmap=#</code> is large enough for the entire
raster image) since there is no need to write, then interpret the clist data.</p>

<p>On a multi-core system where multiple threads can be dispatched to
individual processors/cores, banding mode may provide higher performance
since <code>-dNumRenderingThreads=#</code> can be used to take advantage of
more than one CPU core when rendering the clist. The number of threads should
generally be set to the number of available processor cores for best throughput.</p>

<p>In general, larger <code>-dBufferSpace=#</code> values provide
slightly higher performance since the per-band overhead is reduced.</p>
</li>
<li>
If you are using X Windows, setting the <code>-dMaxBitmap=</code>
parameter described <a href="#X_device_parameters">above</a> may
dramatically improve performance on files that have a lot of bitmap images.</li>

<li>
With some PDF files, or if you are using Chinese, Japanese, or other fonts with
very large character sets, adding the following sequence of switches before the
first file name may dramatically improve performance at the cost of an additional
memory. For example, to allow use of 30Mb of extra RAM use:

    <code>-c&nbsp;30000000&nbsp;setvmthreshold&nbsp;-f</code>.
<p>This can also be useful in processing large documents when using a
high-level (vector) output device (like pdfwrite) that maintains significant internal
state.</p></li>

<li>
<p>
For pattern tiles that are very large, Ghostscript uses an internal display
list (memory based clist), but this can slow things down. The current default
threshold is 8Mb -- pattern tiles larger than this will be cached as clist
rather than bitmap tiles. The parameter <code>-dMaxPatternBitmap=#</code> can
be used to adjust this threshold, smaller to reduce memory requirements and
    larger to avoid performance impacts due to clist based pattern handling.</p>
<p>
For example, <code>-dMaxPatternBitmap=200000</code> will use clist based
    patterns for pattern tiles larger than 200,000 bytes.</p></li>
</ul>
<hr>
<h2><a name="Environment_variables"></a>Summary of environment variables</h2>

<dl>
    <dt><code>GS</code>, <code>GSC</code> (MS Windows only)</dt>
<dd>Specify the names of the Ghostscript executables.  <code>GS</code>
brings up a new typein window and possibly a graphics window;
<code>GSC</code> uses the DOS console.  If these are not set,
<code>GS</code> defaults to <code>gswin32</code>, and
    <code>GSC</code> defaults to <code>gswin32c</code>.</dd>
</dl>

<dl>
    <dt><a href="#GS_DEVICE"><code>GS_DEVICE</code></a></dt>
<dd>Defines the default output device. This overrides the compiled-in default, but is overridden by any commandline setting.</dd>
</dl>

<dl>
    <dt><a href="#Font_lookup"><code>GS_FONTPATH</code></a></dt>
<dd>Specifies a list of directories to scan for fonts if a font requested
    can't be found anywhere on the search path.</dd>
</dl>

<dl>
    <dt><a href="#Finding_files"><code>GS_LIB</code></a></dt>
    <dd>Provides a search path for initialization files and fonts.</dd>
</dl>

<dl>
    <dt><code>GS_OPTIONS</code></dt>
<dd>Defines a list of command-line arguments to be processed before the
ones actually specified on the command line.  For example, setting
<code>GS_DEVICE</code> to XYZ is equivalent to setting
<code>GS_OPTIONS</code> to <code>-sDEVICE=XYZ</code>.  The contents
of <code>GS_OPTIONS</code> are not limited to switches; they may include
    actual file names or even <a href="#Input_control">"@file" arguments</a>.</dd>

</dl>

<dl>
    <dt><a href="#Temp_files"><code>TEMP</code>, <code>TMPDIR</code></a></dt>
<dd>Defines a directory name for temporary files.  If both
<code>TEMP</code> and <code>TMPDIR</code> are defined,
    <code>TMPDIR</code> takes precedence.</dd>
</dl>

<hr>

<h2><a name="Debugging"></a>Debugging</h2>

<p>
The information here describing is probably interesting only to developers.</p>

<h3><a name="Debug_switches"></a>Debug switches</h3>

<p>There are several debugging switches that are detected by the interpreter.
These switches are available whether or not Ghostscript was built with the
DEBUG macro defined to the compiler (refer to <a href="Make.htm#Debugging">
building a debugging configuration</a>).</p>

<p>Previous to 8.10, there was a single DEBUG flag, enabled with <code>-dDEBUG
</code> on the command line. Now there are several debugging flags to allow
more selective debugging information to be printed containing only what is
needed to investigate particular areas. For backward compatibilty, the
<code>-dDEBUG</code> option will set all of the subset switches.</p>

<table>
  <tr><td><code>-dCCFONTDEBUG</code></td><td>Compiled Fonts</td></tr>
  <tr><td><code>-dCFFDEBUG</code></td><td>CFF Fonts</td></tr>
  <tr><td><code>-dCMAPDEBUG</code></td><td>CMAP</td></tr>
  <tr><td><code>-dDOCIEDEBUG</code></td><td>CIE color</td></tr>
  <tr><td><code>-dEPSDEBUG</code></td><td>EPS handling</td></tr>
  <tr><td><code>-dFAPIDEBUG</code></td><td>Font API</td></tr>
  <tr><td><code>-dINITDEBUG</code></td><td>Initialization</td></tr>
  <tr><td><code>-dPDFDEBUG</code></td><td>PDF Interpreter</td></tr>
  <tr><td><code>-dPDFWRDEBUG</code></td><td>PDF Writer</td></tr>
  <tr><td><code>-dSETPDDEBUG</code></td><td>setpagedevice</td></tr>
  <tr><td><code>-dSTRESDEBUG</code></td><td>Static Resources</td></tr>
  <tr><td><code>-dTTFDEBUG</code></td><td>TTF Fonts</td></tr>
  <tr><td><code>-dVGIFDEBUG</code></td><td>ViewGIF</td></tr>
  <tr><td><code>-dVJPGDEBUG</code></td><td>ViewJPEG</td></tr>
</table>

<p>
The PDF interpreter normally tries to repair, or ignore, all problems encountered in PDF files.
Setting <code>-dPDFSTOPONERROR</code> instead causes the interpreter to signal an error and
stop processing the PDF file, instead of printing a warning.
</p><p>
The <code>-dPDFSTOPONWARNING</code> switch behaves the same, but will stop if a condition
which would normally merit a warning (instead of an error) is encountered. Note that
setting <code>-dPDFSTOPONWARNING</code> also sets <code>-dPDFSTOPONERROR</code>.
</p>

<p>
The <code>-Z</code> and <code>-T</code> switches apply only
if the interpreter was <a href="Make.htm#Debugging">built for a debugging
configuration</a>.  In the table below, the first column is a debugging
switch, the second is an equivalent switch (if any) and the third is its
usage.</p>

<blockquote>
<table>
    <tr><th colspan="2">Switches used in debugging</th></tr>
    <tr>    <th align="left">Switch</th>



        <th align="left">&nbsp;Description</th></tr>
    <tr>    <td valign="top"><code>-B</code><em>size</em></td>

        <td>Run all subsequent files named on the command line (except for
            <code>-F</code>) through the run_string interface, using a
            buffer of <em>size</em> bytes</td></tr>
    <tr>    <td valign="top"><code>-B-</code></td>

        <td>Turn off <code>-B</code>: run subsequent files (except for
            <code>-F</code>) directly in the normal way</td></tr>
    <tr>    <td valign="top"><code>-F</code><em>file</em></td>

        <td>Execute the file with <code>-B1</code> temporarily in effect</td></tr>
    <tr>    <td valign="top"><code>-K</code><em>n</em></td>

        <td>Limit the total amount of memory that the interpreter can have
            allocated at any one time to <b><em>n</em></b>K bytes.
            <b><em>n</em></b> is a positive decimal integer.</td></tr>
    <tr>    <td valign="top"><code>-M</code><em>n</em></td>

        <td>Force the interpreter's allocator to acquire additional memory
            in units of <b><em>n</em></b>K bytes, rather than the default
            20K. <b><em>n</em></b> is a positive decimal integer, on
            16-bit systems no greater than 63.</td></tr>
<tr>    <td valign="top"><code>-N</code><em>n</em></td>

        <td>Allocate space for <b><em>n</em></b>K names, rather than the
            default (normally 64K).  <b><em>n</em></b> may be greater than
            64 only if <code>EXTEND_NAMES</code> was defined (in
            inameidx.h) when the interpreter was compiled .</td></tr>
<tr>    <td valign="top"><code>-Z</code><em>xxx</em><br><code>-Z-</code><em>xxx</em></td>

        <td>Turn debugging printout on (off). Each of the <em>xxx</em>
            characters selects an option.  Case is significant: "a" and
            "A" have different meanings.</td></tr>
</table>

<dl compact>
<dt><code>0</code><dd>garbage collector, minimal detail</dd></dt>
<dt><code>1</code><dd>type 1 and type 42 font interpreter</dd></dt>
<dt><code>2</code><dd>curve subdivider/rasterizer</dd></dt>
<dt>&nbsp;&nbsp;&nbsp;<code>3</code><dd>curve subdivider/rasterizer, detail</dd></dt>
<dt><code>4</code><dd>garbage collector (strings)</dd></dt>
<dt>&nbsp;&nbsp;&nbsp;<code>5</code><dd>garbage collector (strings, detail)</dd></dt>
<dt><code>6</code><dd>garbage collector (clumps, roots)</dd></dt>
<dt>&nbsp;&nbsp;&nbsp;<code>7</code><dd>garbage collector (objects)</dd></dt>
<dt>&nbsp;&nbsp;&nbsp;<code>8</code><dd>garbage collector (refs)</dd></dt>
<dt>&nbsp;&nbsp;&nbsp;<code>9</code><dd>garbage collector (pointers)</dd></dt>
<dt><code>a</code><dd>allocator (large blocks only)</dd></dt>
<dt>&nbsp;&nbsp;&nbsp;<code>A</code><dd>allocator (all calls)</dd></dt>
<dt><code>b</code><dd>bitmap image processor</dd></dt>
<dt>&nbsp;&nbsp;&nbsp;<code>B</code><dd>bitmap images, detail</dd></dt>
<dt><code>c</code><dd>color/halftone mapper</dd></dt>
<dt><code>d</code><dd>dictionary put/undef</dd></dt>
<dt>&nbsp;&nbsp;&nbsp;<code>D</code><dd>dictionary lookups</dd></dt>
<dt><code>e</code><dd>external (OS-related) calls</dd></dt>
<dt><code>f</code><dd>fill algorithm (summary)</dd></dt>
<dt>&nbsp;&nbsp;&nbsp;<code>F</code><dd>fill algorithm (detail)</dd></dt>
<dt><code>g</code><dd>gsave/grestore[all]</dd></dt>
<dt><code>h</code><dd>halftone renderer</dd></dt>
<dt>&nbsp;&nbsp;&nbsp;<code>H</code><dd>halftones, every pixel</dd></dt>
<dt><code>i</code><dd>interpreter, just names</dd></dt>
<dt>&nbsp;&nbsp;&nbsp;<code>I</code><dd>interpreter, everything</dd></dt>
<dt><code>j</code><dd>(Japanese) composite fonts</dd></dt>
<dt><code>k</code><dd>character cache and xfonts</dd></dt>
<dt>&nbsp;&nbsp;&nbsp;<code>K</code><dd>character cache, every access</dd></dt>
<dt><code>l</code><dd>command lists, bands</dd></dt>
<dt>&nbsp;&nbsp;&nbsp;<code>L</code><dd>command lists, everything</dd></dt>
<dt><code>m</code><dd>makefont and font cache</dd></dt>
<dt><code>n</code><dd>name lookup (new names only)</dd></dt>
<dt><code>o</code><dd>outliner (stroke)</dd></dt>
<dt>&nbsp;&nbsp;&nbsp;<code>O</code><dd>stroke detail</dd></dt>
<dt><code>p</code><dd>band list paths</dd></dt>
<dt>&nbsp;&nbsp;&nbsp;<code>P</code><dd>all paths</dd></dt>
<dt><code>q</code><dd>clipping</dd></dt>
<dt><code>r</code><dd>arc renderer</dd></dt>
<dt><code>s</code><dd>streams</dd></dt>
<dt>&nbsp;&nbsp;&nbsp;<code>S</code><dd>scanner</dd></dt>
<dt><code>t</code><dd>tiling algorithm</dd></dt>
<dt><code>u</code><dd>undo saver (for save/restore), finalization</dd></dt>
<dt>&nbsp;&nbsp;&nbsp;<code>U</code><dd>undo saver, more detail</dd></dt>
<dt><code>v</code><dd>compositors: alpha/transparency/overprint/rop</dd></dt>
<dt>&nbsp;&nbsp;&nbsp;<code>V</code><dd>compositors: alpha/transparency/overprint/rop, more detail</dd></dt>
<dt><code>w</code><dd>compression encoder/decoder</dd></dt>
<dt><code>x</code><dd>transformations</dd></dt>
<dt><code>y</code><dd>Type 1 hints</dd></dt>
<dt>&nbsp;&nbsp;&nbsp;<code>Y</code><dd>Type 1 hints, every access</dd></dt>
<dt><code>z</code><dd>trapezoid fill</dd></dt>
<dt><code>#</code><dd>operator error returns</dd></dt>
<dt><code>%</code><dd>externally processed comments</dd></dt>
<dt><code>*</code><dd>image and RasterOp parameters</dd></dt>
<dt><code>:</code><dd>command list and allocator/time summary</dd></dt>
<dt><code>~</code><dd>math functions and Functions</dd></dt>
<dt><code>'</code><dd>contexts, create/destroy</dd></dt>
<dt>&nbsp;&nbsp;&nbsp;<code>"</code><dd>contexts, every operation</dd></dt>
<dt><code>^</code><dd>reference counting</dd></dt>
<dt><code>_</code><dd>high-level (vector) output</dd></dt>
<dt><code>!</code><dd>Postscript operator names (this option is available only when Ghostscript is compiled with a predefined macro DEBUG_TRACE_PS_OPERATORS)</dd></dt>
<dt><code>|</code><dd>(reserved for experimental code)</dd></dt>
</dl>

<p>
The following switch affects what is printed, but does not select specific
    items for printing:</p>

<dl compact>
    <dt><code>/</code><dd>include file name and line number on all trace output</dd></dt>
</dl>

<p>
    These switches select debugging options other than what should be printed:</p>

<dl compact>
<dt><code>&#36;</code><dd>set unused parts of object references to
identifiable garbage values</dd></dt>
<dt><code>+</code><dd>use minimum-size stack blocks</dd></dt>
<dt><code>,</code><dd>don't use path-based banding</dd></dt>
<dt><code>`</code><dd>don't use high-level banded images</dd></dt>
<dt><code>?</code><dd>validate pointers before, during and after garbage
collection, also before and after save and restore; also make other
allocator validity checks</dd></dt>
<dt><code>@</code><dd>fill newly allocated, garbage-collected, and freed
storage with a marker (a1, c1, and f1 respectively)</dd></dt>
</dl>

<tr>    <td valign="top"><code>-T</code><em>xxx</em><br><code>-T-</code><em>xxx</em></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>Turn <a href="#Visual_trace">Visual Trace</a> on (off). Each of the <em>xxx</em>
            characters selects an option.  Case is significant: "f" and
            "F" have different meanings.</td></tr>

<dl compact>
<dt><code>f</code><dd>the filling algorithm with characters</dd></dt>
<dt><code>F</code><dd>the filling algorithm with non-character paths</dd></dt>
<dt><code>h</code><dd>the Type 1 hinter</dd></dt>
<dt><code>s</code><dd>the shading algorithm</dd></dt>
<dt><code>S</code><dd>the stroking algorithm</dd></dt>
</dl>
</blockquote>

<p>In addition, calling ghostscript with <code>--debug</code> will list all the currently
defined (non visual trace) debugging flags, both in their short form (as listed
above for use with <code>-Z</code>) and in a long form, which can be used as in:
<code>--debug=tiling,alloc</code>. All the short form flags for <code>-Z</code>
have an equivalent long form. Future flags may be added with a long form only
    (due to all the short form flags being used already).</p>

<h4><a name="Visual_trace"></a>Visual Trace</h4>

<p>
Visual Trace allows to view internal Ghostscript data in a graphical form
while execution of C code.  Special
<a href="Lib.htm#Visual_trace">instructions</a> to be inserted into
C code for generating the output. Client application
rasterizes it into a window.</p>

<p>
Currently the rasterization is implemented for Windows only, in clients
gswin32.exe and gswin32c.exe. They open Visual Trace window when graphical
debug output appears, <code>-T</code> <a href="#Debug_switches">switch</a> is set,
and Ghostscript was <a href="Make.htm#Debugging">built</a> with DEBUG option.
There are two important incompletenesses of the implementation :</p>

<p>
1. The graphical output uses a hardcoded scale. An advanced client
would provide a scale option via user interface.</p>

<p>
2. Breaks are not implemented in the client. If you need a step-by-step
view, you should use an interactive C debugger to delay execution at breakpoints.</p>

<hr>

<h2><a name="Known_paper_sizes"></a>Appendix: Paper sizes known to Ghostscript</h2>

<p>
The paper sizes known to Ghostscript are defined at the beginning of the
initialization file <code>gs_statd.ps</code>; see the comments there for
more details about the definitions. The table here lists them by name and
size.  <code>gs_statd.ps</code> defines their sizes exactly in points,
and the dimensions in inches (at 72 points per inch) and centimeters shown
in the table are derived from those, rounded to the nearest 0.1 unit.  A
guide to international paper sizes can be found at</p>

<blockquote>
<a href="http://www.edsebooks.com/paper/papersize.html">http://www.edsebooks.com/paper/papersize.html</a>
</blockquote>

<table>
<tr><th colspan="14">Paper sizes known to Ghostscript</th></tr>
<tr><td colspan="14" align="center">U.S. standard</td></tr>
<tr>
    <td></td>
    <td></td>
    <td colspan="3" align="center">Inches</td>
    <td></td>
    <td colspan="3" align="center">mm</td>
    <td></td>
    <td colspan="3" align="center">Points</td>
    <td></td>
    </tr>
<tr>
    <td align="left">Name</td>
    <td></td>
    <td align="center">W</td>
    <td align="center">&times;</td>
    <td align="center">H</td>
    <td></td>
    <td align="center">W</td>
    <td align="center">&times;</td>
    <td align="center">H</td>
    <td></td>
    <td align="center">W</td>
    <td align="center">&times;</td>
    <td align="center">H</td>
    <td></td>
    </tr>
<tr>
    <td>11x17</td>
    <td></td>
    <td align="right">11.0</td>
    <td></td>
    <td align="right">17.0</td>
    <td></td>
    <td align="right">279</td>
    <td></td>
    <td align="right">432</td>
    <td></td>
    <td align="right">792</td>
    <td></td>
    <td align="right">1224</td>
    <td>11&times;17in portrait</td>
    </tr>
<tr>
    <td>ledger</td>
    <td></td>
    <td align="right">17.0</td>
    <td></td>
    <td align="right">11.0</td>
    <td></td>
    <td align="right">432</td>
    <td></td>
    <td align="right">279</td>
    <td></td>
    <td align="right">1224</td>
    <td></td>
    <td align="right">792</td>
    <td>11&times;17in landscape</td>
    </tr>
<tr>
    <td>legal</td>
    <td></td>
    <td align="right">8.5</td>
    <td></td>
    <td align="right">14.0</td>
    <td></td>
    <td align="right">216</td>
    <td></td>
    <td align="right">356</td>
    <td></td>
    <td align="right">612</td>
    <td></td>
    <td align="right">1008</td>
    <td></td>
    </tr>
<tr>
    <td>letter</td>
    <td></td>
    <td align="right">8.5</td>
    <td></td>
    <td align="right">11.0</td>
    <td></td>
    <td align="right">216</td>
    <td></td>
    <td align="right">279</td>
    <td></td>
    <td align="right">612</td>
    <td></td>
    <td align="right">792</td>
    <td></td>
    </tr>
<tr>
    <td>lettersmall</td>
    <td></td>
    <td align="right">8.5</td>
    <td></td>
    <td align="right">11.0</td>
    <td></td>
    <td align="right">216</td>
    <td></td>
    <td align="right">279</td>
    <td></td>
    <td align="right">612</td>
    <td></td>
    <td align="right">792</td>
    <td></td>
    </tr>
<tr>
    <td>archE</td>
    <td></td>
    <td align="right">36.0</td>
    <td></td>
    <td align="right">48.0</td>
    <td></td>
    <td align="right">914</td>
    <td></td>
    <td align="right">1219</td>
    <td></td>
    <td align="right">2592</td>
    <td></td>
    <td align="right">3456</td>
    <td></td>
    </tr>
<tr>
    <td>archD</td>
    <td></td>
    <td align="right">24.0</td>
    <td></td>
    <td align="right">36.0</td>
    <td></td>
    <td align="right">610</td>
    <td></td>
    <td align="right">914</td>
    <td></td>
    <td align="right">1728</td>
    <td></td>
    <td align="right">2592</td>
    <td></td>
    </tr>
<tr>
    <td>archC</td>
    <td></td>
    <td align="right">18.0</td>
    <td></td>
    <td align="right">24.0</td>
    <td></td>
    <td align="right">457</td>
    <td></td>
    <td align="right">610</td>
    <td></td>
    <td align="right">1296</td>
    <td></td>
    <td align="right">1728</td>
    <td></td>
    </tr>
<tr>
    <td>archB</td>
    <td></td>
    <td align="right">12.0</td>
    <td></td>
    <td align="right">18.0</td>
    <td></td>
    <td align="right">305</td>
    <td></td>
    <td align="right">457</td>
    <td></td>
    <td align="right">864</td>
    <td></td>
    <td align="right">1296</td>
    <td></td>
    </tr>
<tr>
    <td>archA</td>
    <td></td>
    <td align="right">9.0</td>
    <td></td>
    <td align="right">12.0</td>
    <td></td>
    <td align="right">229</td>
    <td></td>
    <td align="right">305</td>
    <td></td>
    <td align="right">648</td>
    <td></td>
    <td align="right">864</td>
    <td></td>
    </tr>
<tr>    <td colspan="14"></td></tr>
<tr>    <th colspan="14">ISO standard</th></tr>
<tr>    <td colspan="14"></td></tr>
<tr>
    <td>a0</td>
    <td></td>
    <td align="right">33.1</td>
    <td></td>
    <td align="right">46.8</td>
    <td></td>
    <td align="right">841</td>
    <td></td>
    <td align="right">1189</td>
    <td></td>
    <td align="right">2384</td>
    <td></td>
    <td align="right">3370</td>
    <td></td>
    </tr>
<tr>
    <td>a1</td>
    <td></td>
    <td align="right">23.4</td>
    <td></td>
    <td align="right">33.1</td>
    <td></td>
    <td align="right">594</td>
    <td></td>
    <td align="right">841</td>
    <td></td>
    <td align="right">1684</td>
    <td></td>
    <td align="right">2384</td>
    <td></td>
    </tr>
<tr>
    <td>2</td>
    <td></td>
    <td align="right">16.5</td>
    <td></td>
    <td align="right">23.4</td>
    <td></td>
    <td align="right">420</td>
    <td></td>
    <td align="right">594</td>
    <td></td>
    <td align="right">1191</td>
    <td></td>
    <td align="right">1684</td>
    <td></td>
    </tr>
<tr>
    <td>a3</td>
    <td></td>
    <td align="right">11.7</td>
    <td></td>
    <td align="right">16.5</td>
    <td></td>
    <td align="right">297</td>
    <td></td>
    <td align="right">420</td>
    <td></td>
    <td align="right">842</td>
    <td></td>
    <td align="right">1191</td>
    <td></td>
    </tr>
<tr>
    <td>a4</td>
    <td></td>
    <td align="right">8.3</td>
    <td></td>
    <td align="right">11.7</td>
    <td></td>
    <td align="right">210</td>
    <td></td>
    <td align="right">297</td>
    <td></td>
    <td align="right">595</td>
    <td></td>
    <td align="right">842</td>
    <td></td>
    </tr>
<tr>
    <td>a4small</td>
    <td></td>
    <td align="right">8.3</td>
    <td></td>
    <td align="right">11.7</td>
    <td></td>
    <td align="right">210</td>
    <td></td>
    <td align="right">297</td>
    <td></td>
    <td align="right">595</td>
    <td></td>
    <td align="right">842</td>
    <td></td>
    </tr>
<tr>
    <td>a5</td>
    <td></td>
    <td align="right">5.8</td>
    <td></td>
    <td align="right">8.3</td>
    <td></td>
    <td align="right">148</td>
    <td></td>
    <td align="right">210</td>
    <td></td>
    <td align="right">420</td>
    <td></td>
    <td align="right">595</td>
    <td></td>
    </tr>
<tr>
    <td>a6</td>
    <td></td>
    <td align="right">4.1</td>
    <td></td>
    <td align="right">5.8</td>
    <td></td>
    <td align="right">105</td>
    <td></td>
    <td align="right">148</td>
    <td></td>
    <td align="right">297</td>
    <td></td>
    <td align="right">420</td>
    <td></td>
    </tr>
<tr>
    <td>a7</td>
    <td></td>
    <td align="right">2.9</td>
    <td></td>
    <td align="right">4.1</td>
    <td></td>
    <td align="right">74</td>
    <td></td>
    <td align="right">105</td>
    <td></td>
    <td align="right">210</td>
    <td></td>
    <td align="right">297</td>
    <td></td>
    </tr>
<tr>
    <td>a8</td>
    <td></td>
    <td align="right">2.1</td>
    <td></td>
    <td align="right">2.9</td>
    <td></td>
    <td align="right">52</td>
    <td></td>
    <td align="right">74</td>
    <td></td>
    <td align="right">148</td>
    <td></td>
    <td align="right">210</td>
    <td></td>
    </tr>
<tr>
    <td>a9</td>
    <td></td>
    <td align="right">1.5</td>
    <td></td>
    <td align="right">2.1</td>
    <td></td>
    <td align="right">37</td>
    <td></td>
    <td align="right">52</td>
    <td></td>
    <td align="right">105</td>
    <td></td>
    <td align="right">148</td>
    <td></td>
    </tr>
<tr>
    <td>a10</td>
    <td></td>
    <td align="right">1.0</td>
    <td></td>
    <td align="right">1.5</td>
    <td></td>
    <td align="right">26</td>
    <td></td>
    <td align="right">37</td>
    <td></td>
    <td align="right">73</td>
    <td></td>
    <td align="right">105</td>
    <td></td>
    </tr>
<tr>
    <td>isob0</td>
    <td>&nbsp;</td>
    <td align="right">39.4</td>
    <td>&nbsp;</td>
    <td align="right">55.7</td>
    <td>&nbsp;</td>
    <td align="right">1000</td>
    <td>&nbsp;</td>
    <td align="right">1414</td>
    <td>&nbsp;</td>
    <td align="right">2835</td>
    <td>&nbsp;</td>
    <td align="right">4008</td>
    <td></td>
    </tr>
<tr>
    <td>isob1</td>
    <td></td>
    <td align="right">27.8</td>
    <td></td>
    <td align="right">39.4</td>
    <td></td>
    <td align="right">707</td>
    <td></td>
    <td align="right">1000</td>
    <td></td>
    <td align="right">2004</td>
    <td></td>
    <td align="right">2835</td>
    <td></td>
    </tr>
<tr>
    <td>isob2</td>
    <td></td>
    <td align="right">19.7</td>
    <td></td>
    <td align="right">27.8</td>
    <td></td>
    <td align="right">500</td>
    <td></td>
    <td align="right">707</td>
    <td></td>
    <td align="right">1417</td>
    <td></td>
    <td align="right">2004</td>
    <td></td>
    </tr>
<tr>
    <td>isob3</td>
    <td></td>
    <td align="right">13.9</td>
    <td></td>
    <td align="right">19.7</td>
    <td></td>
    <td align="right">353</td>
    <td></td>
    <td align="right">500</td>
    <td></td>
    <td align="right">1001</td>
    <td></td>
    <td align="right">1417</td>
    <td></td>
    </tr>
<tr>
    <td>isob4</td>
    <td></td>
    <td align="right">9.8</td>
    <td></td>
    <td align="right">13.9</td>
    <td></td>
    <td align="right">250</td>
    <td></td>
    <td align="right">353</td>
    <td></td>
    <td align="right">709</td>
    <td></td>
    <td align="right">1001</td>
    <td></td>
    </tr>
<tr>
    <td>isob5</td>
    <td></td>
    <td align="right">6.9</td>
    <td></td>
    <td align="right">9.8</td>
    <td></td>
    <td align="right">176</td>
    <td></td>
    <td align="right">250</td>
    <td></td>
    <td align="right">499</td>
    <td></td>
    <td align="right">709</td>
    <td></td>
    </tr>
<tr>
    <td>isob6</td>
    <td></td>
    <td align="right">4.9</td>
    <td></td>
    <td align="right">6.9</td>
    <td></td>
    <td align="right">125</td>
    <td></td>
    <td align="right">176</td>
    <td></td>
    <td align="right">354</td>
    <td></td>
    <td align="right">499</td>
    <td></td>
    </tr>
<tr>
    <td>c0</td>
    <td></td>
    <td align="right">36.1</td>
    <td></td>
    <td align="right">51.1</td>
    <td></td>
    <td align="right">917</td>
    <td></td>
    <td align="right">1297</td>
    <td></td>
    <td align="right">2599</td>
    <td></td>
    <td align="right">3677</td>
    <td></td>
    </tr>
<tr>
    <td>c1</td>
    <td></td>
    <td align="right">25.5</td>
    <td></td>
    <td align="right">36.1</td>
    <td></td>
    <td align="right">648</td>
    <td></td>
    <td align="right">917</td>
    <td></td>
    <td align="right">1837</td>
    <td></td>
    <td align="right">2599</td>
    <td></td>
    </tr>
<tr>
    <td>c2</td>
    <td></td>
    <td align="right">18.0</td>
    <td></td>
    <td align="right">25.5</td>
    <td></td>
    <td align="right">458</td>
    <td></td>
    <td align="right">648</td>
    <td></td>
    <td align="right">1298</td>
    <td></td>
    <td align="right">1837</td>
    <td></td>
    </tr>
<tr>
    <td>c3</td>
    <td></td>
    <td align="right">12.8</td>
    <td></td>
    <td align="right">18.0</td>
    <td></td>
    <td align="right">324</td>
    <td></td>
    <td align="right">458</td>
    <td></td>
    <td align="right">918</td>
    <td></td>
    <td align="right">1298</td>
    <td></td>
    </tr>
<tr>
    <td>c4</td>
    <td>&nbsp;</td>
    <td align="right">9.0</td>
    <td>&nbsp;</td>
    <td align="right">12.8</td>
    <td>&nbsp;</td>
    <td align="right">229</td>
    <td>&nbsp;</td>
    <td align="right">324</td>
    <td>&nbsp;</td>
    <td align="right">649</td>
    <td>&nbsp;</td>
    <td align="right">918</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
</tr>
<tr>
    <td>c5</td>
    <td></td>
    <td align="right">6.4</td>
    <td></td>
    <td align="right">9.0</td>
    <td></td>
    <td align="right">162</td>
    <td></td>
    <td align="right">229</td>
    <td></td>
    <td align="right">459</td>
    <td></td>
    <td align="right">649</td>
    <td></td>
</tr>
<tr>
    <td>c6</td>
    <td></td>
    <td align="right">4.5</td>
    <td></td>
    <td align="right">6.4</td>
    <td></td>
    <td align="right">114</td>
    <td></td>
    <td align="right">162</td>
    <td></td>
    <td align="right">323</td>
    <td></td>
    <td align="right">459</td>
    <td></td>
</tr>
<tr>
    <td colspan="14"></td>
</tr>
<tr>
    <th colspan="14">JIS standard</th>
</tr>
<tr>
    <td colspan="14"></td>
    </tr>
<tr>
    <td>jisb0</td>
    <td></td>
    <td align="right"></td>
    <td></td>
    <td align="right"></td>
    <td></td>
    <td align="right">1030</td>
    <td></td>
    <td align="right">1456</td>
    <td></td>
    <td align="right"></td>
    <td></td>
    <td align="right"></td>
    <td></td>
    </tr>
<tr>
    <td>jisb1</td>
    <td></td>
    <td align="right"></td>
    <td></td>
    <td align="right"></td>
    <td></td>
    <td align="right">728</td>
    <td></td>
    <td align="right">1030</td>
    <td></td>
    <td align="right"></td>
    <td></td>
    <td align="right"></td>
    <td></td>
    </tr>
<tr>
    <td>jisb2</td>
    <td></td>
    <td align="right"></td>
    <td></td>
    <td align="right"></td>
    <td></td>
    <td align="right">515</td>
    <td></td>
    <td align="right">728</td>
    <td></td>
    <td align="right"></td>
    <td></td>
    <td align="right"></td>
    <td></td>
    </tr>
<tr>
    <td>jisb</td>
    <td></td>
    <td align="right"></td>
    <td></td>
    <td align="right"></td>
    <td></td>
    <td align="right">364</td>
    <td></td>
    <td align="right">515</td>
    <td></td>
    <td align="right"></td>
    <td></td>
    <td align="right"></td>
    <td></td>
    </tr>
<tr>
    <td>jisb4</td>
    <td></td>
    <td align="right"></td>
    <td></td>
    <td align="right"></td>
    <td></td>
    <td align="right">257</td>
    <td></td>
    <td align="right">364</td>
    <td></td>
    <td align="right"></td>
    <td></td>
    <td align="right"></td>
    <td></td>
    </tr>
<tr>
    <td>jisb5</td>
    <td></td>
    <td align="right"></td>
    <td></td>
    <td align="right"></td>
    <td></td>
    <td align="right">182</td>
    <td></td>
    <td align="right">257</td>
    <td></td>
    <td align="right"></td>
    <td></td>
    <td align="right"></td>
    <td></td>
    </tr>
<tr>
    <td>jisb6</td>
    <td></td>
    <td align="right"></td>
    <td></td>
    <td align="right"></td>
    <td></td>
    <td align="right">128</td>
    <td></td>
    <td align="right">182</td>
    <td></td>
    <td align="right"></td>
    <td></td>
    <td align="right"></td>
    <td></td>
    </tr>
<tr>
    <td colspan="14"></td>
    </tr>
<tr>
    <th colspan="14">ISO/JIS switchable</th>
    </tr>
<tr>
    <td colspan="14"></td>
    </tr>
<tr>    <td colspan="14">b0 (see * below)</td></tr>
<tr>    <td colspan="14">b1 (see * below)</td></tr>
<tr>    <td colspan="14">b2 (see * below)</td></tr>
<tr>    <td colspan="14">b3 (see * below)</td></tr>
<tr>    <td colspan="14">b4 (see * below)</td></tr>
<tr>    <td colspan="14">b5 (see * below)</td></tr>

<tr>    <td colspan="14" ></td></tr>
<tr>    <th colspan="14">Other</th></tr>
<tr>    <td colspan="14"></td></tr>
<tr>
    <td>flsa</td>
    <td></td>
    <td align="right">8.5</td>
    <td></td>
    <td align="right">13.0</td>
    <td></td>
    <td align="right">216</td>
    <td></td>
    <td align="right">330</td>
    <td></td>
    <td align="right">612</td>
    <td></td>
    <td align="right">936</td>
    <td>U.S. foolscap</td>
    </tr>
<tr>
    <td>flse</td>
    <td></td>
    <td align="right">8.5</td>
    <td></td>
    <td align="right">13.0</td>
    <td></td>
    <td align="right">216</td>
    <td></td>
    <td align="right">330</td>
    <td></td>
    <td align="right">612</td>
    <td></td>
    <td align="right">936</td>
    <td>European foolscap</td>
    </tr>
<tr>
    <td>halfletter</td>
    <td></td>
    <td align="right">5.5</td>
    <td></td>
    <td align="right">8.5</td>
    <td></td>
    <td align="right">140</td>
    <td></td>
    <td align="right">216</td>
    <td></td>
    <td align="right">396</td>
    <td></td>
    <td align="right">612</td>
    <td></td>
    </tr>
<tr>
    <td>hagaki</td>
    <td></td>
    <td align="right">3.9</td>
    <td></td>
    <td align="right">5.8</td>
    <td></td>
    <td align="right">100</td>
    <td></td>
    <td align="right">148</td>
    <td></td>
    <td align="right">283</td>
    <td></td>
    <td align="right">420</td>
    <td>Japanese postcard</td>
    </tr>
</table>

<p>
*<em>Note:</em> Initially the B paper sizes are the ISO sizes, e.g.,
<code>b0</code> is the same as <code>isob0</code>.  Running the file
<code>lib/jispaper.ps</code> makes the B paper sizes be the JIS sizes,
e.g., <code>b0</code> becomes the same as <code>jisb0</code>.</p>

<hr>

<h2><a name="X_font_mappings"></a>Appendix: X default font mappings</h2>

<h3><a name="Standard_X_server_fonts"></a>Standard X servers</h3>

<h4><a name="X_regular_fonts"></a>Regular fonts</h4>

<pre>
    AvantGarde-Book:              -Adobe-ITC Avant Garde Gothic-Book-R-Normal--\n\
    AvantGarde-BookOblique:       -Adobe-ITC Avant Garde Gothic-Book-O-Normal--\n\
    AvantGarde-Demi:              -Adobe-ITC Avant Garde Gothic-Demi-R-Normal--\n\
    AvantGarde-DemiOblique:       -Adobe-ITC Avant Garde Gothic-Demi-O-Normal--\n\
    Bookman-Demi:                 -Adobe-ITC Bookman-Demi-R-Normal--\n\
    Bookman-DemiItalic:           -Adobe-ITC Bookman-Demi-I-Normal--\n\
    Bookman-Light:                -Adobe-ITC Bookman-Light-R-Normal--\n\
    Bookman-LightItalic:          -Adobe-ITC Bookman-Light-I-Normal--\n\
    Courier:                      -Adobe-Courier-Medium-R-Normal--\n\
    Courier-Bold:                 -Adobe-Courier-Bold-R-Normal--\n\
    Courier-BoldOblique:          -Adobe-Courier-Bold-O-Normal--\n\
    Courier-Oblique:              -Adobe-Courier-Medium-O-Normal--\n\
    Helvetica:                    -Adobe-Helvetica-Medium-R-Normal--\n\
    Helvetica-Bold:               -Adobe-Helvetica-Bold-R-Normal--\n\
    Helvetica-BoldOblique:        -Adobe-Helvetica-Bold-O-Normal--\n\
    Helvetica-Narrow:             -Adobe-Helvetica-Medium-R-Narrow--\n\
    Helvetica-Narrow-Bold:        -Adobe-Helvetica-Bold-R-Narrow--\n\
    Helvetica-Narrow-BoldOblique: -Adobe-Helvetica-Bold-O-Narrow--\n\
    Helvetica-Narrow-Oblique:     -Adobe-Helvetica-Medium-O-Narrow--\n\
    Helvetica-Oblique:            -Adobe-Helvetica-Medium-O-Normal--\n\
    NewCenturySchlbk-Bold:        -Adobe-New Century Schoolbook-Bold-R-Normal--\n\
    NewCenturySchlbk-BoldItalic:  -Adobe-New Century Schoolbook-Bold-I-Normal--\n\
    NewCenturySchlbk-Italic:      -Adobe-New Century Schoolbook-Medium-I-Normal--\n\
    NewCenturySchlbk-Roman:       -Adobe-New Century Schoolbook-Medium-R-Normal--\n\
    Palatino-Bold:                -Adobe-Palatino-Bold-R-Normal--\n\
    Palatino-BoldItalic:          -Adobe-Palatino-Bold-I-Normal--\n\
    Palatino-Italic:              -Adobe-Palatino-Medium-I-Normal--\n\
    Palatino-Roman:               -Adobe-Palatino-Medium-R-Normal--\n\
    Times-Bold:                   -Adobe-Times-Bold-R-Normal--\n\
    Times-BoldItalic:             -Adobe-Times-Bold-I-Normal--\n\
    Times-Italic:                 -Adobe-Times-Medium-I-Normal--\n\
    Times-Roman:                  -Adobe-Times-Medium-R-Normal--\n\
    ZapfChancery-MediumItalic:    -Adobe-ITC Zapf Chancery-Medium-I-Normal--
</pre>

<h4><a name="X_symbol_fonts"></a>Symbol fonts</h4>

<pre>    Symbol:                       -Adobe-Symbol-Medium-R-Normal--
</pre>

<h4><a name="X_dingbat_fonts"></a>Dingbat fonts</h4>

<pre>    ZapfDingbats:                 -Adobe-ITC Zapf Dingbats-Medium-R-Normal--
</pre>

<h3><a name="OpenWindows_fonts"></a>Sun OpenWindows</h3>

<p>
For Sun's X11/NeWS one can use the OpenWindows scalable fonts instead,
which gives good output for any point size.  In this environment, the
relevant section of the resource file should look like this:</p>

<pre>Ghostscript.regularFonts: \
    AvantGarde-Book:              -itc-avantgarde-book-r-normal-- \n\
    AvantGarde-BookOblique:       -itc-avantgarde-book-o-normal-- \n\
    AvantGarde-Demi:              -itc-avantgarde-demi-r-normal-- \n\
    AvantGarde-DemiOblique:       -itc-avantgarde-demi-o-normal-- \n\
    Bembo:                        -monotype-bembo-medium-r-normal-- \n\
    Bembo-Bold:                   -monotype-bembo-bold-r-normal-- \n\
    Bembo-BoldItalic:             -monotype-bembo-bold-i-normal-- \n\
    Bembo-Italic:                 -monotype-bembo-medium-i-normal-- \n\
    Bookman-Demi:                 -itc-bookman-demi-r-normal-- \n\
    Bookman-DemiItalic:           -itc-bookman-demi-i-normal-- \n\
    Bookman-Light:                -itc-bookman-light-r-normal-- \n\
    Bookman-LightItalic:          -itc-bookman-light-i-normal-- \n\
    Courier:                      -itc-courier-medium-r-normal-- \n\
    Courier-Bold:                 -itc-courier-bold-r-normal-- \n\
    Courier-BoldOblique:          -itc-courier-bold-o-normal-- \n\
    Courier-Oblique:              -itc-courier-medium-o-normal-- \n\
    GillSans:                     -monotype-gill-medium-r-normal-sans- \n\
    GillSans-Bold:                -monotype-gill-bold-r-normal-sans- \n\
    GillSans-BoldItalic:          -monotype-gill-bold-i-normal-sans- \n\
    GillSans-Italic:              -monotype-gill-normal-i-normal-sans- \n\
    Helvetica:                    -linotype-helvetica-medium-r-normal-- \n\
    Helvetica-Bold:               -linotype-helvetica-bold-r-normal-- \n\
    Helvetica-BoldOblique:        -linotype-helvetica-bold-o-normal-- \n\
    Helvetica-Narrow:             -linotype-helvetica-medium-r-narrow-- \n\
    Helvetica-Narrow-Bold:        -linotype-helvetica-bold-r-narrow-- \n\
    Helvetica-Narrow-BoldOblique: -linotype-helvetica-bold-o-narrow-- \n\
    Helvetica-Narrow-Oblique:     -linotype-helvetica-medium-o-narrow-- \n\
    Helvetica-Oblique:            -linotype-helvetica-medium-o-normal-- \n\
    LucidaBright:                 -b&amp;h-lucidabright-medium-r-normal-- \n\
    LucidaBright-Demi:            -b&amp;h-lucidabright-demibold-r-normal-- \n\
    LucidaBright-DemiItalic:      -b&amp;h-lucidabright-demibold-i-normal-- \n\
    LucidaBright-Italic:          -b&amp;h-lucidabright-medium-i-normal-- \n\
    LucidaSans:                   -b&amp;h-lucida-medium-r-normal-sans- \n\
    LucidaSans-Bold:              -b&amp;h-lucida-bold-r-normal-sans- \n\
    LucidaSans-BoldItalic:        -b&amp;h-lucida-bold-i-normal-sans- \n\
    LucidaSans-Italic:            -b&amp;h-lucida-medium-i-normal-sans- \n\
    LucidaSans-Typewriter:        -b&amp;h-lucidatypewriter-medium-r-normal-sans- \n\
    LucidaSans-TypewriterBold:    -b&amp;h-lucidatypewriter-bold-r-normal-sans- \n\
    NewCenturySchlbk-BoldItalic:  -linotype-new century schoolbook-bold-i-normal-- \n\
    NewCenturySchlbk-Bold:        -linotype-new century schoolbook-bold-r-normal-- \n\
    NewCenturySchlbk-Italic:      -linotype-new century schoolbook-medium-i-normal-- \n\
    NewCenturySchlbk-Roman:       -linotype-new century schoolbook-medium-r-normal-- \n\
    Palatino-Bold:                -linotype-palatino-bold-r-normal-- \n\
    Palatino-BoldItalic:          -linotype-palatino-bold-i-normal-- \n\
    Palatino-Italic:              -linotype-palatino-medium-i-normal-- \n\
    Palatino-Roman:               -linotype-palatino-medium-r-normal-- \n\
    Rockwell:                     -monotype-rockwell-medium-r-normal-- \n\
    Rockwell-Bold:                -monotype-rockwell-bold-r-normal-- \n\
    Rockwell-BoldItalic:          -monotype-rockwell-bold-i-normal-- \n\
    Rockwell-Italic:              -monotype-rockwell-medium-i-normal-- \n\
    Times-Bold:                   -linotype-times-bold-r-normal-- \n\
    Times-BoldItalic:             -linotype-times-bold-i-normal-- \n\
    Times-Italic:                 -linotype-times-medium-i-normal-- \n\
    Times-Roman:                  -linotype-times-medium-r-normal-- \n\
    Utopia-Bold:                  -adobe-utopia-bold-r-normal-- \n\
    Utopia-BoldItalic:            -adobe-utopia-bold-i-normal-- \n\
    Utopia-Italic:                -adobe-utopia-regular-i-normal-- \n\
    Utopia-Regular:               -adobe-utopia-regular-r-normal-- \n\
    ZapfChancery-MediumItalic:    -itc-zapfchancery-medium-i-normal-- \n
Ghostscript.dingbatFonts: \
    ZapfDingbats:                 -itc-zapfdingbats-medium-r-normal--
Ghostscript.symbolFonts: \
    Symbol:                       --symbol-medium-r-normal--
</pre>

<hr>
<h2><a name="FAPI_run"></a>Running Ghostscript with third-party font renderers</h2>

<p>
Font API (FAPI) is a feature which allows to attach third-party font
renderers to Ghostscript.
This section explains how to run Ghostscript with third-party font
renderers, such as UFST. NOTE: FreeType is now the default font renderer
for Ghostscript.</p>

<p>
<em>Note: To run Ghostscript with UFST you need a license from Monotype Imaging.
Please ignore issues about UFST if you haven't got it.
</em></p>

<p>
<em>
Important note: Third-party font renderers may be incompatible
with devices that can embed fonts in their output (such as pdfwrite),
because such renderers may store fonts in a form from which Ghostscript cannot
get the necessary information for embedding, for example, the Microtype fonts supplied
with the UFST.  Ghostscript can be configured to disable such renderers when such a
device is being used.
</em></p>

<p>
As of Ghostscript version 9.0, Ghostscript uses Freetype 2.4.x as the default font
scaler/renderer.</p>

<p>With this change, we added a new switch:<code>-dDisableFAPI=true</code> to revert to the older
behavior, just in case serious regression happens that cannot be resolved in a timely manner.
It is intended that this switch will be removed once the FAPI/Freetype implementation has
proven itself robust and reliable in the "real world".</p>

<p>
<em>
NOTE: With version 9.18 recently released we have, for some time, regarded FAPI/Freetype as being
the canonical glyph rendering solution for Ghostscript and associated products, and the non-FAPI
rendering to be deprecated. As such, the <code>-dDisableFAPI=true</code> option is also considered
deprecated, and should be expected to be removed shortly after the next release.
</em>
</p>

<p>
To run Ghostscript with UFST, you first need to build Ghostscript
with the UFST bridge. Refer <a href="Make.htm#UFST_build">How to build Ghostscript with UFST</a>.
Both bridges may run together.</p>

<p>
There are 2 ways to handle fonts with a third-party font renderer (FAPI).
First, you can substitute
any FAPI-handled font to a resident PostScript font, using special map files
<code>FAPIfontmap</code> and <code>FAPIcidfmap</code>.
Second, you can redirect PostScript fonts to FAPI, setting
entries in <code>FAPIconfig</code> file.</p>

<p>
Names <code>FAPIfontmap</code>, <code>FAPIcidfmap</code>, <code>FAPIconfig</code>
in this text actually are placeholders, which may be substituted with command line arguments :
<code>-sFAPIfontmap=<em>name1</em></code> <code>-sFAPIcidfmap=<em>name2</em></code>
<code>-sFAPIconfig=<em>name3</em></code>.
Ghostscript searches the specified file names as explained in
<a href="#Finding_files">How Ghostscript finds files</a>.
Default values for these arguments are equal to argument names.
When building Ghostscript with <code>COMPILE_INITS=1</code>, only default values are used.</p>

<p>
Font files, which are being handled with FAPI, may reside in any directory in your hard disk.
Paths to them to be specified in <code>FAPIfontmap</code> and
with special command line arguments, explained below.
The path may be either absolute or relative. Relative ones are being resolved from the path,
which is specified in <code>FAPIconfig</code> file.</p>
<p>
The file <code>FAPIfontmap</code> is actually special PostScript code.
It may include records of 2 types : general records
and FCO records (see below).</p>

<p>
A general record describes a font, which is being rendered with FAPI.
They must end with semicolon. Each general record is a pair.
The first element of the pair is the font name (the name that PostScript
documents use to access the font, which may differ
from real name of the font which the font file defines).
The second element is a dictionary with entries :</p>

<table>
    <tr><th>Key</th>
    <th>Type</th>
    <th>Description</th></tr>
<tr>    <td>Path</td>
        <td>string</td>
        <td>Absolute path to font file, or relative path to font file from the FontPath value,
            being specified in <code>FAPIconfig</code>.</td></tr>
<tr>    <td>FontType</td>
        <td>integer</td>
        <td>PostScript type for this font. Only 1 and 42 are currently allowed.
            Note that this is unrelated to the real type of the font file -
            the bridge will perform a format conversion.</td></tr>
<tr>    <td>FAPI</td>
        <td>name</td>
        <td>Name of the renderer to be used with the font.
            Only <code>/UFST</code> and <code>/FreeType</code> are now allowed.</td></tr>
<tr>    <td>SubfontId</td>
        <td>integer</td>
        <td>(optional) Index of the font in font collection, such as FCO or TTC.
            It is being ignored if Path doesn't specify a collection.
            Note that Free Type can't handle FCO.
            Default value is 0.</td></tr>
<tr>    <td>Decoding</td>
        <td>name</td>
        <td>(optional) The name of a Decoding resource to be used with the font.
            If specified, <code>lib/xlatmap</code> (see below) doesn't work for this font.</td></tr>
</table>

<p>
Example of a general FAPI font map record :</p>
<blockquote>
<code>
/FCO1        &lt;&lt; /Path (/AFPL/UFST/fontdata/MTFONTS/PCLPS3/MT1/PCLP3__F.fco) /FontType 1 /FAPI /UFST &gt;&gt; ;
</code>
</blockquote>

<p>
FCO records work for UFST only.
A group of FCO records start with a line <code><em>name</em> ReadFCOfontmap:</code>,
where <code><em>name</em></code> is a name of a command line argument,
which specify a path to an FCO file. The group of FCO records
must end with the line <code>EndFCOfontmap</code>.
Each record of a group occupy a single line,
and contains a number and 1, 2 or 3 names.
The number is the font index in the FCO file, the first name
is the Postscript font name, the secong is an Encoding resource name,
and the third is a decoding resource name.</p>

<p>
Note that <code>FAPIfontmap</code> specifies only instances of
Font category. CID fonts to be listed in another map file.</p>

<p>
Ghostscript distribution includes sample map files
<code>gs/lib/FAPIfontmap</code>,
<code>gs/lib/FCOfontmap-PCLPS2</code>,
<code>gs/lib/FCOfontmap-PCLPS3</code>,
<code>gs/lib/FCOfontmap-PS3</code>,
which may be customized by the user.
The last 3 ones include an information about UFST FCO files.</p>

<p>
The file <code>FAPIcidfmap</code> defines a mapping table for
CIDFont resources. It contains records for each CID font being rendered with FAPI.
The format is similar to <code>FAPIfontmap</code>,
    but dictionaries must contain few different entries :</p>

<table>
    <tr><th>Key</th>
    <th>Type</th>
    <th>Description</th></tr>
<tr>    <td>Path</td>
        <td>string</td>
        <td>Absolute path to font file, or relative path to font file from the CIDFontPath value,
            being specified in <code>FAPIconfig</code>.</td></tr>
<tr>    <td>CIDFontType</td>
        <td>integer</td>
        <td>PostScript type for this CID font. Only 0, 1 and 2 are currently allowed.
            Note that this is unrelated to the real type of the font file -
            the bridge will perform format conversion.</td></tr>
<tr>    <td>FAPI</td>
        <td>name</td>
        <td>Name of the renderer to be used with the font.
            Only <code>/UFST</code> and <code>/FreeType</code> are now allowed.</td></tr>
<tr>    <td>SubfontId</td>
        <td>integer</td>
        <td>(optional) Index of the font in font collection, such as FCO or TTC.
            It is being ignored if Path doesn't specify a collection.
            Default value is 0.</td></tr>
<tr>    <td>CSI</td>
        <td>array of 2 elements</td>
        <td>(required) Information for building <code>CIDSystemInfo</code>.
            The first element is a string, which specifies <code>Ordering</code>.
            The second element is a number, which specifies <code>Supplement</code>.</td></tr>
</table>

<p>
    Example of FAPI CID font map record :</p>
<blockquote>
<code>
/HeiseiKakuGo-W5  &lt;&lt; /Path (/WIN2000/Fonts/PMINGLIU.TTF) /CIDFontType 0 /FAPI /UFST /CSI [(Japan1) 2] &gt;&gt; ;
</code>
</blockquote>


<p>
The control file <code>FAPIconfig</code> defines 4 entries :</p>

<table>
    <tr><th>Key</th>
    <th>Type</th>
    <th>Description</th></tr>
<tr>    <td>FontPath</td>
        <td>string</td>
        <td>Absolute path to a directory, which contains fonts. Used to resolve
            relative paths in <code>FAPIfontmap</code>.</td></tr>
<tr>    <td>CIDFontPath</td>
        <td>string</td>
        <td>Absolute path to a directory, which contains fonts to substitute to CID fonts.
            Used to resolve relative paths in <code>FAPIcidfmap</code>.
            It may be same or different than FontPath.</td></tr>
<tr>    <td>HookDiskFonts</td>
        <td>array of integers.</td>
        <td>List of PS font types to be handled with FAPI.
            This controls other fonts that ones listed in <code>FAPIfontmap</code>
            and <code>FAPIcidfmap</code> - such ones are PS fonts installed to
            Ghostscript with <code>lib/fontmap</code> or with <code>GS_FONTPATH</code>,
            or regular CID font resources. Unlisted font types will be
            rendered with the native Ghostscript font renderer.
            Only allowed values now are 1,9,11,42. Note that 9 and 11
            correspond to CIDFontType 0 and 2.</td></tr>
<tr>    <td>HookEmbeddedFonts</td>
        <td>array of integers.</td>
        <td>List of PS font types to be handled with FAPI.
            This controls fonts being embedded into a document -
            either fonts or CID font resources. Unlisted font types will be
            rendered with the native Ghostscript font renderer.
            Only allowed values now are 1,9,11,42. Note that 9 and 11
            correspond to CIDFontType 0 and 2.</td></tr>

</table>

<p>
Ghostscript distribution includes sample config files
<code>gs/lib/FAPIconfig</code>,
<code>gs/lib/FAPIconfig-FCO</code>.
which may be customized by the user.
The last ones defines the configuration
for handling resident UFST fonts only.</p>

<p>
In special cases you may need to customize the file <code>lib/xlatmap</code>. Follow instructions in it.</p>

<p>
Some UFST font collections need a path for finding an UFST plugin.
If you run UFST with such font collection,
you should run Ghostscript with a special command line argument
<code>-sUFST_PlugIn=<em>path</em></code>, where <code><em>path</em></code> specifies
a disk path to the UFST plugin file, which Monotype Imaging distributes
in <em><code>ufst/fontdata/MTFONTS/PCL45/MT3/plug__xi.fco</code></em>.
If UFST needs it and the
command line argument is not specified, Ghostscript prints a warning and searches
plugin file in the current directory.</p>

<p>
If you want to run UFST with resident UFST fonts only
(and allow Ghostscript font renderer to handle fons, which may be downloaded or embedded into documents),
you should run Ghostscript with these command line arguments :
<code>-sFCOfontfile=<em>path1</em></code> <code>-sFCOfontfile2=<em>path2</em></code>
<code>-sUFST_PlugIn=<em>path3</em></code>
<code>-sFAPIfontmap=<em>map-name</em></code> <code>-sFAPIconfig=FAPIconfig-FCO</code>
where <code><em>path1</em></code> specifies
a disk path to the main FCO file, <code><em>path2</em></code> specifies
a disk path to the Wingdings FCO file, <code><em>path3</em></code>
a disk path the FCO plugin file, <code><em>path1</em></code> is either
<code>gs/lib/FCOfontmap-PCLPS2</code>,
<code>gs/lib/FCOfontmap-PCLPS3</code>, or
<code>gs/lib/FCOfontmap-PS3</code>.
<code>FAPIcidfmap</code> works as usual, but probably you want to leave it empty
because FCO doesn't emulate CID fonts.</p>

<p>
Some configurations of UFST need a path for finding symbol set files.
If you compiled UFST with such configuration,
you should run Ghostscript with a special command line argument
<code>-sUFST_SSdir=<em>path</em></code>, where <code><em>path</em></code> specifies
a disk path to the UFST support directory, which Monotype Imagong distributes
in <em><code>ufst/fontdata/SUPPORT</code></em>. If UFST needs it and the
command line argument is not specified, Ghostscript prints a warning and searches
symbol set files in the current directory.</p>


<p>
Note that UFST and Free Type cannot handle some Ghostscript fonts because
they do not include a PostScript interpreter and therefore have stronger restrictions on
font formats than Ghostscript itself does - in particular, Type 3 fonts.
If their font types are listed in <code>HookDiskFonts</code> or in
<code>HookEmbeddedFonts</code>, Ghostscript interprets them as PS files,
then serializes font data into a RAM buffer and passes it to FAPI as
PCLEOs. (see the FAPI-related source code for details).</p>

<!-- [2.0 end contents] ==================================================== -->

<!-- [3.0 begin visible trailer] =========================================== -->
<hr>

<p>
<small>Copyright &copy; 2000-2022 Artifex Software, Inc.  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 that
license.  Refer to licensing information at <a href="https://www.artifex.com">https://www.artifex.com</a>
or contact Artifex Software, Inc.,  1305 Grant Avenue - Suite 200,
Novato, CA 94945, U.S.A., +1(415)492-9861, for further information.

<p>
<small>Ghostscript version 9.56.0, 29 March 2022

<!-- [3.0 end visible trailer] ============================================= -->

<!--FINISH EDITING HERE-->
          </div><!-- close inner -->
        </div><!-- close outer -->
      </article>
    </main>
    <script src="site.js"></script>
</body>
</html>