This file is indexed.

/usr/share/doc/ghostscript-doc/Ps2ps2.htm is in ghostscript-doc 9.18~dfsg~0-0ubuntu2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=us-ascii">
<title>ps2ps2: Converts Postscript Level 3 or PDF into Postscript Level 2</title>
<link rel="stylesheet" type="text/css" href="gs.css" title="Ghostscript Style">
</head>

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

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

<h1><tt>ps2ps2</tt>: Converts Postscript Level 3 or PDF into Postscript Level 2</h1>

<!-- [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="#Options">Options</a>
<li><a href="#printer_control">Controlling device-specific behavior</a>
<li><a href="#Limitations">Limitations</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] ================================================== -->

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

<code>ps2ps2</code> is a script for converting a PDF or Language Level 3 PostScript into
Postscript Language Level 2.

<p>
<code>ps2ps2</code> is implemented as a very small command script (batch
file) that invokes Ghostscript, selecting a special "output device" called
<code>ps2write</code>.  In order to use <code>ps2ps2</code>, the
<code>ps2write</code> device must be included in the makefile when
Ghostscript was compiled; see the <a
href="Make.htm#Features_and_devices">documentation on building
Ghostscript</a> for details: this is currently the case on all platforms, in
Ghostscript as we distribute it.

<hr>

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

<p>
The usage for <code>ps2ps2</code> is

<blockquote><code>
ps2ps2</code> <em>[options] input.{ps|eps|pdf} output.ps</em>
</blockquote>



<h2><a name="Options"></a>Options</h2>

<p>
The <em>options</em> given on the command line may include any switches 
valid for use with Ghostscript's PostScript and PDF interpreter (see 
<a href="Use.htm#Switches">here</a> for a complete list).

<p>
Some input features (eg PDF transparency) cannot be reproduced in level 2
PostScript, and in these case the <code>ps2write</code> device will render
the affected area (or page) to a bitmap image. In this case the <a  href="Use.htm#Output_resolution">Output resolution</a>
affcts the size and quality of the rendered image, therefore we strongly recommend setting this value appropriately for the
target printer or other output device.

<p>
<em>
<b>Important :</b>
If PostScript level 2 can't handle a particular font type,
ps2write converts the fonts into a bitmap fonts representation,
using the resolution specified when ps2write is invoked.
In particular this can happen with CID fonts, which are not Postscript Level 2 objects.
In general these are converted to multiple instances of other font types)
</em>

<p>
More importantly, <em>options</em> passed to ps2ps2 may include
<code>-d</code><em>parameter</em>=<em>value</em> or
<code>-s</code><em>parameter</em>=<em>string</em> switches for setting
"distiller parameters", Adobe's documented parameters for controlling the
conversion process.  The PostScript <code>setdistillerparams</code> and
<code>currentdistillerparams</code> operators are also recognized when
running <code>ps2ps2</code>, and provide an equivalent way to set these
parameters from within the PostScript input file.

<p>
The <code>ps2write</code> device handles the same set of distiller 
parameters as
are handled by the <code>pdfwrite</code> device (and 2 unique extensions, see below). See the
<a href="Ps2pdf.htm#Options">PostScript-to-PDF converter</a> 
documentation for a complete description of how to use them to
control the document conversion.

<p>
The following options may be important for <code>ps2ps2</code> due to the target interpreter features:
<dl>
<dt><code>-dPatternImagemask=</code><em>boolean</em>,
<dt><code>-dMaxClipPathSize=</code><em>integer</em>,
<dt><code>-dMaxShadingBitmapSize=</code><em>integer</em>,
<dt><code>-dHaveTrueTypes=</code><em>boolean</em>.
</dl>
See <a href="Ps2pdf.htm#Options">PostScript-to-PDF converter</a> for details.

The option <code>-dMaxInlineImageSize=</code><em>integer</em>
must not be used with <code>ps2ps2</code>.


<p>
This set includes all of the Acrobat Distiller 5 parameters
defined in the DistillerParameters document included in the 
<a href="http://partners.adobe.com/public/developer/acrobat/sdk/index.html">Acrobat SDK</a>.

Default values are same as the <code>printer</code> settings defined 
in <a href="Ps2pdf.htm#Options">PostScript-to-PDF converter</a>,
with these exceptions:

<dl>
<dt><code>/PreserveHalftoneInfo</code> <em>true</em>,
<dt><code>/TransferFunctionInfo</code> <em>/Preserve</em>,
<dt><code>/CompressPages</code> <em>true</em>,
<dt><code>/CompressFonts</code> <em>true</em>,
<dt><code>/ASCII85EncodePages</code> <em>true</em>,
</dl>

<a name="AdditionalDistillerParams"></a>
<p>
There are also two additional (not Adobe-standard) Distiller parameters, specific to ps2write:
<dl>
<dt>
<code>/PSDocOptions</code><em> string</em>
<dd>No default value. If defined, the contents of the string will be emitted in the output PostScript prolog
enclosed within %%BeginSetup and %%EndSetup comments. This is intended as a means of introducing device-specific document wide
setup or configuration options into the output. Default media selection, printer resolution etc might be included here.
</dd>
<code>/PSPageOptions</code><em> array of strings</em>
<dd>No default value. If defined, the contents of the strings in the array will be emitted in the output PostScript at the start
of each page, one string per page, enclosed within %%BeginPageSetup and %%EndPageSetup comments. This is intended as a means of introducing device-specific
setup or configuration options into the output on a page by page basis. The strings are used from the array sequentially, if there are more
pages than strings then we 'wrap round' and start again with the first string. This makes it convenient to do setup for even/odd pages
by simply including 2 strings in the array.
</dt>
</dl>
<p>
NB the strings contained in PSDocOptions, and the PSPageOptions array, are written verbatim to the output. No error checking is (or can be) performed on these strings
and it is the users responsibility to ensure they contain well formed PostScript which does not cause errors on the target device.
</p>
</p>
<p>
There are also the  following ps2write specific options :
<p>

