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
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>How to use Ghostscript</title>
<!-- $Id: Use.htm,v 1.71.2.1 2004/01/30 06:57:37 giles Exp $ -->
<!-- Originally: use.txt -->
<link rel="stylesheet" type="text/css" href="gs.css" title="Ghostscript Style">
</head>
<body>
<!-- [1.0 begin visible header] ============================================ -->
<!-- [1.1 begin headline] ================================================== -->
<h1>How to use Ghostscript</h1>
<!-- [1.1 end headline] ==================================================== -->
<!-- [1.2 begin table of contents] ========================================= -->
<h2>Table of contents</h2>
<blockquote><ul>
<li><a href="#Invoking">Invoking Ghostscript</a>
<ul>
<li><a href="#Help_command">Help at the command line: <b><tt>gs -h</tt></b></a>
</ul>
<li><a href="#Output_device">Selecting an output device</a>
<ul>
<li><a href="#Output_resolution">Output resolution</a>
<li><a href="#File_output">Output to files</a>
<ul>
<li><a href="#One_page_per_file">One page per file</a>
</ul>
<li><a href="#Paper_size">Choosing paper size</a>
<li><a href="#Change_default_size">Changing the installed default paper size</a>
</ul>
<li><a href="#Pipes">Interacting with pipes</a>
<li><a href="#PDF">Using Ghostscript with PDF files</a>
<ul>
<li><a href="#PDF_switches">Switches for PDF files</a>
<li><a href="#PDF_problems">Problems interpreting a PDF file</a>
<li><a href="#PDF_stdin">PDF files from standard input</a>
</ul>
<li><a href="#EPS">Using Ghostscript with EPS files</a>
<li><a href="#Finding_files">How Ghostscript finds files</a>
<ul>
<li><a href="#PS_resources">Finding PostScript Level 2 resources</a>
<li><a href="#Font_lookup">Font lookup</a>
<li><a href="#Temp_files">Temporary files</a>
</ul>
<li><a href="#CIDFontSubstitution">CID font substitution</a>
<li><a href="#Platforms">Notes on specific platforms</a>
<ul>
<li><a href="#Unix">Unix</a>
<li><a href="#VMS">VMS</a>
<ul>
<li><a href="#VMS_X_Windows">Using X Windows on VMS</a>
</ul>
<li><a href="#MS_Windows">MS Windows</a>
<li><a href="#X_Windows">X Windows</a>
<ul>
<li><a href="#X_resources">X resources</a>
<li><a href="#X_server_bugs">Working around bugs in X servers</a>
<li><a href="#X_fonts">X fonts</a>
<li><a href="#GS_fonts_as_X_fonts">Using Ghostscript fonts on X displays</a>
<li><a href="#X_device_parameters">X device parameters</a>
</ul>
<li><a href="#SCO_Unix">SCO Unix</a>
</ul>
<li><a href="#Options">Command line options</a>
<ul>
<li><a href="#General_switches">General switches</a>
<ul>
<li><a href="#Input_control">Input control</a>
<li><a href="#File_searching">File searching</a>
<li><a href="#Parameters">Setting parameters</a>
<li><a href="#Quiet">Suppress messages</a>
</ul>
<li><a href="#Parameter_switches">Parameter switches (<b><tt>-d</tt></b> and <b><tt>-s</tt></b>)</a>
<ul>
<li><a href="#Rendering_parameters">Rendering parameters</a>
<li><a href="#Page_parameters">Page parameters</a>
<li><a href="#Font_related_parameters">Font-related parameters</a>
<li><a href="#Interaction_related_parameters">Interaction-related parameters</a>
<li><a href="#Output_selection_parameters">Device and output selection parameters</a>
<li><a href="#EPS_parameters">EPS parameters</a>
<li><a href="#Other_parameters">Other parameters</a>
</ul>
</ul>
<li><a href="#Improving_performance">Improving performance</a>
<li><a href="#Environment_variables">Summary of environment variables</a>
<li><a href="#Debugging">Debugging</a>
<ul>
<li><a href="#Debug_switches">Debug Switches</a>
<li><a href="#Visual_trace">Visual Trace</a>
</ul>
<li><a href="#Known_paper_sizes">Appendix: Paper sizes known to Ghostscript</a>
<li><a href="#X_font_mappings">Appendix: X default font mappings</a>
<ul>
<li><a href="#Standard_X_server_fonts">Standard X servers</a>
<ul>
<li><a href="#X_regular_fonts">Regular fonts</a>
<li><a href="#X_symbol_fonts">Symbol fonts</a>
<li><a href="#X_dingbat_fonts">Dingbat fonts</a>
</ul>
<li><a href="#OpenWindows_fonts">Sun OpenWindows</a>
</ul>
<li><a href="#UFST_run">Appendix: Running Ghostscript with UFST</a>
</ul></blockquote>
<!-- [1.2 end table of contents] =========================================== -->
<!-- [1.3 begin hint] ====================================================== -->
<p>For other information, see the <a href="Readme.htm">Ghostscript
overview</a>, the new user's documentation on
<a href="New-user.htm#Previewers">previewers</a> and, if necessary, how to
<a href="Install.htm">install Ghostscript</a>.
<!-- [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 <a href="New-user.htm#Previewers">viewing files</a> for example).
Please refer to the documentation for those applications for using Ghostscript in other contexts.
<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:
<blockquote>
<b><tt>gs</tt></b> [options] {filename 1} ... [options] {filename <em>N</em>} ...
</blockquote>
<p>Here are some basic examples. The details of how these work are described below.
<p>To view a file:
<blockquote><pre>gs -dSAFER -dBATCH document.pdf</pre></blockquote>
You'll be prompted to press <em>return</em> between pages.
<p>To convert a figure to an image file:
<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:
<blockquote><pre>gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=png16m -r300 \
-sOutputFile=tiger_300.png tiger.eps</pre></blockquote>
<p>to render a figure in grayscale:
<blockquote><pre>gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pnggrey -sOutputFile=figure.png figure.pdf</pre></blockquote>
<p>to rasterize a whole document:
<blockquote><pre>gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pgmraw -r150 \
-dTextAlphaBits=4 -sOutputFile='paper-%00d.pgm' paper.ps</blockquote></pre>
<p>There are also a number of utility scripts for common
to convert a PostScript document to PDF:
<blockquote><pre>ps2pdf file.ps</pre></blockquote>
The output is saved as file.pdf.
<p>There are other utility scripts besides <tt>ps2pdf</tt>, including <tt>pdf2ps</tt>, <tt>ps2epsi</tt>, <tt>pdf2dsc</tt>, <tt>ps2ascii</tt>
and <tt>ps2ps</tt>. These just call Ghostscript with the appropriate
(if complicated) set of options. You can use the 'ps2' set with eps files.
<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>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 "<b><tt>quit</tt></b>". The <tt>-dBATCH -dNOPAUSE</tt> options in the examples above disable the interactive prompting. The interpreter also quits gracefully if it encounters end-of-file or control-C.
<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 "<b><tt>=</tt></b>"
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.
<h3><a name="Help_command"></a>Help at the command line: <b><tt>gs -h</tt></b></h3>
<p>
You can get a brief help message by invoking Ghostscript with the
<b><tt>-h</tt></b> or <b><tt>-?</tt></b> switch, like this:
<blockquote><pre>
gs -h
gs -?
</pre></blockquote>
<p>
The message shows for that version of the Ghostscript executable:
<ul>
<li>the version and release information
<li>the general format of the command line
<li>a few of the most useful options
<li>the formats it can interpret
<li>the available output devices
<li>the search path
<li>the bug report address
</ul>
<p>
On other systems the executable may have a different name:
<blockquote><table cellpadding=0 cellspacing=0>
<tr bgcolor="#CCCC00">
<th align=left>System
<th>
<th align=left>invocation name
<tr> <td>Unix
<td> <td><b><tt>gs</tt></b>
<tr> <td>VMS
<td> <td><b><tt>gs</tt></b>
<tr> <td>MS Windows 95 and later
<td> <td><b><tt>gswin32c</tt></b>
<tr> <td>MS Windows 3.1/Win32s
<td> <td><b><tt>gswin32</tt></b>
<tr> <td>OS/2
<td> <td><b><tt>gsos2</tt></b>
</table></blockquote>
<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>
The command line option '<tt>-sDEVICE=</tt><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 (<tt>gs -h</tt>) 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><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
'<tt>gs myfile.ps</tt>' you might use
<blockquote>
<b><tt>gs -sDEVICE=epson myfile.ps</tt></b>
</blockquote>
<p><a name="GS_DEVICE"></a>
The output device can also be set through the <tt>GS_DEVICE</tt> environment variable.
<p>
Once you invoke Ghostscript
you can also find out what devices are available by typing
'<tt>devicenames ==</tt>' at the iteractive prompt.
You can set the output device and process a file from the interactive prompt as well:
<blockquote><pre>
(epson) selectdevice
(myfile.ps) run
</pre></blockquote>
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 <tt>selectdevice</tt> procedure, for
instance like one of these:
<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 <b><tt>-r</tt></b> switch:
<blockquote>
<b><tt>gs -sDEVICE=</tt></b><em>printer</em><b><tt> -r</tt></b><em>XRES</em><b><tt>x</tt></b><em>YRES</em>
</blockquote>
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 <tt>-r</tt><em>res</em>.
<p>
The <tt>-r</tt> 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.
<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>
To send the output to a file, use the <tt>-sOutputFile=</tt> switch.
For instance, to direct all output into the file <tt>ABC.xyz</tt>, use
<blockquote><b><tt>
gs -sOutputFile=ABC.xyz
</tt></b></blockquote>
<p>
When printing on MS Windows systems, output normally goes directly to the printer, <tt>PRN</tt>. 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>
Ghostscript also accepts the special filename '<tt>-</tt>' which indicates the output should be writtent to stardard output (the command shell).
<p>
Be aware that filenames beginning with the character <tt>%</tt> have a special meaning in PostScript. If you need to specify a file name that actually
begins with <tt>%</tt>, you must prepend the <tt>%os%</tt> filedevice explicitly. For example to output to a file named <tt>%abc</tt>, you need to specify
<blockquote>
<b><tt>gs -sOutputFile=%os%%abc</tt></b>
</blockquote>
Please see <a href="Language.htm">Ghostscript and the PostScript Language</a> and the PostScript Language Reference Manual for more details on <tt>%</tt> and filedevices.
<p>
Note that on MS Windows systems, the <b><tt>%</tt></b> character also has a special meaning for the command processor (shell), so you will have to double it:
<blockquote>
<b><tt>gs -sOutputFile=%%os%%%%abc</tt></b> (on MS Windows)
</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 '<tt>%d</tt>' in the filename which Ghostscript will replace with the page number.
<p>
You can also control the number of digits used in the file name:
<blockquote><dl>
<dt><b><tt>-sOutputFile=ABC-%d.png</tt></b>
<dd>produces '<tt>ABC-1.png</tt>', ... , '<tt>ABC-10.png</tt>', ...<p>
<dt><b><tt>-sOutputFile=ABC-%03d.pgm</tt></b>
<dd>produces '<tt>ABC-001.pgm</tt>', ... , '<tt>ABC-010.pgm</tt>', ...<p>
<dt><b><tt>-sOutputFile=ABC_p%04d.tiff</tt></b>
<dd>produces '<tt>ABC_p0001.tiff</tt>', ... , '<tt>ABC_p0510.tiff</tt>', ... , '<tt>ABC_p5238.tiff</tt>'<p>
</dl></blockquote>
Generally <tt>%03d</tt> is the best option for normal documents.
<p>
As noted above, on MS Windows systems, you will have to double the
<tt>%</tt> character, e.g.,
<blockquote><tt><b>
gs -sOutputFile=ABC%%03d.xyz
</tt></b></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:
<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 <b><tt>-sPAPERSIZE=</tt></b> switch, for instance
<blockquote><b><tt>
-sPAPERSIZE=a4<br>
-sPAPERSIZE=legal
</tt></b></blockquote>
<li>
Otherwise you can set the page size using the
pair of switches
<blockquote>
<b><tt>-dDEVICEWIDTHPOINTS=</tt></b><em>w</em>
<b><tt>-dDEVICEHEIGHTPOINTS=</tt></b><em>h</em>
</blockquote>
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).
</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"><b><tt>-dFIXEDMEDIA</tt></b> switch</a> on the
command line.
<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 <b><tt>gs_init.ps</tt></b>.
This file is usually in the <tt>lib</tt> directory somewhere in the search path. See the section on <a href="#Finding_files">finding files</a> for details.
<p>
Find the consecutive lines
<blockquote><pre>
% Optionally choose a default paper size other than U.S. letter.
% (a4)
</pre></blockquote>
<p>
Then to make A4 the default paper size, uncomment the second line to change
this to
<blockquote><pre>
% Optionally choose a default paper size other than U.S. letter.
(a4)
</pre></blockquote>
<p>
For <tt>a4</tt> you can substitute any
<a href="#Known_paper_sizes">paper size Ghostscript knows</a>.
<p>
Sometimes the initialization files are compiled into Ghostscript can cannot be changed.
<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 '<b><tt>-</tt></b>' which is interpreted as standard input. Examples:
<blockquote>
{<em>some program producing ps</em>} <b><tt>| gs</tt></b> [options] <b><tt>-</tt></b>
<br>
<tt>zcat paper.ps.gz</tt> <b><tt>| gs</tt></b> <b><tt>-</tt></b>
</blockquote>
<p>
<em>Ghostscript cannot read PDF files from standard input or a pipe because the PDF language inherently requires random access to the file. Thus '<tt>-</tt>' only works with PostScript documents.</em>
<p>
When Ghostscript finishes reading from the pipe, it quits rather than
going into interactive mode. Because of this, options and files after the '<tt>-</tt>' in the command line will be ignored.
<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 <tt>lpr</tt>, use the command
<blockquote><tt>
<b>gs -q -sOutputFile=- |</b> lpr
</tt></blockquote>
<p>
In this case you must also use the <a href="#Quiet"><b><tt>-q</tt></b>
switch</a> to prevent Ghostscript from writing messages to standard output
which become mixed with the intended output stream.
<p>
Similar results can be obtained with the <tt>%stdout</tt> and <tt>%pipe%</tt> filedevices. The example above would become
<blockquote><tt>
<b>gs -sOutputFile=%stdout -q |</b> lpr
</tt></blockquote>
or
<blockquote><tt>
<b>gs -sOutputFile=%pipe%</b>lpr
</tt></blockquote>
(again, doubling the <b><tt>%</tt></b> character on MS Windows systems.)
<p>
In the last case, <tt>-q</tt> isn't necessary since Ghostscript handles the pipe itself and messages sent to stdout will be printed as normal.
<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
<tt>pdf2ps</tt> utility uses Ghostscript to convert PDF to (Level 2) PostScript.
<h3><a name="PDF_switches"></a>Switches for PDF files</h3>
<p>Here are some command line options specific to PDF
<dl>
<dt><b><tt>-dFirstPage=</tt></b><em>pagenumber</em>
<dd>Begins interpreting on the designated page of the document.
</dl>
<dl>
<dt><b><tt>-dLastPage=</tt></b><em>pagenumber</em>
<dd>Stops interpreting after the designated page of the document.
</dl>
<dl>
<dt><b><tt>-dPrinted</tt></b>
<dt><b><tt>-dPrinted=false</tt></b>
<dd>Determines whether the file should be displayed or printed using the
"screen" or "printer" options for annotations and images. With
<b><tt>-dPrinted</tt></b>, the output will use the file's "print"
options; with <b><tt>-dPrinted=false</tt></b>, 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
<b><tt>OutputFile</tt></b> parameter, and the printer options for
devices that do have this parameter.
</dl>
<dl>
<dt><b><tt>-dUseCropBox</tt></b>
<dd>Sets the page size to the CropBox rather than the MediaBox.
Some files have a CropBox that is smaller than the MediaBox and
may include white space, registration or cutting marks outside
the CropBox. Using this option will set the page size
appropriately for a viewer.
</dl>
<dl>
<dt><b><tt>-sPDFPassword=</tt></b><em>password</em>
<dd>Sets the user or owner password to be used in decoding encrypted
PDF files.
</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 <b><tt>%PDF</tt></b>, Acrobat will
scan the first 1000 bytes or so for this string, and ignore any preceding
garbage.
<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.
<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">'<tt>-</tt>'</a>,
Ghostscript will copy it to a temporary file before interpreting the PDF.
<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 <b><tt>%%BoundingBox</tt></b> 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 <b><tt>%%BoundingBox</tt></b> be in the header,
not the trailer.
To customize EPS handling, see <a href="#EPS_parameters">EPS parameters</a>.
<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/asn/developer/technotes/postscript.html"
class="offsite">
http://partners.adobe.com/asn/developer/technotes/postscript.html</a>
<hr>
<h2><a name="Finding_files"></a>How Ghostscript finds files</h2>
<p>
When looking for initialization files (<b><tt>gs_*.ps</tt></b>,
<b><tt>pdf_*.ps</tt></b>), font files, the <b><tt>Fontmap</tt></b> file,
and files named on the command line, Ghostscript first tests whether the
file name specifies an explicit directory.
<blockquote><table cellpadding=0 cellspacing=0>
<tr><th colspan=3 bgcolor="#CCCC00"><hr><font size="+1">Testing a file name for an explicit directory</font><hr>
<tr> <th align=left>System
<td>
<th align=left>Does the name ...
<tr> <td colspan=3><hr>
<tr> <td valign=top>Unix
<td>
<td>Begin with <b><tt><u>/</u></tt></b>, <b><tt><u>./</u></tt></b> or <b><tt><u>../</u></tt></b> ?
<tr> <td valign=top>MS Windows
<td>
<td>Have <b><tt><u>:</u></tt></b> as its second character, or
begin with <b><tt><u>/</u></tt></b>, <b><tt><u>\</u></tt></b>,
<b><tt><u>./</u></tt></b>, <b><tt><u>../</u></tt></b>, <b><tt><u>.\</u></tt></b>, or <b><tt><u>..\</u></tt></b> ?
<tr> <td valign=top>VMS
<td>
<td>Contain a node, device, root, or directory specification?
</table></blockquote>
<p><a name="General_search_path"></a> If the test succeeds, the file name
specifies an explicit directory and Ghostscript tries to open the file
using the name given. Otherwise it tries directories in this order:
<ol>
<li>The current directory (unless disabled by the
<a href="#P-_switch"><b><tt>-P-</tt></b> switch</a>);
<li>The directories specified by <a href="#I_switch"><b><tt>-I</tt></b>
switches</a> in the command line, if any;
<li>The directories specified by the <b><tt>GS_LIB</tt></b>
environment variable, if any;
<li>The directories specified by the
<b><tt>GS_LIB_DEFAULT</tt></b> macro (if any) in the makefile
when this executable was built.
</ol>
<p>
<b><tt>GS_LIB_DEFAULT</tt></b>,
<b><tt>GS_LIB</tt></b>, and the
<b><tt>-I</tt></b> parameter may specify either a single
directory or a list of directories separated by a character appropriate for
the operating system ("<b><tt>:</tt></b>" on Unix systems,
"<b><tt>,</tt></b>" on VMS systems, and
"<b><tt>;</tt></b>" on MS Windows systems). We think that trying
the current directory first is a very bad idea -- it opens serious security
loopholes and can lead to very confusing errors if one has more than one
version of Ghostscript in one's environment -- but when we attempted to
change it, users insisted that we change it back. You can disable looking
in the current directory first by using the
<a href="#P_switch"><b><tt>-P-</tt></b> switch</a>.
<p>
Note that Ghostscript does not use this file searching algorithm for the
<b><tt>run</tt></b> or <b><tt>file</tt></b>
operators: for these operators, it simply opens the file with the name
given. To run a file using the searching algorithm, use
<b><tt>runlibfile</tt></b> instead of
<b><tt>run</tt></b>.
<h3><a name="PS_resources"></a>Finding PostScript Level 2 resources</h3>
<p>
Ghostscript uses a completely different rule for looking for files
containing PostScript Level 2 "resources": per the Adobe documentation, it
concatenates together
<ol>
<li>the value of the system parameter
<b><tt>GenericResourceDir</tt></b> (initially
<b><tt>/Resource/</tt></b>)
<li>the name of the resource category (for instance, <b><tt>ProcSet</tt></b>)
<li>the value of the system parameter
<b><tt>GenericResourcePathSep</tt></b> (initially
"<b><tt>/</tt></b>")
<li>the name of the resource instance (for instance, <b><tt>CIDInit</tt></b>)
</ol>
<p>
To look up fonts, after exhausting the search method described in <a href="#Font_lookup">the
next section</a>, it concatenates together
<ol>
<li>the value of the system parameter
<b><tt>FontResourceDir</tt></b> (initially
<b><tt>/Resource/Font/</tt></b>)
<li>the name of the resource font (for instance, <b><tt>Times-Roman</tt></b>)
</ol>
<p>
Note that even though the system parameters are named "somethingDir", they
are not just plain directory names: they have "<b><tt>/</tt></b>" on the
end, so that they can be concatenated with the category name or font name.
<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
<b><tt>-I</tt></b>, <b><tt>GS_LIB</tt></b>, and
<b><tt>GS_LIB_DEFAULT</tt></b> <a href="#General_search_path">as described
above</a>, but also the directory that is the value of the
<b><tt>FontResourceDir</tt></b> system parameter, and an additional list of
directories that is the value of the <b><tt>GS_FONTPATH</tt></b> environment
variable (or the value provided with the <b><tt>-sFONTPATH=</tt></b> switch,
if present).
<p>
At startup time, Ghostscript reads in the <b><tt>Fontmap</tt></b> files in
every directory on the search path (or in the list provided with the
<b><tt>-sFONTMAP=</tt></b> 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.
<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
<b><tt>-I</tt></b>, <b><tt>GS_LIB</tt></b>, and
<b><tt>GS_LIB_DEFAULT</tt></b>), and the file is loaded successfully, and
loading it defines a font of the desired name, that is the end of the
process.
<li>
If this process fails at any step, Ghostscript looks for a file whose name
is the concatenation of the value of the <b><tt>FontResourceDir</tt></b>
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 <b><tt>FontResourceDir</tt></b> is normally the
string <b><tt>/Resource/Font/</tt></b>, but it can be changed with the
<b><tt>setsystemparams</tt></b> operator: see the PostScript Language
Reference Manual for details.
<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>
If that too fails, Ghostscript looks at the <b><tt>GS_FONTPATH</tt></b>
environment variable (or the value provided with the
<b><tt>-sFONTPATH=</tt></b> switch, if present), which is also a list of
directories. It goes to the first directory on the list, looking for all
files that appear to contain PostScript fonts; it then adds all those files
and fonts to the combined Fontmaps, and starts over.
<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>
Finally, if all else fails, it will try to find a substitute for the font
from among the standard 35 fonts.
</ul>
<blockquote><table cellpadding=0 cellspacing=0>
<tr><th colspan=3 bgcolor="#CCCC00"><hr><font size="+1">Differences between search path and font path</font><hr>
<tr> <th>Search path
<td>
<th>Font path
<tr> <td colspan=3><hr>
<tr> <td><b><tt>-I</tt></b> switch
<td>
<td><b><tt>-sFONTPATH=</tt></b> switch
<tr> <td>
<tr> <td><b><tt>GS_LIB</tt></b> and <b><tt>GS_LIB_DEFAULT</tt></b>
environment variables
<td>
<td><b><tt>GS_FONTPATH</tt></b> environment variable
<tr> <td>
<tr> <td valign=top>Consulted first
<td>
<td valign=top>Consulted only if search path and
<b><tt>FontResourceDir</tt></b> don't provide the file.
<tr> <td>
<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
<b><tt>FontName</tt></b> in the file.
<td> <td valign=top>Font-name-to-file-name mapping is
implicit -- the <b><tt>FontName</tt></b> in the file is
used. Aliases are not possible.
<tr> <td>
<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
<b><tt>ttfont.dev</tt></b> feature was included when the
executable was built), they are also available.
</table></blockquote>
<p>
If you are using one of the following types of computer, you may wish to
set the environment variable <b><tt>GS_FONTPATH</tt></b> 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 "*"):
<blockquote><table cellpadding=0 cellspacing=0>
<tr><th colspan=5 bgcolor="#CCCC00"><hr><font size="+1">Suggested <b><tt>GS_FONTPATH</tt></b> for different systems</font><hr>
<tr> <td>
<td>
<th align=left>System type
<td>
<th valign=bottom align=left><b><tt>GS_FONTPATH</tt></b>
<tr> <td colspan=5><hr>
<tr> <td>
<td>
<td valign=top>Digital Unix
<td>
<td><b><tt>/usr/lib/X11/fonts/Type1Adobe</tt></b>
<tr> <td>
<td>
<td valign=top>Ultrix
<td>
<td><b><tt>/usr/lib/DPS/outline/decwin</tt></b>
<tr> <td>
<td>
<td valign=top>HP-UX 9
<td>
<td><b><tt>/usr/lib/X11/fonts/type1.st/typefaces</tt></b>
<tr> <td>
<td>
<td valign=top>IBM AIX
<td>
<td><b><tt>/usr/lpp/DPS/fonts/outlines
<br>/usr/lpp/X11/lib/X11/fonts/Type1
<br>/usr/lpp/X11/lib/X11/fonts/Type1/DPS</tt></b>
<tr> <td>
<td>
<td valign=top>NeXT
<td>
<td><b><tt>/NextLibrary/Fonts/outline</tt></b>
<tr> <td>*
<td>
<td valign=top>SGI IRIX
<td>
<td><b><tt>/usr/lib/DPS/outline/base
<br>/usr/lib/X11/fonts/Type1</tt></b>
<tr> <td>
<td>
<td valign=top>SunOS 4.x<br>(NeWSprint only)
<td>
<td valign=top><b><tt>newsprint_2.5/SUNWsteNP/reloc/$BASEDIR/NeWSprint/<br> small_openwin/lib/fonts</tt></b>
<tr> <td>**
<td>
<td valign=top>SunOS 4.x
<td>
<td><b><tt>/usr/openwin/lib/X11/fonts/Type1/outline</tt></b>
<tr> <td>**
<td>
<td valign=top>Solaris 2.x
<td>
<td><b><tt>/usr/openwin/lib/X11/fonts/Type1/outline</tt></b>
<tr> <td>
<td>
<td valign=top>VMS
<td>
<td><b><tt>SYS$COMMON:[SYSFONT.XDPS.OUTLINE]</tt></b>
</table>
<hr align=left width="25%">
<p>
<b>*</b> On SGI IRIX systems, you must use <b><tt>Fontmap.SGI</tt></b> in
place of <b><tt>Fontmap</tt></b> or <b><tt>Fontmap.GS</tt></b>, because
otherwise the entries in <b><tt>Fontmap</tt></b> will take precedence over
the fonts in the FONTPATH directories.
<p>
<b>**</b> On Solaris systems simply setting <b><tt>GS_FONTPATH</tt></b> or
using <b><tt>-sFONTPATH=</tt></b> may not work, because for some reason some
versions of Ghostscript can't seem to find any of the Type1 fonts in
<b><tt>/usr/openwin/lib/X11/fonts/Type1/outline</tt></b>. (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 <b><tt>Fontmap.Sol</tt></b> 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
<blockquote><b><tt>
/usr/openwin/lib/X11/fonts/Type1<br>
/usr/openwin/lib/X11/fonts/Type1/outline
</tt></b></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.
</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>
Adobe Acrobat comes with a set of fourteen Type 1 fonts, on Unix typically
in a directory called ...<b><tt>/Acrobat3/Fonts</tt></b>. 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>.
<h3><a name="Temp_files"></a>Temporary files</h3>
<blockquote><table cellpadding=0 cellspacing=0>
<tr><th colspan=5 bgcolor="#CCCC00"><hr><font size="+1">Where Ghostscript puts temporary files</font><hr>
<tr valign=bottom>
<th align=left>Platform
<td>
<th align=left>Filename
<td>
<th align=left>Location
<tr> <td colspan=5><hr>
<tr valign=top> <td>MS Windows and OpenVMS
<td>
<td><b><tt>_temp_</tt></b>XX.XXX
<td>
<td>Current directory
<tr valign=top> <td>OS/2
<td>
<td><b><tt>gs</tt></b>XXXXXX
<td>
<td>Current directory
<tr valign=top> <td>Unix
<td>
<td><b><tt>gs_</tt></b>XXXXX
<td>
<td><b><tt>/tmp</tt></b>
</table></blockquote>
<p>
You can change in which directory Ghostscript creates temporary files by
setting the <b><tt>TMPDIR</tt></b> or <b><tt>TEMP</tt></b> 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.
<h2><a name="CIDFontSubstitution"></a>CID font substitution</h2>
<p>
CID fonts are PostScript resources containing
large number of glyphs (e.g. glyphs for Far East languages).
Please refer Postscript Language Reference,
third edition, for details.
<p>
CID font resources are different kind of PostScript resources than fonts.
Particularly they cannot be used as regular fonts. For doing this,
CID font resourse first to be combined with a CMap resource, which
defines specific codes for hieroglyphs (this allows to use
same collection of hieroglyphs with different encodings).
<p>
The simplest method to request a font composed of CID font resource and CMap resource
is to code
<blockquote><b><tt>
/CIDFont-CMap findfont
</tt></b></blockquote>
in a PostScript document, where <b><tt>CIDFont</tt></b> is a name of any
CID font resourse, and <b><tt>CMap</tt></b> is a name of a CMap resource,
being designed for same character collection. The interpreter will compose
the font automatically from the specified CID font and CMap resources.
Another method is based on the operator <b><tt>composefont</tt></b>.
<p>
For substituting CID font resources Ghostscript provides the control file
<b><tt>gs/lib/cidfmap</tt></b>, which defines a CID font resource map.
The file forms a table of records, each of which is a simple pair of names :
<blockquote><b><tt>
/Substituted /Original
</tt></b></blockquote>
where <b><tt>Substituted</tt></b> is a name of CID font resource being used
by a document, and <b><tt>Original</tt></b> 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 Japanese CID font resource to Korean CID font resource,
etc. Also please pay attention that CMap resource names must not appear in
<b><tt>gs/lib/cidfmap</tt></b>.
<hr>
<h2><a name="Platforms"></a>Notes on specific platforms</h2>
<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 Aladdin Enterprises or artofcode LLC.
<dl>
<dt><b><tt>pv.sh</tt></b>
<dd>Preview a specified page of a <b><tt>dvi</tt></b> file in an X window
</dl>
<dl>
<dt><b><tt>sysvlp.sh</tt></b>
<dd>System V 3.2 lp interface for parallel printer
</dl>
<dl>
<dt><b><tt>pj-gs.sh</tt></b>
<dd>Printing on an H-P PaintJet under HP-UX
</dl>
<dl>
<dt><b><tt>unix-lpr.sh</tt></b>
<dd>Queue filter for <b><tt>lpr</tt></b> under Unix;
<a href="Unix-lpr.htm">its documentation</a> is intended for system
administrators
</dl>
<dl>
<dt><b><tt>lprsetup.sh</tt></b>
<dd>Setup for <b><tt>unix-lpr.sh</tt></b>
</dl>
<hr>
<h3><a name="VMS"></a>VMS</h3>
<ul>
<li>To be able to specify switches and file names when invoking the
interpreter, define <b><tt>gs</tt></b> as a foreign command:
<blockquote>
<b><tt>$ gs == "$</tt></b><em>disk</em><b><tt>:[</tt></b><em>directory</em><b><tt>]gs.exe</tt></b>"
</blockquote>
<p>
where the "<em>disk</em>" and "<em>directory</em>" specify where
the Ghostscript executable is located. For instance,
<blockquote><b><tt>
$ gs == "$dua1:[ghostscript]gs.exe"
</tt></b></blockquote>
<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 "<b><tt>:</tt></b>", it is taken to refer to a logical
device, for instance
<blockquote><b><tt>
$ define ghostscript_device dua1:[ghostscript_510]<br>
$ define gs_lib ghostscript_device:
</tt></b></blockquote>
<p>
If the "directory" name ends with a closing square bracket
"<b><tt>]</tt></b>", it is taken to refer to a real directory, for instance
<blockquote><b><tt>
$ define gs_lib dua1:[ghostscript]
</tt></b></blockquote>
<li>Defining the logical <b><tt>GS_LIB</tt></b>
<blockquote>
<b><tt>$ define gs_lib</tt></b> <em>disk</em><b><tt>:[</tt></b><em>directory</em><b><tt>]</tt></b>
</blockquote>
<p>
allows Ghostscript to find its initialization files in the Ghostscript
directory even if that's not where the executable resides.<br>
<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
<blockquote><b><tt>
$ gs -Isys$login:
</tt></b></blockquote>
<p>
Ghostscript sees the switch as <b><tt>-isys$login</tt></b>,
which doesn't work. To preserve the case of switches, quote them like
this:
<blockquote><b><tt>
$ gs "-Isys$login:"
</tt></b></blockquote>
<li>If you write printer output to a file with
<b><tt>-sOutputFile=</tt></b> and then want to print the file later, use
"<b><tt>PRINT/PASSALL</tt></b>".
</ul>
<ul>
<li>PDF files (or PostScript files that use the
<b><tt>setfileposition</tt></b> 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 <b><tt>gcc</tt></b>.) Because of this, if you transfer files by
FTP, you probably need to do one of these two things after the transfer:
<ol>
<li>If the FTP transfer was in text (ASCII) mode:
<blockquote>
<b><tt>$ convert/fdl=streamlf.fdl</tt></b> input-file output-file
</blockquote>
<p>
where the contents of the file <b><tt>STREAMLF.FDL</tt></b> are
<blockquote>
<pre>FILE
ORGANIZATION sequential
RECORD
BLOCK_SPAN yes
CARRIAGE_CONTROL carriage_return
FORMAT stream_lf
</pre></blockquote>
<li>If the FTP transfer was in binary mode:
<blockquote><b><tt>
$ set file/attribute=(rfm:stmlf)
</tt></b></blockquote>
</ol>
</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
<blockquote><b><tt>
$ set display/create/node="doof.city.com"/transport=tcpip
</tt></b></blockquote>
<p>
and then run Ghostscript by typing <b><tt>gs</tt></b> at the command line.
<hr>
<h3><a name="MS_Windows"></a>MS Windows</h3>
<p>
The name of the Ghostscript command line executable on MS Windows is
<tt>gswin32c</tt> so use this instead of the plain '<tt>gs</tt>' in
the quickstart examples.
<p>
You must add <em>gs\</em><tt>bin</tt> and
<em>gs\</em><tt>lib</tt> to the <b><tt>PATH</tt></b>, where
<em>gs</em> is the top-level Ghostscript directory.
<p>
When passing options to ghostcript through a batch file wrapper such as
<tt>ps2pdf.bat</tt> you need to substitute '#' for '=' as the separator
between options and their arguments. For example:
<blockquote><pre>
ps2pdf -sPAPERSIZE#a4 file.ps file.pdf
</pre></blockquote>
Ghostscript treats '#' the same internally, and the '=' is mangled by
the command shell.
<p>
There is also an older version for windows called just <tt>gswin32</tt>
that provides its own window for the interactive postscript prompt. Except
on Windows 3.1, gswin32c is the better option since it uses the
native command prompt window.
<hr>
<h3><a name="MS-DOS"></a>MS-DOS</h3>
<p>
<strong>Note:</strong> Ghostscript is no longer supported on MS-DOS.
<p>
Invoking Ghostscript from the command prompt in Windows is supported by
the Windows executable described above.
<hr>
<h3><a name="X_Windows"></a>X Windows</h3>
<p>
Ghostscript looks for the following resources under the program name
<b><tt>ghostscript</tt></b> and class name
<b><tt>Ghostscript</tt></b>; the ones marked "**" are
calculated from display metrics:
<blockquote><table cellpadding=0 cellspacing=0>
<tr><th colspan=5 bgcolor="#CCCC00"><hr><font size="+1">X Windows resources</font><hr>
<tr> <th align=left>Name
<td>
<th align=left>Class
<td>
<th align=left>Default
<tr> <td colspan=5><hr>
<tr> <td><b><tt>background</tt></b>
<td>
<td><b><tt>Background</tt></b>
<td>
<td><b><tt>white</tt></b>
<tr> <td><b><tt>foreground</tt></b>
<td>
<td><b><tt>Foreground</tt></b>
<td>
<td><b><tt>black</tt></b>
<tr> <td><b><tt>borderColor</tt></b>
<td>
<td><b><tt>BorderColor</tt></b>
<td>
<td><b><tt>black</tt></b>
<tr> <td><b><tt>borderWidth</tt></b>
<td>
<td><b><tt>BorderWidth</tt></b>
<td>
<td><b><tt>1</tt></b>
<tr> <td><b><tt>geometry</tt></b>
<td>
<td><b><tt>Geometry</tt></b>
<td>
<td><b><tt>NULL</tt></b>
<tr> <td><b><tt>xResolution</tt></b>
<td>
<td><b><tt>Resolution</tt></b>
<td>
<td>**
<tr> <td><b><tt>yResolution</tt></b>
<td>
<td><b><tt>Resolution</tt></b>
<td>
<td>**
<tr> <td><b><tt>useExternalFonts</tt></b>
<td>
<td><b><tt>UseExternalFonts</tt></b>
<td>
<td><b><tt>true</tt></b>
<tr> <td><b><tt>useScalableFonts</tt></b>
<td>
<td><b><tt>UseScalableFonts</tt></b>
<td>
<td><b><tt>true</tt></b>
<tr> <td><b><tt>logExternalFonts</tt></b>
<td>
<td><b><tt>LogExternalFonts</tt></b>
<td>
<td><b><tt>false</tt></b>
<tr> <td><b><tt>externalFontTolerance</tt></b>
<td>
<td><b><tt>ExternalFontTolerance</tt></b>
<td>
<td><b><tt>10.0</tt></b>
<tr> <td><b><tt>palette</tt></b>
<td>
<td><b><tt>Palette</tt></b>
<td>
<td><b><tt>Color</tt></b>
<tr> <td><b><tt>maxGrayRamp</tt></b>
<td>
<td><b><tt>MaxGrayRamp</tt></b>
<td>
<td><b><tt>128</tt></b>
<tr> <td><b><tt>maxRGBRamp</tt></b>
<td>
<td><b><tt>MaxRGBRamp</tt></b>
<td>
<td><b><tt>5</tt></b>
<tr> <td><b><tt>maxDynamicColors</tt></b>
<td>
<td><b><tt>MaxDynamicColors</tt></b>
<td>
<td><b><tt>256</tt></b>
<tr> <td><b><tt>useBackingPixmap</tt></b>
<td>
<td><b><tt>UseBackingPixmap</tt></b>
<td>
<td><b><tt>true</tt></b>
<tr> <td><b><tt>useXPutImage</tt></b>
<td>
<td><b><tt>UseXPutImage</tt></b>
<td>
<td><b><tt>true</tt></b>
<tr> <td><b><tt>useXSetTile</tt></b>
<td>
<td><b><tt>UseXSetTile</tt></b>
<td>
<td><b><tt>true</tt></b>
<tr> <td><b><tt>regularFonts</tt></b>
<td>
<td><b><tt>RegularFonts</tt></b>
<td>
<td>See "<a href="#X_fonts">X fonts</a>"
<tr> <td><b><tt>symbolFonts</tt></b>
<td>
<td><b><tt>SymbolFonts</tt></b>
<td>
<td>See "<a href="#X_fonts">X fonts</a>"
<tr> <td><b><tt>dingbatFonts</tt></b>
<td>
<td><b><tt>DingbatFonts</tt></b>
<td>
<td>See "<a href="#X_fonts">X fonts</a>"
</table></blockquote>
<h4><a name="X_resources"></a>X resources</h4>
<ul>
<li>
To set X resources, put them in a file (such as
<b><tt>~/.Xdefaults</tt></b> on Unix) in a form like this:
<blockquote><table cellpadding=0 cellspacing=0>
<tr><td><b><tt>Ghostscript*geometry:</tt></b><td><b><tt> </tt></b><td><b><tt>595x842-0+0</tt></b>
<tr><td><b><tt>Ghostscript*xResolution:</tt></b><td><b><tt> </tt></b><td><b><tt>72</tt></b>
<tr><td><b><tt>Ghostscript*yResolution:</tt></b><td><b><tt> </tt></b><td><b><tt>72</tt></b>
</table></blockquote>
<p>
Then merge these resources into the X server's resource database:
<blockquote><b><tt>
xrdb -merge ~/.Xdefaults
</tt></b></blockquote>
<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>
The <b><tt>geometry</tt></b> resource affects only window placement.
<li>
Resolution is expressed in pixels per inch (1 inch = 25.4mm).
<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>
The <b><tt>palette</tt></b> resource can be used to restrict Ghostscript to
using a grayscale or monochrome palette.
<li>
<b><tt>maxRGBRamp</tt></b> and
<b><tt>maxGrayRamp</tt></b> 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.
<b><tt>maxDynamicColors</tt></b> controls the maximum
number of colors that Ghostscript will allocate dynamically in the
colormap.
</ul>
<h4><a name="X_server_bugs"></a>Working around bugs in X servers</h4>
<p>
The "<b><tt>use</tt></b>..." resources exist primarily to work around bugs
in X servers.
<ul>
<li> Old versions of DEC's X server (DECwindows) have bugs that
require setting <b><tt>useXPutImage</tt></b> or
<b><tt>useXSetTile</tt></b> to
<b><tt>false</tt></b>.
<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
<b><tt>useBackingPixmap</tt></b> to
<b><tt>false</tt></b>.
<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
<b><tt>useXSetTile</tt></b> to
<b><tt>false</tt></b>.
<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
<b><tt>useXPutImage</tt></b> to
<b><tt>false</tt></b>.
</ul>
<h4><a name="X_fonts"></a>X fonts</h4>
<p>
To use native X11 fonts, Ghostscript must map PostScript font names to the
XLFD font names. The resources <b><tt>regularFonts</tt></b>
(fonts available in standard or ISO-Latin-1 encoding),
<b><tt>symbolFonts</tt></b> (using Symbol encoding), and
<b><tt>dingbatFonts</tt></b> (using Dingbat encoding) give
the name mapping for different encodings. The XLFD font name in the
mapping must contain 7 dashes; the X driver adds the additional size and
encoding fields to bring the total number of dashes in the font name to 14.
See the appendix "<a href="#X_font_mappings">X default font mappings</a>"
for the full list of default mappings.
<p>
Users who switch regularly between different X servers may wish to use the
"*" wild card in place of the foundry name
(<b><tt>itc</tt></b>,
<b><tt>monotype</tt></b>,
<b><tt>linotype</tt></b>,
<b><tt>b&h</tt></b>, or
<b><tt>adobe</tt></b>); users who do not switch X servers
should leave the explicit foundry in the name, since it speeds up access to
fonts.
<p>
Ghostscript takes advantage of the "HP XLFD Enhancements," if available, to
use native X11 fonts for fonts that are anamorphically scaled, rotated, or
mirrored. If the changes have been installed to the X or font server, they
are automatically used when appropriate.
<h4><a name="GS_fonts_as_X_fonts"></a>Using Ghostscript fonts on X displays</h4>
<p>
Font files distributed with Ghostscript can be used on X Windows displays.
You can find full instructions in the
<a href="Fonts.htm#Use_gs_fonts_with_X">documentation on fonts</a>.
<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
<b><tt>-d</tt></b> switch in the command line (e.g.,
<b><tt>-dMaxBitmap=10000000</tt></b>), not resources to be defined in the
<b><tt>~/.Xdefaults</tt></b> file.
<dl>
<dt><b><tt>AlwaysUpdate <boolean></tt></b>
<dd>If <b><tt>true</tt></b>, the driver updates the screen after each
primitive drawing operation; if <b><tt>false</tt></b> (the default), the
driver uses an intelligent buffered updating algorithm.
</dl>
<dl>
<dt><b><tt>MaxBitmap <integer></tt></b>
<dd>If the amount of memory required to hold the pixmap for the window is no
more than the value of <b><tt>MaxBitmap</tt></b>, 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 <b><tt>MaxBitmap</tt></b>, 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
<b><tt>MaxBitmap</tt></b> is 0.
</dl>
<dl>
<dt><b><tt>MaxTempPixmap, MaxTempImage, MaxBufferedTotal, MaxBufferedArea,
MaxBufferedCount <integer></tt></b>
<dd>These control various aspects of the driver's buffering behavior. For
details, please consult the source file <b><tt>gdevx.h</tt></b>.
</dl>
<hr>
<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.
<hr>
<h2><a name="Options"></a>Command line options</h2>
<p>
Unless otherwise noted, these switches can be used on all platforms.
<h3><a name="General_switches"></a>General switches</h3>
<h4><a name="Input_control"></a>Input control</h4>
<dl>
<dt><b><tt>@</tt></b><em>filename</em>
<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.
</dl>
<dl>
<dt><b><tt>--</tt></b> <em>filename arg1 ...</em>
<br><b><tt>-+</tt></b> <em>filename arg1 ...</em>
<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 <b><tt>ARGUMENTS</tt></b> 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.
</dl>
<dl>
<dt><b><tt>-@</tt></b> <em>filename arg1 ...</em>
<dd>Does the same thing as <b><tt>--</tt></b> and <b><tt>-+</tt></b>, but
expands <b><tt>@</tt></b><em>filename</em> arguments.
</dl>
<dl>
<dt><b><tt>-</tt></b>
<br><b><tt>-_</tt></b>
<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 '<tt>-_</tt>' which always reads the input in blocks.
However, '<tt>-</tt>' is equivalent on most systems.
</dl>
<dl>
<dt><b><tt>-c</tt></b> <em>tokens ...</em>
<dd>Interprets arguments as PostScript code up to the next argument that
begins with "<b><tt>-</tt></b>" followed by a non-digit, or with
"<b><tt>@</tt></b>". For example, if the file <b><tt>quit.ps</tt></b>
contains just the word "<b><tt>quit</tt></b>", then
<b><tt>-c quit</tt></b> on the command line is equivalent to
<b><tt>quit.ps</tt></b> there. Each argument must be exactly one token, as
defined by the <b><tt>token</tt></b> operator.
</dl>
<dl>
<dt><b><tt>-f</tt></b>
<dd>Interprets following non-switch arguments as file names to be executed
using the normal <b><tt>run</tt></b> command. Since this is the default
behavior, <b><tt>-f</tt></b> is useful only for terminating the list of
tokens for the <b><tt>-c</tt></b> switch.
</dl>
<dl>
<dt><b><tt>-f</tt></b><em>filename</em>
<dd>Execute the given file, even if its name begins with a
"<b><tt>-</tt></b>" or "<b><tt>@</tt></b>".
</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.
<dl>
<dt><a name="I_switch"></a><b><tt>-I</tt></b><em>directories</em>
<dd>Adds the designated list of directories at the head of the search path
for library files.
</dl>
<dl>
<dt><a name="P_switch"></a><b><tt>-P</tt></b>
<dd>Makes Ghostscript look first in the current directory for library
files. This is currently the default.
</dl>
<dl>
<dt><a name="P-_switch"></a><b><tt>-P-</tt></b>
<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 "<b><tt>.</tt></b>").
</dl>
<h4><a name="Parameters"></a>Setting parameters</h4>
<dl>
<dt><b><tt>-D</tt></b><em>name</em>
<br><b><tt>-d</tt></b><em>name</em>
<dd>Define a name in systemdict with value=true.
</dl>
<dl>
<dt><b><tt>-D</tt></b><em>name</em><b><tt>=</tt></b><em>token</em>
<br><b><tt>-d</tt></b><em>name</em><b><tt>=</tt></b><em>token</em>
<dd>Define a name in systemdict with the given definition. The token must
be exactly one token (as defined by the <b><tt>token</tt></b> operator) and
must not contain any whitespace. If the token is a non-literal name, it
must be true, false, or null.
</dl>
<dl>
<dt><b><tt>-S</tt></b><em>name</em><b><tt>=</tt></b><em>string</em>
<br><b><tt>-s</tt></b><em>name</em><b><tt>=</tt></b><em>string</em>
<dd>Define a name in systemdict with a given string as value. This is
different from <b><tt>-d</tt></b>. For example, <b><tt>-dXYZ=35</tt></b>
on the command line is equivalent to the program fragment
<blockquote><b><tt>
/XYZ 35 def
</tt></b></blockquote>
<p>
whereas <b><tt>-sXYZ=35</tt></b> is equivalent to
<blockquote><b><tt>
/XYZ (35) def
</tt></b></blockquote>
</dl>
<dl>
<dt><b><tt>-u</tt></b><em>name</em>
<dd>Un-define a name, cancelling <b><tt>-d</tt></b> or <b><tt>-s</tt></b>.
</dl>
<p>
Note that the initialization file <b><tt>gs_init.ps</tt></b> makes
<b><tt>systemdict</tt></b> read-only, so the values of names defined with
<b><tt>-D</tt></b>, <b><tt>-d</tt></b>, <b><tt>-S</tt></b>, and
<b><tt>-s</tt></b> cannot be changed -- although, of course, they can be
superseded by definitions in <b><tt>userdict</tt></b> or other dictionaries.
However, device parameters set this way (<b><tt>PageSize</tt></b>,
<b><tt>Margins</tt></b>, etc.) are <em>not</em> read-only, and <em>can</em>
be changed by code in PostScript files.
<dl>
<dt><b><tt>-g</tt></b><em>number1</em><b><tt>x</tt></b><em>number2</em>
<dd>Equivalent to <b><tt>-dDEVICEWIDTH=</tt></b><em>number1</em> and
<b><tt>-dDEVICEHEIGHT=</tt></b><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 <b><tt>-dFIXEDMEDIA</tt></b> below.
</dl>
<dl>
<dt><a name="Resolution_switch"></a><b><tt>-r</tt></b><em>number</em> (same
as <b><tt>-r</tt></b><em>number</em><b><tt>x</tt></b><em>number</em>)
<br><b><tt>-r</tt></b><em>number1</em><b><tt>x</tt></b><em>number2</em>
<dd>Equivalent to <b><tt>-dDEVICEXRESOLUTION=</tt></b><em>number1</em> and
<b><tt>-dDEVICEYRESOLUTION=</tt></b><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.
</dl>
<h4><a name="Quiet"></a>Suppress messages</h4>
<dl>
<dt><a name="Quiet"></a><b><tt>-q</tt></b>
<dd>Quiet startup: suppress normal startup messages, and also do the
equivalent of <a href="#dQUIET"><b><tt>-dQUIET</tt></b></a>.
</dl>
<h3><a name="Parameter_switches"></a>Parameter switches (<b><tt>-d</tt></b> and <b><tt>-s</tt></b>)</h3>
<p>
As noted above, <b><tt>-d</tt></b> and <b><tt>-s</tt></b> define initial
values for PostScript names. Some of these names are parameters that
control the interpreter or the graphics engine. You can also use
<b><tt>-d</tt></b> or <b><tt>-s</tt></b> to define a value for any device
parameter of the initial device (the one defined with
<b><tt>-sDEVICE=</tt></b>, or the default device if this switch is not
used). For example, since the <b><tt>ppmraw</tt></b> device has a numeric
<b><tt>GrayValues</tt></b> parameter that controls the number of bits per
component, <b><tt>-sDEVICE=ppmraw -dGrayValues=16</tt></b> will make this
the default device and set the number of bits per component to 4 (log2(16)).
<h4><a name="Rendering_parameters"></a>Rendering parameters</h4>
<dl>
<dt><b><tt>-dCOLORSCREEN
<br>-dCOLORSCREEN=0
<br>-dCOLORSCREEN=false</tt></b>
<dd>On high-resolution devices (at least 150 dpi resolution, or
<b><tt>-dDITHERPPI</tt></b> specified), <b><tt>-dCOLORSCREEN</tt></b>
forces the use of separate halftone screens with different angles for CMYK
or RGB if halftones are needed (this produces the best-quality output);
<b><tt>-dCOLORSCREEN=0</tt></b> uses separate screens with the same
frequency and angle; <b><tt>-dCOLORSCREEN=false</tt></b> forces the use of
a single binary screen. The default if <b><tt>COLORSCREEN</tt></b> 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.
</dl>
<dl>
<dt><b><tt>-dDITHERPPI=</tt></b><em>lpi</em>
<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.
</dl>
<dl>
<dt><b><tt>-dDOINTERPOLATE</tt></b>
<dd>Turns on image interpolation for all images, improving image quality for
scaled images at the expense of speed. Note that
<b><tt>-dNOINTERPOLATE</tt></b> overrides <b><tt>-dDOINTERPOLATE</tt></b> if
both are specified.
</dl>
<dl>
<dt><b><tt>-dTextAlphaBits=</tt></b><em>n</em>
<dt><b><tt>-dGraphicsAlphaBits=</tt></b><em>n</em>
<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.
</dl>
<dl>
<dt><b><tt>-dUseCIEColor</tt></b>
<dd>Set UseCIEColor in the page device dictionary, remapping device-dependent
color values through a CIE color space. This can can improve conversion
of CMYK documents to RGB.
</dl>
<dl>
<dt><b><tt>-dNOCIE</tt></b>
<dd>Substitutes <b><tt>DeviceGray</tt></b> and <b><tt>DeviceRGB</tt></b>
for CIEBasedA and CIEBasedABC color spaces respectively. Useful only on
very slow systems where color accuracy is less important.
</dl>
<dl>
<dt><b><tt>-dNOINTERPOLATE</tt></b>
<dd>Turns off image interpolation, improving performance on interpolated
images at the expense of image quality. <b><tt>-dNOINTERPOLATE</tt></b>
overrides <b><tt>-dDOINTERPOLATE</tt></b>.
</dl>
<dl>
<dt><b><tt>-dNOTRANSPARENCY</tt></b>
<dd>Turns off PDF 1.4 transparency, resulting in faster (but possibly
incorrect) rendering of pages containing PDF 1.4 transparency and
blending.
</dl>
<dl>
<dt><b><tt>-dDOPS</tt></b>
<dd>Enables processing of DoPS directives in PDF files. DoPS has in
fact been deprecated for some time. Use of this option is not
recommended in security-conscious applications, as it increases the
scope for malicious code. <b><tt>-dDOPS</tt></b> has no effect on
processing of PostScript source files. Note: in releases 7.30 and
earlier, processing of DoPS was always enabled.
</dl>
<h4><a name="Page_parameters"></a>Page parameters</h4>
<dl>
<dt><a name="FIXEDMEDIA"></a><b><tt>-dFIXEDMEDIA</tt></b>
<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 <b><tt>-g</tt></b>
automatically sets <b><tt>-dFIXEDMEDIA</tt></b>, but
<b><tt>-sPAPERSIZE=</tt></b> does not.
</dl>
<dl>
<dt><b><tt>-dFIXEDRESOLUTION</tt></b>
<dd>Causes the media resolution to be fixed similarly. <b><tt>-r</tt></b>
automatically sets <b><tt>-dFIXEDRESOLUTION</tt></b>.
</dl>
<dl>
<dt><b><tt>-dORIENT1=true
<br>-dORIENT1=false</tt></b>
<dd>Defines the meaning of the 0 and 1 orientation values for the
setpage[params] compatibility operators. The default value of
<b><tt>ORIENT1</tt></b> is true (set in <b><tt>gs_init.ps</tt></b>), 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.
<b><tt>-dORIENT1=false</tt></b> 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.
</dl>
<dl>
<dt><b><tt>-dDEVICEWIDTHPOINTS=</tt></b><em>w</em>
<br><b><tt>-dDEVICEHEIGHTPOINTS=</tt></b><em>h</em>
<dd>Sets the initial page width to <em>w</em> or initial page height to
<em>h</em> respectively, specified in 1/72" units.
</dl>
<h4><a name="Font_related_parameters"></a>Font-related parameters</h4>
<dl>
<dt><a name="DISKFONTS"></a><b><tt>-dDISKFONTS</tt></b>
<dd>Causes individual character outlines to be loaded from the disk the
first time they are encountered. (Normally Ghostscript loads all the
character outlines when it loads a font.) This may allow loading more
fonts into memory at the expense of slower rendering.
<b><tt>DISKFONTS</tt></b> is effective only if the diskfont feature was
built into the executable; otherwise it is ignored.
</dl>
<dl>
<dt><b><tt>-dLOCALFONTS</tt></b>
<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.
</dl>
<dl>
<dt><b><tt>-dNOCCFONTS</tt></b>
<dd>Suppresses the use of fonts precompiled into the Ghostscript executable.
See <a href="Fonts.htm#Precompiling">"Precompiling fonts"</a> in the
documentation on fonts for details. This is probably useful only for
debugging.
</dl>
<dl>
<dt><a name="FONTMAP_switch"></a><b><tt>-dNOFONTMAP</tt></b>
<dd>Suppresses the normal loading of the Fontmap file. This may be useful
in environments without a file system.
</dl>
<dl>
<dt><b><tt>-dNOFONTPATH</tt></b>
<dd>Suppresses consultation of <b><tt>GS_FONTPATH</tt></b>. This may be
useful for debugging.
</dl>
<dl>
<dt><b><tt>-dNOPLATFONTS</tt></b>
<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.
</dl>
<dl>
<dt><b><tt>-sFONTMAP=</tt></b><em>filename1</em><b><tt>;</tt></b><em>filename2</em><b><tt>;</tt></b><em>...</em>
<dd>Specifies alternate name or names for the Fontmap file. Note that the
names are separated by "<b><tt>:</tt></b>" on Unix systems, by
"<b><tt>;</tt></b>" on MS Windows systems, and by
"<b><tt>,</tt></b>" on VMS systems, just as for search paths.
</dl>
<dl>
<dt><b><tt>-sFONTPATH=</tt></b><em>dir1</em><b><tt>;</tt></b><em>dir2</em><b><tt>;</tt></b><em>...</em>
<dd>Specifies a list of directories that will be scanned when looking for
fonts not found on the search path, overriding the environment variable
<b><tt>GS_FONTPATH</tt></b>.
</dl>
<dl>
<dt><b><tt>-sSUBSTFONT=</tt></b><em>fontname</em>
<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 <b><tt>findfont</tt></b> is the actual font
named "<em>fontname</em>", not a copy of the font with the
<b><tt>FontName</tt></b> changed to the requested one.
</dl>
<h4><a name="Interaction_related_parameters"></a>Interaction-related parameters</h4>
<dl>
<dt><b><tt>-dBATCH</tt></b>
<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.
</dl>
<dl>
<dt><b><tt>-dNOPAGEPROMPT</tt></b>
<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.
</dl>
<dl>
<dt><a name="NoPause"></a><b><tt>-dNOPAUSE</tt></b>
<dd>Disables the prompt and pause at the end of each page. Normally one
should use this (along with <b><tt>-dBATCH</tt></b>) when producing output
on a printer or to a file; it also may be desirable for applications where
another program is "driving" Ghostscript.
</dl>
<dl>
<dt><b><tt>-dNOPROMPT</tt></b>
<dd>Disables the prompt printed by Ghostscript when it expects interactive
input, as well as the end-of-page prompt (<b><tt>-dNOPAGEPROMPT</tt></b>);
also disables the implicit <b><tt>flushpage</tt></b> that normally occurs
each time Ghostscript asks for more input. This allows piping input
directly into Ghostscript, as long as the data doesn't refer to
<b><tt>currentfile</tt></b>.
</dl>
<dl>
<dt><a name="dQUIET"></a><b><tt>-dQUIET</tt></b>
<dd>Suppresses routine information comments on standard output. This is
currently necessary when redirecting device output to standard output.
</dl>
<dl>
<dt><b><tt>-dSHORTERRORS</tt></b>
<dd>Makes certain error and information messages more Adobe-compatible.
</dl>
<dl>
<dt><b><tt>-sstdout=</tt></b><em>filename</em>
<dd>Redirect PostScript <b><tt>%stdout</tt></b> to a file or
<b><tt>stderr</tt></b>, to avoid it being mixed with device stdout.
To redirect stdout to stderr use <b><tt>-sstdout=%stderr</tt></b>.
To cancel redirection of stdout use <b><tt>-sstdout=%stdout</tt></b>
or <b><tt>-sstdout=-</tt></b>.
</dl>
<dl>
<dt><b><tt>-dTTYPAUSE</tt></b>
<dd>Causes Ghostscript to read a character from <b><tt>/dev/tty</tt></b>,
rather than standard input, at the end of each page. This may be useful if
input is coming from a pipe. Note that <b><tt>-dTTYPAUSE</tt></b>
overrides <b><tt>-dNOPAUSE</tt></b>.
</dl>
<h4><a name="Output_selection_parameters"></a>Device and output selection parameters</h4>
<dl>
<dt><b><tt>-dNODISPLAY</tt></b>
<dd>Initializes Ghostscript with a null device (a device that discards the
output image) rather than the default device or the device selected with
<b><tt>-sDEVICE=</tt></b>. This is usually useful only when running
PostScript code whose purpose is to compute something rather than to
produce an output image; for instance, when converting PostScript to PDF.
</dl>
<dl>
<dt><a name="DEVICE_switch"></a><b><tt>-sDEVICE=</tt></b><em>device</em>
<dd>Selects an alternate <a href="#Output_device">initial output
device</a>.
</dl>
<dl>
<dt><b><tt>-sOutputFile=</tt></b><em>filename</em>
<dd>Selects an alternate output file (or pipe) for the initial output
device, as described above.
</dl>
<h4><a name="EPS_parameters"></a>EPS parameters</h4>
<dl>
<dt><b><tt>-dEPSCrop</tt></b>
<dd>Crop an EPS file to the bounding box.
This is useful when converting an EPS file to a bitmap.
</dl>
<dl>
<dt><b><tt>-dEPSFitPage</tt></b>
<dd>Resize an EPS file to fit the page.
This is useful for enlarging an EPS file to fit the paper size when printing.
</dl>
<dl>
<dt><b><tt>-dNOEPS</tt></b>
<dd>Prevent special processing of EPS files.
This is useful when EPS files have incorrect Document
Structuring Convention comments.
</dl>
<h4><a name="Other_parameters"></a>Other parameters</h4>
<dl>
<dt><b><tt>-dDELAYBIND</tt></b>
<dd>Causes <b><tt>bind</tt></b> to remember all its invocations, but not
actually execute them until the <b><tt>.bindnow</tt></b> procedure is
called. Useful only for certain specialized packages like
<b><tt>pstotext</tt></b> that redefine operators.
</dl>
<dl>
<dt><b><tt>-dDOPDFMARKS</tt></b>
<dd>Causes <b><tt>pdfmark</tt></b> to be called for bookmarks,
annotations, links and cropbox when processing PDF files.
Normally, <b><tt>pdfmark</tt></b> is only called for these types
for PostScript files or when the output device requests it
(e.g. pdfwrite device).
</dl>
<dl>
<dt><b><tt>-dNOBIND</tt></b>
<dd>Disables the <b><tt>bind</tt></b> operator. Useful only for debugging.
</dl>
<dl>
<dt><b><tt>-dNOCACHE</tt></b>
<dd>Disables character caching. Useful only for debugging.
</dl>
<dl>
<dt><b><tt>-dNOGC</tt></b>
<dd>Suppresses the initial automatic enabling of the garbage collector in
Level 2 systems. (The <b><tt>vmreclaim</tt></b> operator is not disabled.)
Useful only for debugging.
</dl>
<dl>
<dt><b><tt>-dNOSAFER</tt></b> (equivalent to <b><tt>-dDELAYSAFER</tt></b>).
<dd>This flag disables SAFER mode until the <b><tt>.setsafe</tt></b>
procedure is run. This is intended for clients or scripts that cannot
operate in SAFER mode. If Ghostscript is started with <b><tt>-dNOSAFER</tt></b>
or <b><tt>-dDELAYSAFER</tt></b>, 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 <tt>.setsafe</tt> should be
run prior to running any PostScript file with unknown contents.</b>
</dl>
<a name="Safer"></a>
<dl>
<dt><b><tt>-dSAFER</tt></b>
<dd>Disables the <b><tt>deletefile</tt></b> and <b><tt>renamefile</tt></b>
operators, and the ability to open piped commands (<b><tt>%pipe%</tt></b><em>cmd</em>)
at all. Only <b><tt>%stdout</tt></b> and <b><tt>%stderr</tt></b> can be opened
for writing. Disables reading of files other than <b><tt>%stdin</tt></b>,
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 <b><tt>-sDEVICE= </tt></b>
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 <b><tt>-sOutputFile=...</tt></b> on the command line is unrestricted.
<p>
SAFER mode also prevents changing the /GenericResourceDir, /FontResourceDir
and either the /SystemParamsPassword or the /StartJobPassword.
<p>
<b>Note: </b>While SAFER mode is not the default, in a subsequent release of
Ghostscript, SAFER mode will be the default thus scripts or programs that need
to open files or set restricted parameters will require the <b><tt>-dNOSAFER</tt></b>
command line option.
<p>
When running -dNOSAFER it is possible to perform a <b><tt>save</tt></b>,
followed by <b><tt>.setsafe</tt></b>, execute a file or procedure in SAFER mode,
then use <b><tt>restore</tt></b> to return to NOSAFER mode. In order to prevent
the save object from being restored by the foreign file or procedure, the
<a href="Language.htm#Runandhide"><b>.runandhide</b></a> operator should
be used to hide the save object from the restricted procedure.
</dl>
<dl>
<dt><b><tt>-dSTRICT</tt></b>
<dd>Disables as many Ghostscript extensions as feasible, to be more helpful
in debugging applications that produce output for Adobe and other RIPs.
</dl>
<dl>
<dt><b><tt>-dWRITESYSTEMDICT</tt></b>
<dd>Leaves <b><tt>systemdict</tt></b> writable. This is necessary when
running special utility programs such as <b><tt>font2c</tt></b> and
<b><tt>pcharstr</tt></b>, which must bypass normal PostScript access
protection.
</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.
<ul>
<li>
If you are using X Windows, setting the <b><tt>-dMaxBitmap=</tt></b>
parameter described <a href="#X_device_parameters">above</a> may
dramatically improve performance on files that have a lot of bitmap images.
<li>
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 2-3 Mb of
memory: <b><tt>-c 3000000 setvmthreshold -f</tt></b>.
</ul>
<h2><a name="Environment_variables"></a>Summary of environment variables</h2>
<dl>
<dt><b><tt>GS</tt></b>, <b><tt>GSC</tt></b> (MS Windows only)
<dd>Specify the names of the Ghostscript executables. <b><tt>GS</tt></b>
brings up a new typein window and possibly a graphics window;
<b><tt>GSC</tt></b> uses the DOS console. If these are not set,
<b><tt>GS</tt></b> defaults to <b><tt>gswin32</tt></b>, and
<b><tt>GSC</tt></b> defaults to <b><tt>gswin32c</tt></b>.
</dl>
<dl>
<dt><a href="#GS_DEVICE"><b><tt>GS_DEVICE</tt></b></a>
<dd>Defines the default output device. This overrides the compiled-in default, but is overridden by any commandline setting.
</dl>
<dl>
<dt><a href="#Font_lookup"><b><tt>GS_FONTPATH</tt></b></a>
<dd>Specifies a list of directories to scan for fonts if a font requested
can't be found anywhere on the search path.
</dl>
<dl>
<dt><a href="#Finding_files"><b><tt>GS_LIB</tt></b></a>
<dd>Provides a search path for initialization files and fonts.
</dl>
<dl>
<dt><b><tt>GS_OPTIONS</tt></b>
<dd>Defines a list of command-line arguments to be processed before the
ones actually specified on the command line. For example, setting
<b><tt>GS_DEVICE</tt></b> to XYZ is equivalent to setting
<b><tt>GS_OPTIONS</tt></b> to <b><tt>-sDEVICE=XYZ</tt></b>. The contents
of <b><tt>GS_OPTIONS</tt></b> are not limited to switches; they may include
actual file names or even <a href="#Input_control">"@file" arguments</a>.
</dl>
<dl>
<dt><a href="#Temp_files"><b><tt>TEMP</tt></b>, <b><tt>TMPDIR</tt></b></a>
<dd>Defines a directory name for temporary files. If both
<b><tt>TEMP</tt></b> and <b><tt>TMPDIR</tt></b> are defined,
<b><tt>TMPDIR</tt></b> takes precedence.
</dl>
<hr>
<h2><a name="Debugging"></a>Debugging</h2>
<p>
The information here describing is probably interesting only to developers.
<h4><a name="Debug_switches"></a>Debug switches</h4>
The <b><tt>-Z</tt></b> and <b><tt>-T</tt></b>
! 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.
<table cellpadding=0 cellspacing=0>
<tr><th colspan=5 bgcolor="#CCCC00"><hr><font size="+1">Switches used in debugging</font><hr>
<tr> <th align=left>Switch
<td>
<th align=left>Equivalent
<td>
<th>
<tr> <td colspan=5><hr>
<tr> <td valign=top><b><tt>-A</tt></b>
<td>
<td valign=top><b><tt>-Z@</tt></b>
<td>
<td>Fill empty storage with a distinctive bit pattern for debugging
<tr> <td valign=top><b><tt>-A-</tt></b>
<td>
<td valign=top><b><tt>-Z-@</tt></b>
<td>
<td>Turn off <b><tt>-A</tt></b>
<tr> <td valign=top><b><tt>-B</tt></b><em>size</em>
<td>
<td>
<td>
<td>Run all subsequent files named on the command line (except for
<b><tt>-F</tt></b>) through the run_string interface, using a
buffer of <em>size</em> bytes
<tr> <td valign=top><b><tt>-B-</tt></b>
<td>
<td>
<td>
<td>Turn off <b><tt>-B</tt></b>: run subsequent files (except for
<b><tt>-F</tt></b>) directly in the normal way
<tr> <td valign=top><b><tt>-E</tt></b>
<td>
<td valign=top><b><tt>-Z#</tt></b>
<td>
<td>Turn on tracing of error returns from operators
<tr> <td valign=top><b><tt>-E-</tt></b>
<td>
<td valign=top><b><tt>-Z-#</tt></b>
<td>
<td>Turn off <b><tt>-E</tt></b>
<tr> <td valign=top><b><tt>-F</tt></b><em>file</em>
<td>
<td>
<td>
<td>Execute the file with <b><tt>-B1</tt></b> temporarily in effect
<tr> <td valign=top><b><tt>-K</tt></b><em>n</em>
<td>
<td>
<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.
<tr> <td valign=top><b><tt>-M</tt></b><em>n</em>
<td>
<td>
<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
(currently 20K on DOS systems, 50K on Unix). <b><em>n</em></b>
is a positive decimal integer, on DOS systems no greater than
63.
<tr> <td valign=top><b><tt>-N</tt></b><em>n</em>
<td>
<td>
<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 <b><tt>EXTEND_NAMES</tt></b> was defined when the
interpreter was compiled .
<tr> <td valign=top><b><tt>-Z</tt></b><em>xxx</em><br><b><tt>-Z-</tt></b><em>xxx</em>
<td>
<td>
<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.
<dl compact>
<dt><b><tt>0</tt></b><dd>garbage collector, minimal detail
<dt><b><tt>1</tt></b><dd>type 1 and type 42 font interpreter
<dt><b><tt>2</tt></b><dd>curve subdivider/rasterizer
<dt> <b><tt>3</tt></b><dd>curve subdivider/rasterizer, detail
<dt><b><tt>4</tt></b><dd>garbage collector (strings)
<dt> <b><tt>5</tt></b><dd>garbage collector (strings, detail)
<dt><b><tt>6</tt></b><dd>garbage collector (chunks, roots)
<dt> <b><tt>7</tt></b><dd>garbage collector (objects)
<dt> <b><tt>8</tt></b><dd>garbage collector (refs)
<dt> <b><tt>9</tt></b><dd>garbage collector (pointers)
<dt><b><tt>a</tt></b><dd>allocator (large blocks only)
<dt> <b><tt>A</tt></b><dd>allocator (all calls)
<dt><b><tt>b</tt></b><dd>bitmap image processor
<dt> <b><tt>B</tt></b><dd>bitmap images, detail
<dt><b><tt>c</tt></b><dd>color/halftone mapper
<dt><b><tt>d</tt></b><dd>dictionary put/undef
<dt> <b><tt>D</tt></b><dd>dictionary lookups
<dt><b><tt>e</tt></b><dd>external (OS-related) calls
<dt><b><tt>f</tt></b><dd>fill algorithm (summary)
<dt> <b><tt>F</tt></b><dd>fill algorithm (detail)
<dt><b><tt>g</tt></b><dd>gsave/grestore[all]
<dt><b><tt>h</tt></b><dd>halftone renderer
<dt> <b><tt>H</tt></b><dd>halftones, every pixel
<dt><b><tt>i</tt></b><dd>interpreter, just names
<dt> <b><tt>I</tt></b><dd>interpreter, everything
<dt><b><tt>j</tt></b><dd>(Japanese) composite fonts
<dt><b><tt>k</tt></b><dd>character cache and xfonts
<dt> <b><tt>K</tt></b><dd>character cache, every access
<dt><b><tt>l</tt></b><dd>command lists, bands
<dt> <b><tt>L</tt></b><dd>command lists, everything
<dt><b><tt>m</tt></b><dd>makefont and font cache
<dt><b><tt>n</tt></b><dd>name lookup (new names only)
<dt><b><tt>o</tt></b><dd>outliner (stroke)
<dt> <b><tt>O</tt></b><dd>stroke detail
<dt><b><tt>p</tt></b><dd>band list paths
<dt> <b><tt>P</tt></b><dd>all paths
<dt><b><tt>q</tt></b><dd>clipping
<dt><b><tt>r</tt></b><dd>arc renderer
<dt><b><tt>s</tt></b><dd>streams
<dt> <b><tt>S</tt></b><dd>scanner
<dt><b><tt>t</tt></b><dd>tiling algorithm
<dt><b><tt>u</tt></b><dd>undo saver (for save/restore), finalization
<dt> <b><tt>U</tt></b><dd>undo saver, more detail
<dt><b><tt>v</tt></b><dd>alpha/transparency
<dt> <b><tt>V</tt></b><dd>alpha/transparency, more detail
<dt><b><tt>w</tt></b><dd>compression encoder/decoder
<dt><b><tt>x</tt></b><dd>transformations
<dt><b><tt>y</tt></b><dd>Type 1 hints
<dt> <b><tt>Y</tt></b><dd>Type 1 hints, every access
<dt><b><tt>z</tt></b><dd>trapezoid fill
<dt><b><tt>#</tt></b><dd>operator error returns
<dt><b><tt>%</tt></b><dd>externally processed comments
<dt><b><tt>*</tt></b><dd>image and RasterOp parameters
<dt><b><tt>:</tt></b><dd>command list and allocator/time summary
<dt><b><tt>~</tt></b><dd>math functions and Functions
<dt><b><tt>'</tt></b><dd>contexts, create/destroy
<dt> <b><tt>"</tt></b><dd>contexts, every operation
<dt><b><tt>^</tt></b><dd>reference counting
<dt><b><tt>_</tt></b><dd>high-level output
<dt><b><tt>|</tt></b><dd>(reserved for experimental code)
</dl>
<p>
The following switch affects what is printed, but does not select specific
items for printing:
<dl compact>
<dt><b><tt>/</tt></b><dd>include file name and line number on all trace output
</dl>
<p>
These switches select debugging options other than what should be printed:
<dl compact>
<dt><b><tt>$</tt></b><dd>set unused parts of object references to
identifiable garbage values
<dt><b><tt>+</tt></b><dd>use minimum-size stack blocks
<dt><b><tt>,</tt></b><dd>don't use path-based banding
<dt><b><tt>`</tt></b><dd>don't use high-level banded images
<dt><b><tt>.</tt></b><dd>use small-memory table sizes even on large-memory
machines
<dt><b><tt>?</tt></b><dd>validate pointers before, during and after garbage
collection, also before and after save and restore; also make other
allocator validity checks
<dt><b><tt>@</tt></b><dd>fill newly allocated, garbage-collected, and freed
storage with a marker (a1, c1, and f1 respectively)
</dl>
<p>
<tr> <td valign=top><b><tt>-T</tt></b><em>xxx</em><br><b><tt>-T-</tt></b><em>xxx</em>
<td>
<td>
<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.
<dl compact>
<dt><b><tt>f</tt></b><dd>filling algorithm
</dl>
</table>
<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>
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, <b><tt>-T</tt></b> <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 incompletnesses of the implementation :
<p>
1. The graphical output uses a hardcoded scale. An advanced client
would provide a scale option via user interface.
<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 <b><tt>gs_statd.ps</tt></b>; see the comments there for
more details about the definitions. The table here lists them by name and
size. <b><tt>gs_statd.ps</tt></b> 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
<blockquote>
<a href="http://www.twics.com/~eds/paper/index.html">http://www.twics.com/~eds/paper/</a>
</blockquote>
<table cellpadding=0 cellspacing=0>
<tr><th colspan=13 bgcolor="#CCCC00"><hr><font size="+1">Paper sizes known to Ghostscript</font><hr>
<tr><th colspan=13>U.S. standard
<tr> <td>
<td>
<th colspan=3>Inches
<td>
<th colspan=3>mm
<td>
<th colspan=3>Points
<td>
<td>
<tr> <th align=left>Name
<td>
<th> W
<td>×
<th> H
<td>
<th> W
<td>×
<th> H
<td>
<th> W
<td>×
<th> H
<td>
<td>
<tr> <td colspan=13><hr>
<tr> <td>11x17
<td> <td align=right>11.0<td> <td align=right>17.0<td> <td align=right>279<td> <td align=right>432<td> <td align=right>792<td> <td align=right>1224<td> <td>11×17in portrait
<tr> <td>ledger
<td> <td align=right>17.0<td> <td align=right>11.0<td> <td align=right>432<td> <td align=right>279<td> <td align=right>1224<td> <td align=right>792<td> <td>11×17in landscape
<tr> <td>legal
<td> <td align=right>8.5<td> <td align=right>14.0<td> <td align=right>216<td> <td align=right>356<td> <td align=right>612<td> <td align=right>1008<td> <td>
<tr> <td>letter
<td> <td align=right>8.5<td> <td align=right>11.0<td> <td align=right>216<td> <td align=right>279<td> <td align=right>612<td> <td align=right>792<td> <td>
<tr> <td>lettersmall
<td> <td align=right>8.5<td> <td align=right>11.0<td> <td align=right>216<td> <td align=right>279<td> <td align=right>612<td> <td align=right>792<td> <td>
<tr> <td>archE
<td> <td align=right>36.0<td> <td align=right>48.0<td> <td align=right>914<td> <td align=right>1219<td> <td align=right>2592<td> <td align=right>3456<td> <td>
<tr> <td>archD
<td> <td align=right>24.0<td> <td align=right>36.0<td> <td align=right>610<td> <td align=right>914<td> <td align=right>1728<td> <td align=right>2592<td> <td>
<tr> <td>archC
<td> <td align=right>18.0<td> <td align=right>24.0<td> <td align=right>457<td> <td align=right>610<td> <td align=right>1296<td> <td align=right>1728<td> <td>
<tr> <td>archB
<td> <td align=right>12.0<td> <td align=right>18.0<td> <td align=right>305<td> <td align=right>457<td> <td align=right>864<td> <td align=right>1296<td> <td>
<tr> <td>archA
<td> <td align=right>9.0<td> <td align=right>12.0<td> <td align=right>229<td> <td align=right>305<td> <td align=right>648<td> <td align=right>864<td> <td>
<tr> <td colspan=13><hr>
<tr><th colspan=13>ISO standard
<tr> <td colspan=13><hr>
<tr> <td>a0
<td> <td align=right>33.1<td> <td align=right>46.8<td> <td align=right>841<td> <td align=right>1189<td> <td align=right>2384<td> <td align=right>3370<td> <td>
<tr> <td>a1
<td> <td align=right>23.4<td> <td align=right>33.1<td> <td align=right>594<td> <td align=right>841<td> <td align=right>1684<td> <td align=right>2384<td> <td>
<tr> <td>a2
<td> <td align=right>16.5<td> <td align=right>23.4<td> <td align=right>420<td> <td align=right>594<td> <td align=right>1191<td> <td align=right>1684<td> <td>
<tr> <td>a3
<td> <td align=right>11.7<td> <td align=right>16.5<td> <td align=right>297<td> <td align=right>420<td> <td align=right>842<td> <td align=right>1191<td> <td>
<tr> <td>a4
<td> <td align=right>8.3<td> <td align=right>11.7<td> <td align=right>210<td> <td align=right>297<td> <td align=right>595<td> <td align=right>842<td> <td>
<tr> <td>a4small
<td> <td align=right>8.3<td> <td align=right>11.7<td> <td align=right>210<td> <td align=right>297<td> <td align=right>595<td> <td align=right>842<td> <td>
<tr> <td>a5
<td> <td align=right>5.8<td> <td align=right>8.3<td> <td align=right>148<td> <td align=right>210<td> <td align=right>420<td> <td align=right>595<td> <td>
<tr> <td>a6
<td> <td align=right>4.1<td> <td align=right>5.8<td> <td align=right>105<td> <td align=right>148<td> <td align=right>297<td> <td align=right>420<td> <td>
<tr> <td>a7
<td> <td align=right>2.9<td> <td align=right>4.1<td> <td align=right>74<td> <td align=right>105<td> <td align=right>210<td> <td align=right>297<td> <td>
<tr> <td>a8
<td> <td align=right>2.1<td> <td align=right>2.9<td> <td align=right>52<td> <td align=right>74<td> <td align=right>148<td> <td align=right>210<td> <td>
<tr> <td>a9
<td> <td align=right>1.5<td> <td align=right>2.1<td> <td align=right>37<td> <td align=right>52<td> <td align=right>105<td> <td align=right>148<td> <td>
<tr> <td>a10
<td> <td align=right>1.0<td> <td align=right>1.5<td> <td align=right>26<td> <td align=right>37<td> <td align=right>73<td> <td align=right>105<td> <td>
<tr> <td>isob0
<td> <td align=right>39.4<td> <td align=right>55.7<td> <td align=right>1000<td> <td align=right>1414<td> <td align=right>2835<td> <td align=right>4008<td> <td>
<tr> <td>isob1
<td> <td align=right>27.8<td> <td align=right>39.4<td> <td align=right>707<td> <td align=right>1000<td> <td align=right>2004<td> <td align=right>2835<td> <td>
<tr> <td>isob2
<td> <td align=right>19.7<td> <td align=right>27.8<td> <td align=right>500<td> <td align=right>707<td> <td align=right>1417<td> <td align=right>2004<td> <td>
<tr> <td>isob3
<td> <td align=right>13.9<td> <td align=right>19.7<td> <td align=right>353<td> <td align=right>500<td> <td align=right>1001<td> <td align=right>1417<td> <td>
<tr> <td>isob4
<td> <td align=right>9.8<td> <td align=right>13.9<td> <td align=right>250<td> <td align=right>353<td> <td align=right>709<td> <td align=right>1001<td> <td>
<tr> <td>isob5
<td> <td align=right>6.9<td> <td align=right>9.8<td> <td align=right>176<td> <td align=right>250<td> <td align=right>499<td> <td align=right>709<td> <td>
<tr> <td>isob6
<td> <td align=right>4.9<td> <td align=right>6.9<td> <td align=right>125<td> <td align=right>176<td> <td align=right>354<td> <td align=right>499<td> <td>
<tr> <td>c0
<td> <td align=right>36.1<td> <td align=right>51.1<td> <td align=right>917<td> <td align=right>1297<td> <td align=right>2599<td> <td align=right>3677<td> <td>
<tr> <td>c1
<td> <td align=right>25.5<td> <td align=right>36.1<td> <td align=right>648<td> <td align=right>917<td> <td align=right>1837<td> <td align=right>2599<td> <td>
<tr> <td>c2
<td> <td align=right>18.0<td> <td align=right>25.5<td> <td align=right>458<td> <td align=right>648<td> <td align=right>1298<td> <td align=right>1837<td> <td>
<tr> <td>c3
<td> <td align=right>12.8<td> <td align=right>18.0<td> <td align=right>324<td> <td align=right>458<td> <td align=right>918<td> <td align=right>1298<td> <td>
<tr> <td>c4
<td> <td align=right>9.0<td> <td align=right>12.8<td> <td align=right>229<td> <td align=right>324<td> <td align=right>649<td> <td align=right>918<td> <td>
<tr> <td>c5
<td> <td align=right>6.4<td> <td align=right>9.0<td> <td align=right>162<td> <td align=right>229<td> <td align=right>459<td> <td align=right>649<td> <td>
<tr> <td>c6
<td> <td align=right>4.5<td> <td align=right>6.4<td> <td align=right>114<td> <td align=right>162<td> <td align=right>323<td> <td align=right>459<td> <td>
<tr> <td colspan=13><hr>
<tr><th colspan=13>JIS standard
<tr> <td colspan=13><hr>
<tr> <td>jisb0
<td> <td align=right><td> <td align=right><td> <td align=right>1030<td> <td align=right>1456<td> <td align=right><td> <td align=right><td> <td>
<tr> <td>jisb1
<td> <td align=right><td> <td align=right><td> <td align=right>728<td> <td align=right>1030<td> <td align=right><td> <td align=right><td> <td>
<tr> <td>jisb2
<td> <td align=right><td> <td align=right><td> <td align=right>515<td> <td align=right>728<td> <td align=right><td> <td align=right><td> <td>
<tr> <td>jisb3
<td> <td align=right><td> <td align=right><td> <td align=right>364<td> <td align=right>515<td> <td align=right><td> <td align=right><td> <td>
<tr> <td>jisb4
<td> <td align=right><td> <td align=right><td> <td align=right>257<td> <td align=right>364<td> <td align=right><td> <td align=right><td> <td>
<tr> <td>jisb5
<td> <td align=right><td> <td align=right><td> <td align=right>182<td> <td align=right>257<td> <td align=right><td> <td align=right><td> <td>
<tr> <td>jisb6
<td> <td align=right><td> <td align=right><td> <td align=right>128<td> <td align=right>182<td> <td align=right><td> <td align=right><td> <td>
<tr> <td colspan=13><hr>
<tr><th colspan=13>ISO/JIS switchable
<tr> <td colspan=13><hr>
<tr> <td>b0 (see * below)
<tr> <td>b1 (see * below)
<tr> <td>b2 (see * below)
<tr> <td>b3 (see * below)
<tr> <td>b4 (see * below)
<tr> <td>b5 (see * below)
<tr> <td colspan=13><hr>
<tr><th colspan=13>Other
<tr> <td colspan=13><hr>
<tr> <td>flsa
<td> <td align=right>8.5<td> <td align=right>13.0<td> <td align=right>216<td> <td align=right>330<td> <td align=right>612<td> <td align=right>936<td> <td>U.S. foolscap
<tr> <td>flse
<td> <td align=right>8.5<td> <td align=right>13.0<td> <td align=right>216<td> <td align=right>330<td> <td align=right>612<td> <td align=right>936<td> <td>European foolscap
<tr> <td>halfletter
<td> <td align=right>5.5<td> <td align=right>8.5<td> <td align=right>140<td> <td align=right>216<td> <td align=right>396<td> <td align=right>612<td> <td>
</table>
<p>
*<em>Note:</em> Initially the B paper sizes are the ISO sizes, e.g.,
<b><tt>b0</tt></b> is the same as <b><tt>isob0</tt></b>. Running the file
<b><tt>lib/jispaper.ps</tt></b> makes the B paper sizes be the JIS sizes,
e.g., <b><tt>b0</tt></b> becomes the same as <b><tt>jisb0</tt></b>.
<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:
<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&h-lucidabright-medium-r-normal-- \n\
LucidaBright-Demi: -b&h-lucidabright-demibold-r-normal-- \n\
LucidaBright-DemiItalic: -b&h-lucidabright-demibold-i-normal-- \n\
LucidaBright-Italic: -b&h-lucidabright-medium-i-normal-- \n\
LucidaSans: -b&h-lucida-medium-r-normal-sans- \n\
LucidaSans-Bold: -b&h-lucida-bold-r-normal-sans- \n\
LucidaSans-BoldItalic: -b&h-lucida-bold-i-normal-sans- \n\
LucidaSans-Italic: -b&h-lucida-medium-i-normal-sans- \n\
LucidaSans-Typewriter: -b&h-lucidatypewriter-medium-r-normal-sans- \n\
LucidaSans-TypewriterBold: -b&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>
<h2><a name="UFST_run"></a>Running Ghostscript with UFST</h2>
<p>
<em>Note: This section is only for customers who have licensed Agfa's UFST.
Other users please skip this section.
</em>
<p>
<em>
Important note: Third-party font renderers (such as UFST) are incompatible
with devices that can embed fonts in their output (such as pdfwrite),
because such renderers store fonts in a form from which Ghostscript cannot
get the necessary information for embedding. Ghostscript disables such
renderers when such devices is being used. In particular, UFST is
disabled while running Ghostscript with the <b><tt>pdfwrite</tt></b>
device.
</em>
<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>.
<p>
Then you need to obtain the Decoding resources from Artifex Software Inc. and install them with Ghostscript.
Just copy the files to the <b><tt>Resource/Decoding</tt></b> directory (or to the subdirectory
<b><tt>Decoding</tt></b> of a directory, which is specified in <b><tt>GenericResourcePath</tt></b>).
<p>
There are 2 ways to handle fonts with UFST. First, you can substitute
any UFST-handled font to a Postscript font, using special map files.
Second, you can redirect Postscript fonts to UFST, setting
entries in <b><tt>gs/lib/FAPIconfig</tt></b> file.
<p>
The file <b><tt>gs/lib/FAPIfontmap</tt></b> defines a map table for FAPI-handled fonts.
The format of <b><tt>gs/lib/FAPIfontmap</tt></b> is explained below.
<p>
Font files being handled with UFST may reside in any directory in your hard disk.
Paths to them to be specified in <b><tt>gs/lib/FAPIfontmap</tt></b>. The path may be either
absolute or relative. Relative ones are being resolved from the path,
which is specified in <b><tt>gs/lib/FAPIconfig</tt></b> file.
<p>
The file <b><tt>gs/lib/FAPIfontmap</tt></b> is actually special PostScript code.
It contains records for each font being rendered by UFST.
Records must end with semicolon. Each 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 :
<table cellpadding=0 cellspacing=10>
<tr> <th>Key
<th>Type
<th>Description
<tr> <td>Path
<td>string
<td>Absolute path to font file, or relative path to font file from the FontPath value,
being specified in <b><tt>gs/lib/FAPIconfig</tt></b>.
<tr> <td>FontType
<td>interger
<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.
<tr> <td>FAPI
<td>name
<td>Name of the renderer to be used with the font.
Only AgfaUFST is now allowed.
<tr> <td>SubfontId
<td>integer
<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.
<tr> <td>Decoding
<td>name
<td>(optional) The name of a Decoding resource to be used with the font.
If specified, <b><tt>gs/lib/xlatmap</tt></b> (see below) doesn't work for this font.
</table>
<p>
Example of FAPI font map record :
<blockquote>
<b><tt>
/FCO1 << /Path (/AFPL/Agfa/fontdata/MTFONTS/PCLPS3/MT1/PCLP3__F.fco) /FontType 1 /FAPI /AgfaUFST >> ;
</tt></b>
</blockquote>
<p>
Note that <b><tt>gs/lib/FAPIfontmap</tt></b> specifies only instances of
Font category. CID fonts to be listed in another map file.
<p>
The file <b><tt>gs/lib/FAPIcidfmap</tt></b> defines a mapping table for
CIDFont resources. It contains records for each CID font being rendered by UFST.
The format is similar to <b><tt>gs/lib/FAPIfontmap</tt></b>,
but dictionaries must contain few different entries :
<table cellpadding=0 cellspacing=10>
<tr> <th>Key
<th>Type
<th>Description
<tr> <td>Path
<td>string
<td>Absolute path to font file, or relative path to font file from the CIDFontPath value,
being specified in <b><tt>gs/lib/FAPIconfig</tt></b>.
<tr> <td>CIDFontType
<td>interger
<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.
<tr> <td>FAPI
<td>name
<td>Name of the renderer to be used with the font.
Only AgfaUFST is now allowed.
<tr> <td>SubfontId
<td>integer
<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.
<tr> <td>CSI
<td>array of 2 elements
<td>(required) Information for building <b><tt>CIDFontSystemInfo</tt></b>.
The first element is a string, which specifies <b><tt>Ordering</tt></b>.
The second element is a number, which specifies <b><tt>Supplement</tt></b>.
</table>
<p>
Example of FAPI CID font map record :
<blockquote>
<b><tt>
/HeiseiKakuGo-W5 << /Path (/WIN2000/Fonts/PMINGLIU.TTF) /CIDFontType 0 /FAPI /AgfaUFST /CSI [(Japan1) 2] >> ;
</tt></b>
</blockquote>
<p>
The control file <b><tt>gs/lib/FAPIconfig</tt></b> defines 4 entries :
<table cellpadding=0 cellspacing=10>
<tr> <th>Key
<th>Type
<th>Description
<tr> <td>FontPath
<td>string
<td>Absolute path to a directory, which contains fonts. Used to resolve
relative paths in <b><tt>gs/lib/FAPIfontmap</tt></b>.
<tr> <td>CIDFontPath
<td>string
<td>Absolute path to a directory, which contains fonts to substitute to CID fonts.
Used to resolve relative paths in <b><tt>gs/lib/FAPIcidfmap</tt></b>.
It may be same or different than FontPath.
<tr> <td>HookDiskFonts
<td>array of integers.
<td>List of PS font types to be handled with UFST.
This controls other fonts that ones listed in <b><tt>gs/lib/FAPIfontmap</tt></b>
and <b><tt>gs/lib/FAPIcidfmap</tt></b> - such ones are PS fonts installed to
Ghostscript with <b><tt>gs/lib/fontmap</tt></b> or with <b><tt>GS_FONTPATH</tt></b>,
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.
<tr> <td>HookEmbeddedFonts
<td>array of integers.
<td>List of PS font types to be handled with UFST.
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.
</table>
<p>
You may need to customize the file <b><tt>gs/lib/xlatmap</tt></b>. Follow instructions in it.
<p>
Note that UFST cannot handle some Ghostscript fonts because
UFST does not include a PostScript interpreter and therefore has stronger restrictions on
font formats than Ghostscript itself does.
If their font types are listed in HookDiskFonts or in HookEmbeddedFonts,
Ghostscript interpret them as PS files, then serializes font data into a RAM buffer and
passes it to UFST as PCLEOs.
<p>
<!-- [2.0 end contents] ==================================================== -->
<!-- [3.0 begin visible trailer] =========================================== -->
<hr>
<p>
<small>Copyright © 1996-2002 artofcode LLC. All rights reserved.</small>
<p>
This software is provided AS-IS with no warranty, either express or
implied.
This software is distributed under license and may not be copied,
modified or distributed except as expressly authorized under the terms
of the license contained in the file LICENSE in this distribution.
For more information about licensing, please refer to
http://www.ghostscript.com/licensing/. For information on
commercial licensing, go to http://www.artifex.com/licensing/ or
contact Artifex Software, Inc., 101 Lucas Valley Road #110,
San Rafael, CA 94903, U.S.A., +1(415)492-9861.
<p>
<small>Ghostscript version 8.01, 30 January 2004
<!-- [3.0 end visible trailer] ============================================= -->
</body>
</html>
|