PSTOPS(1)

πŸ“¦ version 2026.0, in alpine 3.24

πŸ¦‹ NAME πŸ¦‹

pstops β€” shuffle pages in a PostScript file πŸ’«

and yes bestie, this is the section 1 page, the General Commands Manual one β€” you're in the right place 🫢


✨ SYNOPSIS ✨

pstops [-q] [-b] [-wwidth] [-hheight] [-ppaper] [-d[lwidth]] pagespecs
[infile [outfile]]

🌸 DESCRIPTION 🌸

okay so pstops rearranges pages from a PostScript document and makes you a whole new PostScript file out of them. it's giving page glow-up, no cap. the input PostScript file should follow the Adobe Document Structuring Conventions β€” that part is not optional, bestie 😭

and the range?? pstops can do a large number of arbitrary re-arrangements of documents, including arranging for printing 2-up, 4-up, booklets, reversing, selecting the front or back sides of documents, scaling, etc. literally the whole vibe πŸ’…

pagespecs follow the syntax:

pagespecs   = [modulo:]specs

specs       = spec[+specs|,specs]

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

let's break that down, because it's a lot but it slaps:

  • modulo is the number of pages in each block. the value of modulo should be greater than 0, and 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.
  • the optional dimensions xoff and yoff shift the page by the specified amount. xoff and yoff are in PostScript's points, but may be followed by the units cm or in to convert to centimetres or inches, or the flag w or h to specify as a multiple of the width or height. πŸŽ€
  • the optional parameters L, R, R, R, and V rotate the page left, right, or upside-down, and flip (mirror) page horizontally or vertically.
  • the optional scale parameter scales the page by the fraction specified.
  • if the optional minus sign is specified, the page is relative to the end of the document, instead of the start. plot twist energy πŸ”₯

if page specs are separated by + the pages will be merged into one page; if they are separated by , they will be on separate pages. and if there is only one page specification, with pageno zero, the pageno may be omitted 🫢

the shift, rotation, and scaling are applied to the PostScript transformation matrix in that order regardless of which order they appear on the command line β€” the matrix accumulates the individual transformations. the effect on the image is to first scale with respect to an origin at the lower left corner, then rotate about the same origin, and finally shift. iconic behaviour, honestly ✨

now the flags, bestie:

  • -w width β€” gives the width which is used by the w dimension specifier.
  • -h height β€” gives the height which is used by the h dimension specifier. these dimensions are also used (after scaling) to set the clipping path for each page.
  • -p paper β€” can be used as an alternative, to set the paper size. see paper(1). πŸ’œ
  • -b β€” prevents any bind operators in the PostScript prolog from binding. this may be needed in cases where complex multi-page re-arrangements are being done.
  • -d[lwidth] β€” draws a line around the border of each page, of the specified width. if the lwidth parameter is omitted, a default linewidth of 1 point 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.
  • -q β€” pstops normally prints the page numbers of the pages re-arranged; the -q option suppresses this. πŸ™ˆ

🌈 EXAMPLES 🌈

this section contains some sample re-arrangements, and honestly they're all main character moments. 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. periodt. πŸ’–


πŸ¦‹ SEE ALSO πŸ¦‹


πŸŽ€ TRADEMARKS πŸŽ€

PostScript is a trademark of Adobe Systems Incorporated.


πŸ’€ BUGS πŸ’€

Pstops does not accept all DSC comments. it's not perfect, it's just iconic, okay?? 😭


okay that's the whole page, bestie β€” go forth and shuffle those pages πŸ’…

and that's a wrap on PSTOPS(1) from the PSUtils crew 🌸 πŸ¦‹ ✨

πŸ“¦ where this page comes from