⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 use.htm

📁 GhostScript的源代码
💻 HTM
📖 第 1 页 / 共 5 页
字号:
<dd>Execute the given file, even if its name begins with a
"<b><tt>-</tt></b>" or "<b><tt>@</tt></b>".
</dl>

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

<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>

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

<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.

<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>

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

<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>

<h2><a name="Special_names"></a>Special names (with <b><tt>-d</tt></b> and <b><tt>-s</tt></b>)</h2>

<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>-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>-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><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>-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><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>-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>-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>-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>-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="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>-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>-dNOINTERPOLATE</tt></b>
<dd>Turns off image interpolation, improving performance on interpolated
images at the expense of image quality.
</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>-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>-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><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><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><a name="Safer"></a><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 files in any mode other than read-only.
This may be desirable for spoolers or other sensitive environments.
</dl>

<dl>
<dt><b><tt>-dSHORTERRORS</tt></b>
<dd>Makes certain error and information messages more Adobe-compatible.
</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>

<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>-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 DOS or 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>-sOutputFile=</tt></b><em>filename</em>
<dd>Selects an alternate output file (or pipe) for the initial output
device, as described above.
</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>

<hr>

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

<p>
The information here describing the debugging switches is probably
interesting only to developers.  The <b><tt>-Z</tt></b> switch applies 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>&nbsp;&nbsp;
	<th align=left>Equivalent
	<td>&nbsp;&nbsp;
	<th>&nbsp;
<tr>	<td colspan=5><hr>
<tr>	<td valign=top><b><tt>-A</tt></b>
	<td>&nbsp;
	<td valign=top><b><tt>-Z@</tt></b>
	<td>&nbsp;
	<td>Fill empty storage with a distinctive bit pattern for debugging

<tr>	<td valign=top><b><tt>-A-</tt></b>
	<td>&nbsp;
	<td valign=top><b><tt>-Z-@</tt></b>
	<td>&nbsp;
	<td>Turn off <b><tt>-A</tt></b>
<tr>	<td valign=top><b><tt>-B</tt></b><em>size</em>
	<td>&nbsp;
	<td>&nbsp;
	<td>&nbsp;
	<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>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -