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
|
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.1.
.TH PSTOPS "1" "February 2023" "pstops 2.10" "User Commands"
.SH NAME
pstops - rearrange pages of a PostScript document
.SH SYNOPSIS
.B pstops
[\fI\,OPTION\/\fR...] [\fI\,INFILE \/\fR[\fI\,OUTFILE\/\fR]]
.SH DESCRIPTION
Rearrange pages of a PostScript document.
.PP
The input PostScript file should follow the Adobe Document Structuring
Conventions.
.PP
.I Pstops
can be used to perform arbitrary re-arrangements of documents. For many tasks,
it is simpler to use the other utilities in the PSUtils suite: see
.BR psutils (1).
.TP
\fB\-S\fR, \fB\-\-specs\fR=\fI\,SPECS\/\fR
page specifications (see below)
.TP
\fB\-R\fR, \fB\-\-pages\fR=\fI\,PAGES\/\fR
select the given page ranges
.TP
\fB\-e\fR, \fB\-\-even\fR
select even\-numbered output pages
.TP
\fB\-o\fR, \fB\-\-odd\fR
select odd\-numbered output pages
.TP
\fB\-r\fR, \fB\-\-reverse\fR
reverse the order of the output pages
.TP
\fB\-p\fR, \fB\-\-paper\fR=\fI\,PAPER\/\fR
output paper name or dimensions (WIDTHxHEIGHT)
.TP
\fB\-P\fR, \fB\-\-inpaper\fR=\fI\,PAPER\/\fR
input paper name or dimensions (WIDTHxHEIGHT)
.TP
\fB\-d\fR, \fB\-\-draw\fR[=\fI\,DIMENSION\/\fR]
draw a line of given width (relative to original
page) around each page [argument defaults to 1;
default is 0]
.TP
\fB\-b\fR, \fB\-\-nobind\fR
disable PostScript bind operators in prolog;
may be needed for complex page rearrangements
.TP
\fB\-q\fR, \fB\-\-quiet\fR
don't show page numbers being output
.TP
\fB\-\-help\fR
display this help and exit
.TP
\fB\-v\fR, \fB\-\-version\fR
display version information and exit
.PP
PAGES is a comma\-separated list of pages and page ranges.
.PP
Each may be a page number, or a page range of the form
.IB first \- last .
If
.I first
is omitted, the first page is assumed, and if
.I last
is omitted, the last page is assumed.
The prefix character \[oq]_\[cq] indicates that the page number is relative to the end
of the document, counting backwards.
If just this character with no page number is used, a blank page will be
inserted.
Page numbers refer to the pages as they occur in the file, starting
at one.
The actual page number in the document may be different.
.PP
SPECS is a list of page specifications [default is "0", which selects
each page in its normal order].
.PP
Pagespecs have the following syntax:
.RS
.TP 12
.I pagespecs
=
.RI [ modulo\fB:\fP ] specs
.TP
.I specs
=
.IR spec [ \fB+\fPspecs | \fB,\fPspecs ]
.TP
.I spec
=
.RB [ - ] \fIpageno\fP [\fIturns\fP][ @\fIscale\fP ][ ( \fIxoff\fP , \fIyoff\fP ) ]
.TP
.I turns
=
.IR turn [ turns ]
.TP
.I turn
=
.BR L | R | U | H | V
.RE
.sp
.I modulo
is the number of pages in each block.
The value of
.I modulo
should be greater than 0; the default value is 1.
.PP
.I specs
are the page specifications for the pages in each block.
The value of the
.I pageno
in each
.I spec
should be between 0 (for the first page in the block) and \fImodulo\fR\-1
(for the last page in each block) inclusive.
If there is only one page specification,
the \fIpageno\fR (0) may be omitted.
.PP
The optional dimensions
.I xoff
and
.I yoff
shift the page by the specified amount.
.I xoff
and
.I yoff
may either be lengths (see
.BR psutils (1))
or followed by
.B "w"
or
.B "h"
to indicate a multiple of the output paper width or height.
.PP
The optional parameters
.BR L ,
.BR R ,
.BR U ,
.BR H ,
and
.B V
rotate the page left, right, or upside-down, and flip (mirror) the page
horizontally or vertically respectively.
The optional
.I scale
parameter scales the page by the fraction specified.
If the optional minus sign is specified, the page number is relative to the end of
the document, instead of the start.
.PP
Pages whose
.IR spec s
are separated by
.B +
will be merged into a single page; otherwise,
they will remain as separate pages.
.PP
The shift, rotation, and scaling are applied
to the PostScript transformation matrix
in that order, regardless of the order
in which they appear on the command line.
.PP
Paper size names are converted to dimensions using
.BR paper (1).
The output paper size, if set, is used (after scaling) to set the
clipping path for each page.
.SS "Exit status:"
.TP
0
if OK,
.TP
1
if arguments or options are incorrect, or there is some other problem
starting up,
.TP
2
if there is some problem during processing, typically an error reading or
writing an input or output file.
.SH EXAMPLES
To put two pages on one sheet of A4 paper, the pagespec to use is:
.sp
.ce
2:0L@.7(21cm,0)+1L@.7(21cm,14.85cm)
.sp
To select all of the odd pages in reverse order, use:
.sp
.ce
2:-0
.sp
To re-arrange pages for printing 2-up booklets, use
.sp
.ce
4:-3L@.7(21cm,0)+0L@.7(21cm,14.85cm)
.sp
for the front sides, and
.sp
.ce
4:1L@.7(21cm,0)+-2L@.7(21cm,14.85cm)
.sp
for the reverse sides (or join them with a comma for duplex printing).
.SH AUTHOR
Written by Angus J. C. Duggan and Reuben Thomas.
.SH BUGS
.B pstops
does not accept all DSC comments.
.SH COPYRIGHT
Copyright \(co Reuben Thomas 2017\-2023.
Released under the GPL version 3, or (at your option) any later version.
.SH TRADEMARKS
.B PostScript
is a trademark of Adobe Systems Incorporated.
.SH "SEE ALSO"
.BR psutils (1),
.BR paper (1)
|