CERN Accelerating science

This website is no longer maintained. Its content may be obsolete. Please visit http://home.cern/ for current CERN information.



next up previous
Next: xpick---Pick images on Up: PostScript tools Previous: psselect---select pages from

pstops---shuffle pages in a PostScript file

pstops  [ -q ] [ -b ] [ -w\Larg{width} ] 
        [ -h\Larg{height} ] [ -p\Larg{paper} ]
        [ -d\Larg{lwidth} ] pagespecs
        [ infile [ outfile ] ]

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

The parameter pagespecs allow you to specify which pages are to be treated. The following syntax has to be used:

pagespecs = [modulo:]specs

specs = spec[+specs][,specs]

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

modulo
The number of pages in each block; must be >0 (default is 1).
specs
The page specifications for the pages in each block. The value of pageno in each spec should be (first page in block) and modulo-1 (last page in block). The optional dimensions xoff and yoff shift the page by the specified amount. These dimensions are by default given in PostScript points, but may also be specified in cm or in by following them with the string cm, or in, respectively. Alternatively, you can specify the flag w or h, meaning that you are using multiples of the width or height. The optional parameters L, R, and U rotate the page left, right, or upside-down. The optional parameter scale will scale the page by the specified fraction. If the optional minus sign is specified, the page is relative to the end of the document, instead of the start.

If page specs are separated by + the pages will be merged into one page; if they are separated by a space, they will be on separate pages. If there is only one page specification, with pageno=0, then pageno may be omitted.

The shift, rotation, and scaling are performed in that order regardless of which order they appear on the command line.

Overview of the options

-b
Prevents bind operators in the PostScript prolog from binding. This may be needed in cases where complex multi-page re-arrangements are being made.
-d
Draws a line around the border of each page, of the specified width. If the lwidth parameter is omitted, a default linewidth of 1 pt is assumed. The linewidth is relative to the original page dimensions, i.e. it is scaled up or down with the rest of the page.
-h
The height used by the h dimension specifier.
-p
Alternative to set the paper size to a3, a4, a5, b5, letter, legal, tabloid, statement, executive, folio, quarto or 10x14 (default paper size is a4).
-q
Suppress printing the page numbers of the pages being rearranged (default all page numbers are printed).
-w
The width used by the w dimension specifier.
The h and w dimensions are used (after scaling) to set the clipping path for each page.

Examples

If you want 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).

pstops '4:0@.5(0,14.5cm)+1@.5(10.5cm,14.5cm)'\
'+2@.5(0,0.5)+3@.5(10.5cm,0.5)'

This will print on one A4 page four A4 pages reduced by a factor of two.



next up previous
Next: xpick---Pick images on Up: PostScript tools Previous: psselect---select pages from



Janne Saarela
Tue May 16 13:43:26 METDST 1995