The input PostScript file should follow the Adobe Document Structuring Conventions.
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 psutils(1).
PAGES is a comma-separated list of pages and page ranges.
Each may be a page number, or a page range of the form first-last. If first is omitted, the first page is assumed, and if last is omitted, the last page is assumed. The prefix character '_' 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.
PAGESPECS is a list of page specifications [default is "0", which selects each page in its normal order].
Pagespecs have the following syntax:
modulo is the number of pages in each block. The value of modulo should be greater than 0; the default value is 1.
specs are the page specifications for the pages in each block. The value of the pageno in each spec should be between 0 (for the first page in the block) and modulo-1 (for the last page in each block) inclusive. If there is only one page specification, the pageno (0) may be omitted.
The optional dimensions xoff and yoff shift the page by the specified amount. xoff and yoff may either be lengths (see psutils(1)) or followed by w or h to indicate a multiple of the output paper width or height.
The optional parameters L, R, U, H, and V rotate the page left, right, or upside-down, and flip (mirror) the page horizontally or vertically respectively. The optional 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.
Pages whose specs are separated by + will be merged into a single page; otherwise, they will remain as separate pages.
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.
Paper size names are converted to dimensions using paper(1). The output paper size, if set, is used (after scaling) to set the clipping path for each page.
To select all of the odd pages in reverse order, use:
To re-arrange pages for printing 2-up booklets, use
for the front sides, and
for the reverse sides (or join them with a comma for duplex printing).