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

📄 ps2pdf.htm

📁 GhostScript的源代码
💻 HTM
字号:
<html>
<head>
<title>ps2pdf: PostScript-to-PDF converter</title>
<!-- $Id: Ps2pdf.htm $ -->
<!-- Originally: ps2pdf.txt -->
</head>

<body>
<!-- [1.0 begin visible header] -------------------------------------------- -->

<!-- [1.1 begin headline] -------------------------------------------------- -->

<p><table width="100%" border="0">
<tr><th align="center" bgcolor="#CCCC00"><font size=6>
<b><tt>ps2pdf</tt></b>: PostScript-to-PDF converter
</font>
</table>

<!-- [1.1 end headline] ---------------------------------------------------- -->

<!-- [1.2 begin table of contents] ----------------------------------------- -->

<h2>Table of contents</h2>

<blockquote><ul>
<li><a href="#Overview">Overview</a>
<li><a href="#Usage">Usage</a>
<li><a href="#Limitations">Limitations</a>
<li><a href="#Problems">Known problems</a>
<li><a href="#Benefits">Benefits of using <b><tt>ps2pdf</tt></b></a>
<li><a href="#Acknowledgments">Acknowledgments</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>.

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

<hr>

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

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

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

<b><tt>ps2pdf</tt></b> is a work-alike for the functionality (but not the
user interface) of Adobe's Acrobat Distiller<small><sup>TM</sup></small>
product: it converts PostScript files to Portable Document Format (PDF)
files.

<p>
<b><tt>ps2pdf</tt></b> is implemented as a very small command script (batch
file) that invokes Ghostscript, selecting a special "output device" called
<b><tt>pdfwrite</tt></b>.  In order to use <b><tt>ps2pdf</tt></b>, the
<b><tt>pdfwrite</tt></b> device must be included as a device list when
Ghostscript was built; see the
<a href="Make.htm#Features_and_devices">documentation on building
Ghostscript</a> for details.  The <b><tt>pdfwrite</tt></b> device is
currently included in the makefiles for all platforms.

<hr>

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

<p>
The usage for ps2pdf is

<blockquote><b><tt>
ps2pdf input.ps output.pdf
</tt></b></blockquote>

<p>
or, on Unix systems and some versions of Windows NT and OS/2

<blockquote><b><tt>
ps2pdf input.ps
</tt></b></blockquote>

<p>
which is equivalent to

<blockquote><b><tt>
ps2pdf input.ps input.pdf
</tt></b></blockquote>

<p>
The <b><tt>ps2pdf</tt></b> command script assumes that the Ghostscript
executable is named <b><tt>gs</tt></b>.  On DOS and MS Windows where the
command-line executable has a different name, you must edit the script
<b><tt>ps2pdf.bat</tt></b> if the DOS executable is named
<b><tt>gs386</tt></b>: look for the line that says

<blockquote><b><tt>
set PS2PDFGS=gs
</tt></b></blockquote>

<p>
and change it to

<blockquote><b><tt>
set PS2PDFGS=gs386
</tt></b></blockquote>

<p>
Note that to run <b><tt>ps2pdf</tt></b> on MS Windows, you need the DOS executable: the
Windows Program Manager's "<b><tt>run</tt></b> command doesn't allow you to run <b><tt>.bat</tt></b> files.
Alternatively you can run the "console mode" Windows executable by changing
the line above to

<blockquote><b><tt>
set PS2PDFGS=gswin32c
</tt></b></blockquote>

<hr>

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

<p>
The most serious limitation of <b><tt>ps2pdf</tt></b> is that text in any
font other than the fourteen Adobe base fonts (Courier, Times, and
Helvetica families, Symbol, and Zapf Dingbats) is converted to bitmaps.
<b><tt>ps2pdf</tt></b> also may convert strings to bitmaps if the string is
in one of those base fonts but contains a character that uses a
non-standard encoding.

<p>
<b><tt>ps2pdf</tt></b> implements <b><tt>setdistillerparams</tt></b>, and
recognizes all of the parameters documented in Adobe Technical Note #5151
except for the <b><tt>ImageDict</tt></b> parameters, but only a subset have
an effect:

<blockquote><table cellpadding=0 cellspacing=0>
<tr valign=bottom>
	<th align=left>Parameters
	<td>&nbsp;&nbsp;
	<th align=left>Effective
	<td>&nbsp;&nbsp;&nbsp;&nbsp;
	<th align=left>Ignored
<tr>	<td colspan=5><hr>
<tr valign=top>	<td>General
	<td>&nbsp;
	<td><b><tt>ASCII85EncodePages</tt></b>,
	    <b><tt>CompatibilityLevel</tt></b>,
	    <b><tt>CompressPages</tt></b>, <b><tt>CoreDistVersion</tt></b>,
	    <b><tt>LZWEncodePages</tt></b> (see below),
	    <b><tt>UseFlateCompression</tt></b>
	<td>&nbsp;
	<td><b><tt>AutoRotatePages</tt></b>, <b><tt>ImageMemory</tt></b>,
	    <b><tt>PreserveHalftoneInfo</tt></b>,
	    <b><tt>PreserveOPIComments</tt></b>,
	    <b><tt>PreserveOverprintSettings</tt></b>,
	    <b><tt>TransferFunctionInfo</tt></b>,
	    <b><tt>UCRandBGInfo</tt></b>
