home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / GRAPHICS / PSCRIPT / GS241PS.ZIP / USE.DOC < prev    next >
Encoding:
Text File  |  1992-04-21  |  14.1 KB  |  400 lines

  1.    Copyright (C) 1989, 1992 Aladdin Enterprises.  All rights reserved.
  2.    Distributed by Free Software Foundation, Inc.
  3.  
  4. This file is part of Ghostscript.
  5.  
  6. Ghostscript is distributed in the hope that it will be useful, but
  7. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  8. to anyone for the consequences of using it or for whether it serves any
  9. particular purpose or works at all, unless he says so in writing.  Refer
  10. to the Ghostscript General Public License for full details.
  11.  
  12. Everyone is granted permission to copy, modify and redistribute
  13. Ghostscript, but only under the conditions described in the Ghostscript
  14. General Public License.  A copy of this license is supposed to have been
  15. given to you along with Ghostscript so you can know your rights and
  16. responsibilities.  It should be in a file named COPYING.  Among other
  17. things, the copyright notice and this notice must be preserved on all
  18. copies.
  19.  
  20. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  21.  
  22. This file, use.doc, describes how to use the Ghostscript language
  23. interpreter.
  24.  
  25. For an overview of Ghostscript and a list of the documentation files, see
  26. README.  
  27.  
  28. ********
  29. ******** How to use the Ghostscript interpreter ********
  30. ********
  31.  
  32. The file name of the Ghostscript interpreter is gs.exe (MS-DOS and VMS) or
  33. gs (Unix).  To run it, you also need some external initialization files:
  34.     gs_*.ps (gs_2asc.ps, gs_dps1.ps,
  35.          gs_fonts.ps, gs_init.ps, gs_lev2.ps, gs_statd.ps)
  36.     sym__enc.ps
  37.     uglyr.gsf
  38.     Fontmap
  39. as well as any other fonts from the Ghostscript distribution (.gsf and
  40. .pfa files).
  41.  
  42. To invoke the interpreter, give the command
  43.     gs <filename1> ... <filenameN>
  44. The interpreter will read in the files in sequence and execute them.
  45. After doing this, it reads further input from the primary input stream
  46. (normally the keyboard).  Each line (i.e. characters up to a <return>) is
  47. interpreted separately.  To exit from the interpreter, type quit<return>.
  48. The interpreter also exits gracefully if it encounters end-of-file.
  49. Typing the interrupt character, e.g., control-C, is also safe.
  50.  
  51. The interpreter recognizes several switches described below, which may appear
  52. anywhere in the command line and apply to all files thereafter.
  53.  
  54. You can get a help message by invoking Ghostscript with
  55.     gs -h
  56. or
  57.     gs -?
  58. This message also lists the available devices.  For a little more
  59. information, a one-line description of each device appears near the
  60. beginning of the file devs.mak.
  61.  
  62. Choosing the output device
  63. --------------------------
  64.  
  65. Ghostscript may be built with multiple output devices.  Ghostscript
  66. normally opens the first one and directs output to it.  To use device xyz
  67. as the initial output device, include the switch
  68.     -sDEVICE=xyz
  69. in the command line.  Note that this switch must precede the first .ps
  70. file, and only its first invocation has any effect.  For example, for
  71. printer output in a normal configuration that includes an Epson printer
  72. driver, you might use the shell command
  73.     gs -sDEVICE=epson myfile.ps
  74. instead of just
  75.     gs myfile.ps
  76. Alternatively, you can type
  77.     (epson) selectdevice
  78.     (myfile.ps) run
  79. All output then goes to the printer instead of the display until further
  80. notice.  You can switch devices at any time by using the selectdevice
  81. procedure, e.g.,
  82.     (vga) selectdevice
  83. or
  84.     (epson) selectdevice
  85. As yet a third alternative, you can define an environment variable
  86. GS_DEVICE as the desired default device name.  The order of precedence for
  87. these alternatives, highest to lowest, is:
  88.     selectdevice
  89.     (command line)
  90.     GS_DEVICE
  91.     (first device in build list)
  92.  
  93. To select the density on a printer, use
  94.     gs -sDEVICE=<device> -r<xres>x<yres>
  95. For example, you can get the lowest-density (fastest) Epson mode with
  96.     gs -sDEVICE=epson -r60x60
  97. the highest-density 9-pin mode with
  98.     gs -sDEVICE=epson -r240x60
  99. and the highest-density 24-pin mode with
  100.     gs -sDEVICE=epson -r360x180
  101.  
  102. If you select a printer as the output device, Ghostscript also allows you
  103. to control where the device sends its output.  Normally, output goes
  104. directly to the printer (PRN) on MS-DOS systems, and to a scratch file on
  105. Unix or VMS systems.  To send the output to a series of files foo1.xyz,
  106. foo2.xyz, ..., use the switch
  107.     -sOUTPUTFILE=foo%d.xyz
  108. The %d is a printf format specification; you can use other formats like
  109. %02d.  Each file will receive one page of output.  Alternatively, to send
  110. the output to a single file foo.xyz, with all the pages concatenated, use
  111. the switch
  112.     -sOUTPUTFILE=foo.xyz
  113.  
  114. On Unix systems, you can send the output directly to a pipe.  To pipe the
  115. output to the command printit, use the switch
  116.     -sOUTPUTFILE=\|printit
  117.  
  118. To find out what devices are available, type
  119.     devicenames ==
  120.  
  121. File searching
  122. --------------
  123.  
  124. When looking for the initialization files (gs_*.ps), the files related to
  125. fonts, or the file for the 'run' operator, Ghostscript first tries opening
  126. the file with the name as given (i.e., using the current working directory
  127. if none is specified).  If this fails, and the file name doesn't specify
  128. an explicit directory or drive (i.e., doesn't begin with '/' on Unix
  129. systems; doesn't contain a ':' or begin with a '/' or '\' on MS-DOS
  130. systems; doesn't contain a ':' or a square bracket on VMS systems),
  131. Ghostscript will try directories in the following order:
  132.  
  133.     - The directory/ies specified by the -I switch(es) in the command
  134.       line (see below), if any;
  135.  
  136.     - The directory/ies specified by the GS_LIB environment variable,
  137.       if any;
  138.  
  139.     - The directory/ies specified by the GS_LIB_DEFAULT macro in the
  140.       Ghostscript makefile, if any.
  141.  
  142. Each of these (GS_LIB_DEFAULT, GS_LIB, and -I parameter) may be either a
  143. single directory, or a list of directories separated by a character
  144. appropriate for the operating system (':' on Unix systems, ';' on VMS
  145. systems, ';' on MS-DOS systems).
  146.  
  147. VMS-specific notes
  148. ------------------
  149.  
  150. On VMS systems, the last character of each "directory" name indicates what
  151. sort of entity the "directory" references.  If the "directory" name ends
  152. with a colon, it is taken as referring to a logical device, e.g.:
  153.         $ DEFINE GHOSTSCRIPT_DEVICE DUA1:[GHOSTSCRIPT_14]
  154.         $ DEFINE GS_LIB GHOSTSCRIPT_DEVICE:
  155. If the "directory" name ends with a closing square bracket, it is taken as
  156. referring to a real directory, e.g.:
  157.         $ DEFINE GS_LIB DUA1:[GHOSTSCRIPT]
  158.  
  159. To run Ghostscript with switches, you must type a command like
  160.  
  161.     $ gs "-dNODISPLAY"
  162.  
  163. because the C run time library will convert the command
  164. parameters/arguments to lowercase unless you enclose them in double quotes
  165. which preserves the case.
  166.  
  167. If you are on an X Windows display (for which gs is built), you can do
  168.  
  169.     $ set display/create/node="domain-name"/transport=tcpip
  170.  
  171. For example,
  172.  
  173.     $ set display/create/node="doof.city.com"/transport=tcpip
  174.  
  175. and then run Ghostscript
  176.  
  177.     $ gs
  178.  
  179. MS-DOS notes
  180. ------------
  181.  
  182. If you are running Ghostscript on a MS-DOS machine with a display
  183. that is not EGA/VGA compatible, you must use the Borland compiler.
  184. You must build Ghostscript with the BGI driver as the default, and
  185. you will need the appropriate .BGI file from the Borland Turbo C
  186. library.  (Ghostscript includes the EGA/VGA driver in the
  187. executable.)
  188.  
  189. If you are using the BGI driver, two additional environment variables
  190. become relevant:
  191.  
  192.     BGIPATH - defines the directory where Ghostscript will look for
  193. the appropriate BGI driver.  If BGIPATH is not defined, Ghostscript will
  194. look in the directory defined as BGIDIR in the makefile.  In either case,
  195. if no driver is found in the designated directory, Ghostscript will look
  196. in the current directory.
  197.  
  198.     BGIUSER - a string of the form nn.dname, where nn is a hexadecimal
  199. number giving a display mode and dname is the name of a file containing a
  200. user-supplied BGI driver.  If BGIUSER is defined and the BGI device is
  201. selected, Ghostscript will supply nn as the display mode and will obtain
  202. the driver from the file named dname.
  203.  
  204. Some applications, such as Microsoft Word, require a prologue in front of
  205. the PostScript files they output.  In the case of Word, this is one of the
  206. *.ini files included with the Word distribution.  Other applications may
  207. require other prologues.  These may be specified on the Ghostscript
  208. command line, e.g.,
  209.     gs prologue.ini myfile.ps
  210.  
  211. X Windows resources
  212. -------------------
  213.  
  214. Ghostscript looks for the following resources under the program name
  215. "Ghostscript":
  216.  
  217.     borderWidth - the border width in pixels
  218.         default = 1
  219.     borderColor - the name of the border color
  220.         default = black
  221.     geometry - the window size and placement, WxH+X+Y
  222.         default = ???
  223.     xResolution - the number of x pixels per inch
  224.         default is computed from WidthOfScreen and WidthMMOfScreen
  225.     yResolution - the number of y pixels per inch
  226.         default is computed from HeightOfScreen and HeightMMOfScreen
  227.  
  228. To set these resources, put them in a file (such as ~/.Xdefaults) in the
  229. following form:
  230.  
  231. Ghostscript*geometry:    612x792-0+0
  232. Ghostscript*xResolution: 72
  233. Ghostscript*yResolution: 72
  234.  
  235. Then load the defaults into the X server:
  236.  
  237. % xrdb -merge ~/.Xdefaults
  238.  
  239. Normal switches
  240. ---------------
  241.  
  242.     -- filename arg1 ...
  243.         Takes the next argument as a file name as usual, but takes
  244.         all remaining arguments (even if they have the syntactic
  245.         form of switches) and defines the name ARGUMENTS in
  246.         userdict (not systemdict) as an array of those strings,
  247.         *before* running the file.  When Ghostscript finishes
  248.         executing the file, it exits back to the shell.
  249.  
  250.     -Dname=token
  251.     -dname=token
  252.         Define a name in systemdict with the given definition.
  253.         The token must be exactly one token (as defined by the
  254.         'token' operator) and must not contain any whitespace.
  255.  
  256.     -Dname
  257.     -dname
  258.         Define a name in systemdict with value=null.
  259.  
  260.     -Sname=string
  261.     -sname=string
  262.         Define a name in systemdict with a given string as value.
  263.         This is different from -d.  For example,
  264.             -dname=35
  265.         is equivalent to the program fragment
  266.             /name 35 def
  267.         whereas
  268.             -sname=35
  269.         is equivalent to
  270.             /name (35) def
  271.  
  272.     -q
  273.         Quiet startup -- suppress normal startup messages,
  274.         and also do the equivalent of -dQUIET.
  275.  
  276.     -gnumber1xnumber2
  277.         Equivalent to -dDEVICEWIDTH=number1 and
  278.         -dDEVICEHEIGHT=number2.  This is for the benefit of
  279.         devices (such as X11 windows and VESA displays) that require
  280.         (or allow) width and height to be specified.
  281.  
  282.     -rnumber1xnumber2
  283.         Equivalent to -dDEVICEXRESOLUTION=number1 and
  284.         -dDEVICEYRESOLUTION=number2.  This is for the benefit of
  285.         devices (such as printers) that support multiple
  286.         X and Y resolutions.
  287.  
  288.     -Idirectories
  289.         Adds the designated list of directories at the head of the
  290.         search path for library files.
  291.  
  292.     -
  293.         This is not really a switch.  It indicates to Ghostscript
  294.         that the standard input is coming from a file or a pipe.
  295.         Ghostscript reads from stdin until reaching end-of-file,
  296.         executing it like any other file, and then continues
  297.         processing the command line.  At the end of the command
  298.         line, Ghostscript exits rather than going into its
  299.         interactive mode.
  300.  
  301. Note that gs_init.ps makes systemdict read-only, so the values of names
  302. defined with -D/d/S/s cannot be changed (although, of course, they can be
  303. superseded by definitions in userdict or other dictionaries.)
  304.  
  305. Special names
  306. -------------
  307.  
  308. -dASCIIOUT
  309.     disables Ghostscript's normal behavior; instead, writes strings to
  310. stdout that would have been displayed or printed.  For more information,
  311. see the file gs_2asc.ps.
  312.  
  313. -dDISKFONTS
  314.     causes individual character outlines to be loaded from the disk
  315. the first time they are encountered.  (Normally Ghostscript loads all the
  316. character outlines when it loads a font.)  This may allow loading more
  317. fonts into RAM, at the expense of slower rendering.
  318.  
  319. -dNOBIND
  320.     disables the 'bind' operator.  Only useful for debugging.
  321.  
  322. -dNOCACHE
  323.     disables character caching.  Only useful for debugging.
  324.  
  325. -dNODISPLAY
  326.     suppresses the normal initialization of the output device.  This
  327. may be useful when debugging.
  328.  
  329. -dNOPAUSE
  330.     disables the prompt and pause at the end of each page.  This may
  331. be desirable for applications where another program is 'driving'
  332. Ghostscript.
  333.  
  334. -dWRITESYSTEMDICT
  335.     leaves systemdict writable.  This is necessary when running
  336. special utility programs such as font2c and pcharstr, which must bypass
  337. normal PostScript access protection.
  338.  
  339. -sDEVICE=device
  340.     selects an alternate initial output device, as described above.
  341.  
  342. -sOUTPUTFILE=filename
  343.     selects an alternate output file (or pipe) for the initial output
  344. device, as described above.
  345.  
  346. Debugging switches
  347. ------------------
  348.  
  349. The -Z switch only applies if the interpreter was built for a
  350. debugging configuration (DEBUG=1 or -DDEBUG selected at compile
  351. time).
  352.  
  353.     -A    Turn on allocator debugging (gs_malloc and gs_free).
  354.  
  355.     -e    Turn on tracing of error returns from operators.
  356.  
  357.     -E    Abort when any operator returns with an error.
  358.  
  359.     -Mn    Force the interpreter's allocator to acquire additional
  360.         memory in units of nK, rather than the default (currently
  361.         20K on MS-DOS systems, 50K on Unix).  n is a positive
  362.         decimal integer (not exceeding 63 on MS-DOS systems).
  363.  
  364.     -Zxxx    Turn on debugging printout.
  365.         Each of the xxx characters selects an option:
  366.         if the string is empty, all options are selected.
  367.         Case is significant.
  368.             0 = type 1 path tracer (type1imagepath)
  369.             1 = type 1 font interpreter (type1addpath)
  370.             2 = curve subdivider
  371.             a = allocator (large blocks only)
  372.               A = allocator (all calls)
  373.             b = bitmap image processor
  374.               B = bitmap images, detail
  375.             c = color/halftone mapper
  376.             d = dictionary put/undef
  377.             f = fill algorithm (summary)
  378.               F = fill algorithm (detail)
  379.             h = halftone renderer
  380.             i = interpreter, just names
  381.               I = interpreter, everything
  382.             k = character cache
  383.               K = character cache, every access
  384.             l = command lists, bands
  385.               L = command lists, everything
  386.             m = makefont and font cache
  387.             n = name lookup (new names only)
  388.             o = outliner (stroke)
  389.             p = path tracer
  390.             q = clipping
  391.             r = arc renderer
  392.             s = scanner
  393.             t = tiling algorithm
  394.             u = undo saver (for save/restore)
  395.               U = undo saver, more detail
  396.             v = rectangle fill
  397.               V = device-level output
  398.             w = LZW encoder/decoder
  399.             x = transformations
  400.