<dl>
<dt>
<code>-dProduceDSC=</code><em>boolean</em>
<dd> Default value is true. When this value is true the output PostScript file will be constructed in a way which is compatible with the Adobe Document Structuring Convention, and will include a set of comments appropriate for use by document managers. This enables features such as page extraction, N-up printing and so on to be performed. When set to false, the output file will not be DSC-compliant. Older versions of Ghostscript cannot produce DSC-compliant output from ps2write, and the behviour for these older versions matches the case when <code>ProduceDSC</code> is false.
</dl>

<dl>
<dt>
<code>-dCompressEntireFile=</code><em>boolean</em>
<dd>When this parameter is true, the <code>LZWEncode</code>
and <code>ASCII85Encode</code> filters will be applied to the entire output file.
In this case <code>CompressPages</code> should be false to prevent a dual compression.
When this parameter is false, these filters will be applied to the initial procset only,
if <code>CompressPages</code> is true.
Default value is <code>false</code>.
</dl>
<p>
Note: It is not possible to set <code>CompressEntireFile</code> when <code>ProduceDSC</code> is true as a single compressed object cannot conform to the DSC. It is possible to set <code>CompressPages</code> which will also compress the ps2write ProcSet.


<h2><a name="printer_control"></a>Controlling device-specific behavior</h2>

<p>
A few options can be used to influence the behavior of a printer or
PostScript interpreter that reads the result of ps2ps2. All of these options
are incompatible with DSC-compliant PostScript, in order to use any of them
<code>ProduceDSC</code> must be set to false.

<dl>
<dt><code>-dRotatePages=</code><em>boolean</em>. 
<dd>The printer will rotate pages 
for a better fit with the physical size. Default value : <em>false</em>.
Must be <em>false</em> if <code>-dSetPageSize=true</code>.

<dt><code>-dFitPages=</code><em>boolean</em>. 
<dd>The printer will scale pages down
to better fit the physical page size. The rendering quality may be poor due to the scaling,
especially for fonts which Ghostscript had converted into bitmaps 
(see the <em>ps2write</em> device parameter <code>HaveTrueTypes</code>;
See <a href="#Options">Options</a> about the <code>PageSize</code> entry of the <code>Policies</code>
dictionary while the conversion step). 
Default value : <em>false</em>.
Must be <em>false</em> if <code>-dSetPageSize=true</code> or <code>-dCenterPages=true</code>.

<dt><code>-dCenterPages=</code><em>boolean</em>. 
<dd>The printer will center the page image on the selected media. Compatible with <code>-dRotatePages=true</code>, which may rotate the image on the media if it fits better, and then center it. 
Default value : <em>false</em>.
Must be <em>false</em> if <code>-dSetPageSize=true</code> or <code>-dFitPages=true</code>.

<dt><code>-dSetPageSize=</code><em>boolean</em>. 
<dd>The printer will try to set page size from the job. 
Only use with printers which can handle random <em>PageSize</em>.
Defaults to <em>true</em>, must be <em>false</em> if <code>-dRotatePages=true</code>, <code>-dCenterPages=true</code> or <code>-dFitPages=true</code>.

<dt><code>-dDoNumCopies=</code><em>boolean</em>.
<dd>The PostScript emitted by ps2write will try to use copypage to create the number of copies originally requested. Note that this relies on the level 2 semantics for copypage
and will not reliably work on language level 3 devices (such as Ghostscript itself).
Defaults to false. This flag is not compatible with the ProduceDSC flag which will take precedence if set.

</dl>

<p>
These correspond to keys in the Postscript <em>userdict</em> 
of the target printer's virtual memory to control its behavior while 
executing a job generated with <code>ps2ps2</code>.

<p>
These keys can be set when executing ps2ps2 (or using the ps2write device), 
this 'fixes' the resulting behaviour according to which key has been set. 
If these keys are not defined during conversion, the resulting PostScript 
will not attempt any form of media selection. 

In this case the behaviour can then be modified by setting the keys, either by modifying the resulting 
PostScript or setting the values in some other manner on the target device.

<p>
See also the distiller params PSDocOptions and PSPageOptions mentioned <a href="Ps2ps2.htm#DistillerParams">above.</p>
<hr>


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

<p>
<code>ps2ps2</code> provides a simplified interface to the Ghostscript
command line. It is not possible to use <code>-c</code> option or pass
multiple source files. For unrestricted access to the command line
parameters, use Ghostscript directly. E.g. :

<blockquote><code>
gs -q -dSAFER -dNOPAUSE -dBATCH -sOutputFile=file.ps </code><em>[more options]</em><code> \<br>
&nbsp;&nbsp;-sDEVICE=ps2write </code><em>source1.pdf [more files]</em>
</blockquote>

<hr>


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

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

<p>
<small>Copyright &copy; 2000-2006 Artifex Software, Inc.  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 that
license.  Refer to licensing information at http://www.artifex.com/
or contact Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134,
San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.

<p>
<small>Ghostscript version 9.18, 5 October 2015

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

</body>
</html>