ps2book - Format a PostScript file as booklet using psbook and pstops


ps2book [-bhnqtvcx] [-P|-d printer] [-f ff] [-F ff] [-p paper] [-m paper] [-s sig] [-o outfile] file1 [file2 [..]]


ps2book reads one or several (plain or gzipped) PostScript files and rearranges the pages into a booklet. It is essentially a nontrivial wrapper around the two utilities psbook(1) and pstops(1) by Angus Duggan.

If no file is given, ps2book acts as a filter on stdin and writes the result to (or sends it to the printer if this was specified).

By default, a PostScript duplex `cookie' is inserted into the file, so it will print in duplex mode on PostScript printers which are capable of doing so.

Even if input files are gzipped, the output is always uncompressed.


-h, --help

Show usage overview

-b, --brief

Show only a one-line message for each processed file

-q, --quiet

Don't show output from psbook and pstops

-o file, --output=file

Write output to file (allows for only one input file). The default output file name is the original one with `_book' spliced in before the suffix. Thus, without the `-o' option, would become

-P printer, -d printer

Send output to printer. Like with a2ps, specifying the printer display starts up gv/ghostview to preview the result.

-p paper, --pagesize=<paper>

Use paper as input page size of the Postscript file(s). Supported values are `a4', `letter' and `letter-bk' (letter booklet format -- the format that when rotated and scaled by 0.707 will exactly fit on half a letter page).

-m paper, --medium=<paper>

Use paper as output paper size. Supported values are `a4' and `letter'.

-s sig, --signature=sig

Set signature size to sig, which must be a multiple of 4. See psbook(1) for details.

-2, --2up

Don't print signatures but just 2 pages in 2up format. Useful if your document has only two pages, or if you don't have a duplex printer, but still want to use options like `-F'.

-t, --tumble

Tumble page (asks printer to do it). You won't see an effect with ghostscript.

-T, --force-tumble

Tumble page without relying on the printer. You will see the effect with ghostscript.

-f ff, --fillfactor=ff

Set (linear) fill factor to ff. The fill factor defines the size of the bounding box relative to the medium size (see section PAPER SIZE).

If x and y dimensions lead to different magnification factors, the smaller one is chosen. Thus, with a fill factor of 1.0, the bounding box will fill the whole page in at least one direction.

Requires the document to have a %%BoundingBox: or at least a %%PageBoundingBox: for the first page.

-F ff, --bbfillfact=ff

Like -f, but determines the bounding box using ghostscript's bbox device. Currently uses pages 2-5 for determining the bounding box, but this will become switchable.

-n --nocookie

Do not insert the PostScript duplex `cookie'. Make sure to print the file in a duplex queue if you use this option.

-c --clip

Apply page clipping (uses pstops's default clipping box).

-x --noclip

Avoid clipping of pages (use huge clipping box). Useful if you create a centerfold page as an overwide page followed by an empty one.

This is also needed with some paper sizes, so it is now the default setting and this option will disappear in the future.


Don't use ghostscript's -dSAFER option. This option should be avoided, but it is sometimes necessary to keep EPS ghostscript 7.07.1 from choking with `ps2book -F ff'.

-v, --version

Show version number.


The page size of the input file is determined in the following order

  1. Command line option -p/--pagesize;
  2. try to extract from the PostScript file (%%DocumentMedia: [a2ps] or %%BeginPaperSize [dvips]);
  3. use the medium size.

The paper or medium size for printing is determined in the following order:

  1. Command line option -m/--medium;
  2. environment variable PAPERCONF;
  3. the file specified by environment variable PAPERSIZE;
  4. the file /etc/papersize;
  5. the environment variable LC_PAPER;
  6. choose `a4' as default.



Set the default printer to use; will be overwritten by the -P option. If neither PS2BOOK_PRINTER nor the -P option are set, output is to a file.

As with -P, the virtual printer display previews the output via gv/ghostview.


Options to be prepended to the command-line options. E.g.

  export PS2BOOK_OPTIONS='-T -F0.97'
  # (or setenv PS2BOOK_OPTIONS '-T -F0.97')

You can also use this variable instead of PS2BOOK_PRINTER for specifying a printer.

Will not work with embedded whitespace in options, i.e. PS2BOOK_OPTIONS='--output=``my''' will fail, how ever much you try to quote the space.


See Section PAPER SIZE.



See Section PAPER SIZE.


Wolfgang Dobler <Wolfgang [.] Dobler [at]>


pstops(1), psbook(1)


ps2book reads in the whole file (plus the uncompressed version, if the file is gzipped) and may use a lot of memory. Bad if your printer has more memory than your computer.


There can be no bugs in this program. By definition. Any problems are due to bad usage.

Please report any such cases of bad usage and I will try to fix them.