1PSTOPS(1)                        User Commands                       PSTOPS(1)
2
3
4

NAME

6       pstops - rearrange pages of a PostScript document
7

SYNOPSIS

9       pstops [OPTION...] [INFILE [OUTFILE]]
10

DESCRIPTION

12       Rearrange pages of a PostScript document.
13
14       The  input PostScript file should follow the Adobe Document Structuring
15       Conventions.
16
17       Pstops can be used to perform arbitrary re-arrangements  of  documents.
18       For many tasks, it is simpler to use the other utilities in the PSUtils
19       suite: see psutils(1).
20
21       -S, --specs=SPECS
22              page specifications (see below)
23
24       -R, --pages=PAGES
25              select the given page ranges
26
27       -e, --even
28              select even-numbered output pages
29
30       -o, --odd
31              select odd-numbered output pages
32
33       -r, --reverse
34              reverse the order of the output pages
35
36       -p, --paper=PAPER
37              output paper name or dimensions (WIDTHxHEIGHT)
38
39       -P, --inpaper=PAPER
40              input paper name or dimensions (WIDTHxHEIGHT)
41
42       -d, --draw[=DIMENSION]
43              draw a line of given width (relative to  original  page)  around
44              each page [argument defaults to 1; default is 0]
45
46       -b, --nobind
47              disable  PostScript  bind operators in prolog; may be needed for
48              complex page rearrangements
49
50       -q, --quiet
51              don't show page numbers being output
52
53       --help display this help and exit
54
55       --version
56              display version information and exit
57
58       PAGES is a comma-separated list of pages and page ranges.
59
60       Each may be a page number, or a page range of the form first-last.   If
61       first  is  omitted,  the first page is assumed, and if last is omitted,
62       the last page is assumed.  The prefix character ‘_’ indicates that  the
63       page number is relative to the end of the document, counting backwards.
64       If just this character with no page number is used, a blank  page  will
65       be  inserted.   Page  numbers  refer  to the pages as they occur in the
66       file, starting at one.  The actual page number in the document  may  be
67       different.
68
69       PAGESPECS  is  a list of page specifications [default is "0", which se‐
70       lects each page in its normal order].
71
72       Pagespecs have the following syntax:
73
74              pagespecs   = [modulo:]specs
75
76              specs       = spec[+specs|,specs]
77
78              spec        = [-]pageno[turns][@scale][(xoff,yoff)]
79
80              turns       = turn[turns]
81
82              turn        = L|R|U|H|V
83
84       modulo is the number of pages in  each  block.   The  value  of  modulo
85       should be greater than 0; the default value is 1.
86
87       specs  are  the  page  specifications for the pages in each block.  The
88       value of the pageno in each spec should be between  0  (for  the  first
89       page  in  the block) and modulo-1 (for the last page in each block) in‐
90       clusive.  If there is only one page specification, the pageno  (0)  may
91       be omitted.
92
93       The  optional  dimensions xoff and yoff shift the page by the specified
94       amount.  xoff and yoff may either be lengths (see psutils(1))  or  fol‐
95       lowed  by  w  or  h to indicate a multiple of the output paper width or
96       height.
97
98       The optional parameters L, R, U, H, and V rotate the page left,  right,
99       or  upside-down,  and flip (mirror) the page horizontally or vertically
100       respectively.  The optional scale parameter  scales  the  page  by  the
101       fraction  specified.  If the optional minus sign is specified, the page
102       number is relative to the end of the document, instead of the start.
103
104       Pages whose specs are separated by + will be merged into a single page;
105       otherwise, they will remain as separate pages.
106
107       The  shift,  rotation, and scaling are applied to the PostScript trans‐
108       formation matrix in that order, regardless of the order in  which  they
109       appear on the command line.
110
111       Paper  size names are converted to dimensions using paper(1).  The out‐
112       put paper size, if set, is used (after scaling)  to  set  the  clipping
113       path for each page.
114
115   Exit status:
116       0      if OK,
117
118       1      if  arguments  or  options are incorrect, or there is some other
119              problem starting up,
120
121       2      if there is some problem during processing, typically  an  error
122              reading or writing an input or output file.
123

EXAMPLES

125       To put two pages on one sheet of A4 paper, the pagespec to use is:
126
127                         2:0L@.7(21cm,0)+1L@.7(21cm,14.85cm)
128
129       To select all of the odd pages in reverse order, use:
130
131                                        2:-0
132
133       To re-arrange pages for printing 2-up booklets, use
134
135                        4:-3L@.7(21cm,0)+0L@.7(21cm,14.85cm)
136
137       for the front sides, and
138
139                        4:1L@.7(21cm,0)+-2L@.7(21cm,14.85cm)
140
141       for the reverse sides (or join them with a comma for duplex printing).
142

AUTHOR

144       Written by Angus J. C. Duggan and Reuben Thomas.
145

BUGS

147       Pstops does not accept all DSC comments.
148
150       Copyright © Reuben Thomas 2017-2020.  Released under the GPL version 3,
151       or (at your option) any later version.
152

TRADEMARKS

154       PostScript is a trademark of Adobe Systems Incorporated.
155

SEE ALSO

157       psutils(1), paper(1)
158
159
160
161pstops 2.05                       April 2021                         PSTOPS(1)
Impressum