<tr>	<td>&nbsp;
<tr valign=top>	<td>General image
	<td>&nbsp;
	<td><b><tt>AutoFilterxxxImages</tt></b> (see below),
	    <b><tt>xxxImageDepth</tt></b>,
	    <b><tt>xxxImageDownsampleType</tt></b>,
	    <b><tt>xxxImageFilter</tt></b>,
	    <b><tt>xxxImageResolution</tt></b>,
	    <b><tt>DownsamplexxxImages</tt></b>,
	    <b><tt>EncodexxxImages</tt></b>, <b><tt>MonoImageDict</tt></b>
	<td>&nbsp;
	<td><b><tt>AntiAliasxxxImages</tt></b>,
	    <b><tt>xxxACSImageDict</tt></b>,
	    <b><tt>ColorImageDict</tt></b>, <b><tt>GrayImageDict</tt></b>
<tr>	<td>&nbsp;
<tr valign=top>	<td>Color image
	<td>&nbsp;
	<td><b><tt>ConvertCMYKImagesToRGB</tt></b>
	<td>&nbsp;
	<td><b><tt>ColorConversionStrategy</tt></b>, <b><tt>ConvertImagesToIndexed</tt></b>
</table></blockquote>

<p>
Because of Unisys's threats regarding the Welch patent,
<b><tt>ps2pdf</tt></b> cannot actually use LZW compression: instead, it
treats all requests for LZW compression as calling for
<b><tt>Flate</tt></b> compression if <b><tt>UseFlateCompression</tt></b> is
true and <b><tt>CompatibilityLevel</tt></b> &gt;= 1.2, and ignores them
otherwise.

<p>
<b><tt>AutoFilterxxxImages</tt></b> doesn't examine the image to decide
between JPEG and <b><tt>LZW/Flate</tt></b> compression: it always uses
<b><tt>LZW/Flate</tt></b> compression.

<hr>

<h1><a name="Problems"></a>Known problems</h1>

<p>
Some PDF files created using <b><tt>ps2pdf</tt></b> work with Adobe Acrobat on
Unix but fail using the MS Windows version of Acrobat.  One error that has been
observed using versions of Acrobat reader for Windows is: "There was an
error processing a page. A rasterizer error occurred."  This error has been
observed using both Acrobat version 2.1 and the Alpha 2 release of Adobe
Amber.  (Adobe may have fixed this problem by now.)

<p>
<b><tt>ps2pdf</tt></b> does not yet process the new PDF 1.2 (Acrobat 3.x)
<b><tt>BP</tt></b>, <b><tt>EP</tt></b>, <b><tt>SP</tt></b>, and
<b><tt>OBJ</tt></b> and related pdfmarks.  If the application uses these
pdfmark commands (and few applications do), some material may be lost from
the output file.

<hr>

<h1><a name="Benefits"></a>Benefits of using <b><tt>ps2pdf</tt></b></h1>

<p>
Despite the limitations of <b><tt>ps2pdf</tt></b>, the class of "suitable"
documents is a large one.  Many users report that the combination of
<b><tt>ps2pdf</tt></b> with Acrobat is superior to using a generic
PostScript viewer (<b><tt>psview</tt></b> or <b><tt>ghostview</tt></b>),
particularly for documents with many pages where the navigational support
in PDF files reduces the overhead involved in navigating conventional
PostScript documents.

<p>
For certain documents, <b><tt>ps2pdf</tt></b> is much faster than Adobe
Distiller, and may be suitable for run-time conversions.  [George White
remarks "I haven't seen a head to head comparison, but Distiller seems
slower when running on what should be a faster system (for instance,
Distiller on a PPC Mac vs a 25 MHz 68040 NeXT running
<b><tt>ps2pdf</tt></b>), so I think this is fair -- also, one of Mark
Doyle's postings indicated that Distiller was not fast enough for use as a
run-time server.  In contrast, I find that I can use <b><tt>ps2pdf</tt></b>
as a post-processor during routine document creation."]

<hr>

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

<p>
Thanks to George N. White III &lt;aa056@chebucto.ns.ca&gt; of the Ocean
Sciences Division of the Bedford Institute of Oceanography in Dartmouth,
Nova Scotia for extensive testing of early versions of
<b><tt>ps2pdf</tt></b>, and for contributing most of this writeup.

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

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

<font size=2>

<p>Copyright &copy; 1996, 1997, 1998 Aladdin Enterprises.  All rights reserved.

<p>This file is part of Aladdin Ghostscript.  See the
<a href="Public.htm">Aladdin Free Public License</a> (the "License") for
full details of the terms of using, copying, modifying, and redistributing
Aladdin Ghostscript.

<p>
Ghostscript version 5.50, 16 September 1998

</font>

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

</body>
</html>

⌨️ 快捷键说明

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