This website is no longer maintained. Its content may be obsolete. Please visit http://home.cern/ for current CERN information.
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)]
>0
(default is 1).
pageno
in each spec should be
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.
bind
operators in the PostScript prolog from binding.
This may be needed in cases where complex multi-page
re-arrangements are being made.
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
dimension specifier.
a3
, a4
, a5
, b5
, letter
, legal
,
tabloid
, statement
, executive
, folio
,
quarto
or 10x14
(default paper size is a4
).
w
dimension specifier.
h
and w
dimensions are used (after scaling) to set the clipping
path for each page.
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:-0To 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.