PSTOPS(1)

NAME
pstops - shuffle pages in a PostScript file

SYNOPSIS
pstops [-q] [-b] [-wwidth -hheight|-ppaper] [-Wwidth -Hheight|-Ppaper] [-d[lwidth]] [-o] [-e] [-r] [-Rpages] [-ssignature] pagespecs [infile [outfile]]

DESCRIPTION
Pstops rearranges pages from a PostScript document, creating a new PostScript file. The input PostScript file should follow the Adobe Document Structuring Conventions. Pstops can be used to perform arbitrary re-arrangements of documents, including arranging for printing 2-up, 4-up, booklets, reversing, selecting front or back sides of documents, scaling, etc.

pagespecs follow the syntax:

    pagespecs
        = [modulo:]specs

    specs
        = spec[+specs|,specs]

    spec
        = [-]pageno[L|R|U][H|V][@scale][(xoff,yoff)]

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 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.

The -w option gives the width which is used by the w dimension specifier, and the -h option gives the height which is used by the h dimension specifier. The -p option can be used as an alternative, to set the paper size. See paper(1). The -W option gives the width of the input paper and the -H option gives the height of the output paper. The -P option can be used as an alternative, to set the input paper size. See paper(1). These dimensions, if given are also used (after scaling) to set the clipping path for each page.

The -Rpages option specifies the pages which are to be selected. Pages is a comma separated list of page ranges, each of which 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. If an underscore character ‘_’ is used instead of a page range, 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.

The -e option selects all of the even pages. The -o option selects all of the odd pages. Either may be used in conjunction with -R to select the even or odd pages from a range of pages.

The -r option causes psselect to output the selected pages in reverse order.

The -b option prevents any bind operators in the PostScript prolog from binding. This may be needed for complex multi-page re-arrangements.

The -d option draws a line around the border of each page, of the specified width. If the lwidth parameter is omitted, it defaults to 1pt. The width is relative to the original page dimensions, i.e., it is scaled with the rest of the page.

The -s option gives the number of pages in each signature, which must be either 1 (the default), a multiple of 4, or, to put all pages in a single signature, 0.

Pstops normally prints the page numbers of the pages re-arranged; the -q option suppresses this.

EXAMPLES
To put two pages on one sheet of A4 paper, the pagespec to use is:

"2:0L@.7(21cm,0)+1L@.7(21cm,14.85cm)"

To select all of the odd pages in reverse order, use:

2:-0

To re-arrange pages for printing 2-up booklets, use

"4:-3L@.7(21cm,0)+0L@.7(21cm,14.85cm)"

for the front sides, and

"4:1L@.7(21cm,0)+-2L@.7(21cm,14.85cm)"

for the reverse sides (or join them with a comma for duplex printing).

AUTHOR
Written by Angus J. C. Duggan.

SEE ALSO
psutils(1), paper(1)

TRADEMARKS
PostScript is a trademark of Adobe Systems Incorporated.

BUGS
Pstops does not accept all DSC comments.