46
46
<h2><a name="Overview"></a>Overview</h2>
48
<b><tt>ps2ps2</tt></b> is a script for converting a PDF or a Postscript Level 3 into
48
<code>ps2ps2</code> is a script for converting a PDF or a Postscript Level 3 into
49
49
Postscript Level 2.
52
<b><tt>ps2ps2</tt></b> is implemented as a very small command script (batch
52
<code>ps2ps2</code> is implemented as a very small command script (batch
53
53
file) that invokes Ghostscript, selecting a special "output device" called
54
<b><tt>ps2write</tt></b>. In order to use <b><tt>ps2ps2</tt></b>, the
55
<b><tt>ps2write</tt></b> device must be included in the makefile when
54
<code>ps2write</code>. In order to use <b><tt>ps2ps2</tt></b>, the
55
<code>ps2write</code> device must be included in the makefile when
56
56
Ghostscript was compiled; see the <a
57
57
href="Make.htm#Features_and_devices">documentation on building
58
58
Ghostscript</a> for details: this is currently the case on all platforms, in
79
79
<a href="Use.htm#Switches">here</a> for a complete list).
82
Since <b><tt>ps2write</tt></b> makes use of some printer
82
Since <code>ps2write</code> makes use of some printer
83
83
parameters while converting high level objects into Level 2 objects,
84
84
we strongly recommend to set those values in accordance with the
85
85
target printer or other output device.
86
86
In particular, it is important for
87
87
<a href="Use.htm#Output_resolution">Output resolution</a>,
88
<a href="Use.htm#FIXEDMEDIA"><b><tt>-dFIXEDMEDIA</tt></b></a>, and
89
<b><tt>ProcessColorModel</tt></b></a> to be set correctly.
88
<a href="Use.htm#FIXEDMEDIA"><code>-dFIXEDMEDIA</code></a>, and
89
<code>ProcessColorModel</code> to be set correctly.
95
95
ps2write converts such fonts into bitmap fonts,
96
96
using the resolution specified when ps2write is invoked.
97
97
Particularly this always happen with CID fonts, which are not Postscript Level 2 objects.
98
Therefore the page device parameter <b><tt>PageSize</tt></b>
98
Therefore the page device parameter <code>PageSize</code>
99
99
must match the target printer, and we recommend to set
100
the <b><tt>PageSize</tt></b> entry of the <b><tt>Policies</tt></b>
100
the <code>PageSize</code> entry of the <b><tt>Policies</tt></b>
101
101
dictionary to 3, in order to provide a proper page scaling
102
102
in the Postscript interpreter while ps2write is invoked.
106
106
More importantly, <em>options</em> passed to ps2ps2 may include
107
<b><tt>-d</tt></b><em>parameter</em>=<em>value</em> or
108
<b><tt>-s</tt></b><em>parameter</em>=<em>string</em> switches for setting
107
<code>-d</code><em>parameter</em>=<em>value</em> or
108
<code>-s</code><em>parameter</em>=<em>string</em> switches for setting
109
109
"distiller parameters", Adobe's documented parameters for controlling the
110
conversion process. The PostScript <b><tt>setdistillerparams</tt></b> and
111
<b><tt>currentdistillerparams</tt></b> operators are also recognized when
112
running <b><tt>ps2ps2</tt></b>, and provide an equivalent way to set these
110
conversion process. The PostScript <code>setdistillerparams</code> and
111
<code>currentdistillerparams</code> operators are also recognized when
112
running <code>ps2ps2</code>, and provide an equivalent way to set these
113
113
parameters from within the PostScript input file.
116
The <b><tt>ps2write</tt></b> device handles the same set of distiller
116
The <code>ps2write</code> device handles the same set of distiller
118
are handled by the <b><tt>pdfwrite</tt></b> device. See the
118
are handled by the <code>pdfwrite</code> device. See the
119
119
<a href="Ps2pdf.htm#Options">PostScript-to-PDF converter</a>
120
120
documentation for a complete description of how to use them to
121
121
control the document conversion.
124
The following options may be important for <b><tt>ps2ps2</tt></b> due to the target printer features:
124
The following options may be important for <code>ps2ps2</code> due to the target printer features:
126
<dt><b><tt>-dPatternImagemask=</tt></b><em>boolean</em>,
127
<dt><b><tt>-dMaxClipPathSize=</tt></b><em>integer</em>,
128
<dt><b><tt>-dMaxShadingBitmapSize=</tt></b><em>integer</em>,
129
<dt><b><tt>-dHaveTrueTypes=</tt></b><em>boolean</em>.
126
<dt><code>-dPatternImagemask=</code><em>boolean</em>,
127
<dt><code>-dMaxClipPathSize=</code><em>integer</em>,
128
<dt><code>-dMaxShadingBitmapSize=</code><em>integer</em>,
129
<dt><code>-dHaveTrueTypes=</code><em>boolean</em>.
131
131
See <a href="Ps2pdf.htm#Options">PostScript-to-PDF converter</a> for details.
133
The option <b><tt>-dMaxInlineImageSize=</tt></b><em>integer</em>
134
Must not be used with <tt><b>ps2ps2</tt></b>.
133
The option <code>-dMaxInlineImageSize=</code><em>integer</em>
134
Must not be used with <code>ps2ps2</code>.
139
139
defined in the DistillerParameters document included in the
140
140
<a href="http://partners.adobe.com/public/developer/acrobat/sdk/index.html">Acrobat SDK</a>.
142
Default values are same as the <tt><b>printer</tt></b> settings defined
142
Default values are same as the <code>printer</code> settings defined
143
143
in <a href="Ps2pdf.htm#Options">PostScript-to-PDF converter</a>,
144
144
with these exceptions:
147
<dt><b><tt>/PreserveHalftoneInfo</tt></b> <em>true</em>,
148
<dt><b><tt>/TransferFunctionInfo</tt></b> <em>/Preserve</em>,
149
<dt><b><tt>/MaxViewerMemorySize</tt></b> <em>8000000</em>,
150
<dt><b><tt>/CompressPages</tt></b> <em>false</em>,
151
<dt><b><tt>/CompressFonts</tt></b> <em>false</em>,
152
<dt><b><tt>/ASCII85EncodePages</tt></b> <em>true</em>,
147
<dt><code>/PreserveHalftoneInfo</code> <em>true</em>,
148
<dt><code>/TransferFunctionInfo</code> <em>/Preserve</em>,
149
<dt><code>/MaxViewerMemorySize</code> <em>8000000</em>,
150
<dt><code>/CompressPages</code> <em>false</em>,
151
<dt><code>/CompressFonts</code> <em>false</em>,
152
<dt><code>/ASCII85EncodePages</code> <em>true</em>,
160
<b><tt>-dCompressEntireFile=</tt></b><em>boolean</em>
161
<dd>When this parameter is true, the <b><tt>LZWEncode</b></tt>
162
and <b><tt>ASCII85Encode</b></tt> filters are being applied to entire output file.
163
In this case <b><tt>CompressPages</b></tt> should be false to exclude a dual compression.
161
<code>-dCompressEntireFile=</code><em>boolean</em>
162
<dd>When this parameter is true, the <code>LZWEncode</code>
163
and <code>ASCII85Encode</code> filters are being applied to entire output file.
164
In this case <code>CompressPages</code> should be false to exclude a dual compression.
164
165
When this parameter is false, those filters applies to the initial procset only,
165
if <b><tt>CompressPages</b></tt> is true.
166
Default value is <b><tt>false</b></tt>.
166
if <code>CompressPages</code> is true.
167
Default value is <code>false</code>.
179
180
program that reads the result of ps2ps2.
182
<dt><b><tt>-dRotatePages=</tt></b><em>boolean</em>.
183
<dt><code>-dRotatePages=</code><em>boolean</em>.
183
184
<dd>The printer will rotate pages
184
185
for a better fitting into the real page size. Default value : <em>false</em>.
185
Must be <em>false</em> if <b><tt>-dSetPageSize=true</tt></b>.
186
Must be <em>false</em> if <code>-dSetPageSize=true</code>.
187
<dt><b><tt>-dFitPages=</tt></b><em>boolean</em>.
188
<dt><code>-dFitPages=</code><em>boolean</em>.
188
189
<dd>The printer will scale pages down
189
190
to fit into the real page size. The rendering quality may be poor due to the scaling,
190
191
especially for fonts which Ghostscript had converted into bitmaps
191
(see the <em>ps2write</em> device parameter <b><tt>HaveTrueTypes</tt></b>;
192
See <a href="#Options">Options</a> about the <b><tt>PageSize</tt></b> entry of the <b><tt>Policies</tt></b>
192
(see the <em>ps2write</em> device parameter <code>HaveTrueTypes</code>;
193
See <a href="#Options">Options</a> about the <code>PageSize</code> entry of the <b><tt>Policies</tt></b>
193
194
dictionary while the conversion step).
194
195
Default value : <em>false</em>.
195
Must be <em>false</em> if <b><tt>-dSetPageSize=true</tt></b>.
196
Must be <em>false</em> if <code>-dSetPageSize=true</code>.
197
<dt><b><tt>-dSetPageSize=</tt></b><em>boolean</em>.
198
<dt><code>-dSetPageSize=</code><em>boolean</em>.
198
199
<dd>The printer will try to set page size from the job.
199
200
Only use with printers which can handle random <em>PageSize</em>.
200
Must be <em>false</em> if <b><tt>-dRotatePages=true</tt></b> or <b><tt>-dFitPages=true</tt></b>.
201
Must be <em>false</em> if <code>-dRotatePages=true</code> or <b><tt>-dFitPages=true</tt></b>.
205
206
These correspond to keys in the Postscript <em>userdict</em>
206
207
of the target printer's virtual memory to control its behavior while
207
executing a job generated with <tt><b>ps2ps2</tt></b>.
208
executing a job generated with <code>ps2ps2</code>.
210
Currently Ghostscript does not provide a method for
211
incorporating these in a print job.
212
Users should refer to the printer's documentation.
211
These keys can be set when executing ps2ps2 (or using the ps2write device),
212
this 'fixes' the resulting behaviour according to which key has been set.
213
If these keys are not defined during conversion, the resulting PostScript
214
will not attempt any form of media selection.
216
In this case the behaviour can then be modified by setting the keys, either by modifying the resulting
217
PostScript or setting the values in some other manner on the target device.
223
228
<a href="#Options">Options</a> while generating a printer job.
226
<b><tt>ps2ps2</tt></b> does not generate DSC comments.
231
<code>ps2ps2</code> does not generate DSC comments.
230
<b><tt>ps2ps2</tt></b> provides simplified interface to Ghostscript
231
command line. It is not possible to use <tt><b>-c</tt></b> option or pass
235
<code>ps2ps2</code> provides simplified interface to Ghostscript
236
command line. It is not possible to use <code>-c</code> option or pass
232
237
multiple source files. For the unrestricted access to the command line
233
238
parameters, use Ghostscript directly.
236
gs -q -dSAFER -dNOPAUSE -dBATCH -sOutputFile=file.ps </tt></b><em>[more options]</em><b><tt> \<br>
237
-sDEVICE=ps2write </b></tt><em>source1.pdf [more files]</em>
241
gs -q -dSAFER -dNOPAUSE -dBATCH -sOutputFile=file.ps </code><em>[more options]</em><code> \<br>
242
-sDEVICE=ps2write </code><em>source1.pdf [more files]</em>