Command-line tool

The package includes a command-line tool for PDF imposition, pdfimpose.

Usage

To impose a PDF file with a chosen schema, run:

pdfimpose SCHEMA foo.pdf

For example, to impose a PDF file using the saddle schema (like a magazine), run:

pdfimpose saddle foo.pdf

Each schema has different options. Use pdfimpose SCHEMA --help for more information.

Configuration file

pdfimpose apply can be used to store options in a configuration file:

pdfimpose apply [-h] [--schema SCHEMA] [CONF] [PDF ...]
  • CONF is a configuration file, in yaml format (see below);

  • PDF is the file(s) to process;

  • SCHEMA is the imposition schema to use.

Those three arguments are optional: pdfimpose apply is a valid command:

  • If CONF is missing, a configuration file is searched:

    • pdfimpose.cfg or .pdfimpose.cfg, in the current working directory;

    • the same files, in the parent directory, or grand-parent directory, or…;

    • the same files, in ~/.config;

    • the same files, in the home directory;

    • /etc/pdfimpose.cfg (depending on the operating system).

  • If PDF is missing, it is read from the configuration file (section general, option files).

  • If SCHEMA is missing, it is read from the configuration file (section general, option schema).

For instance, calling pdfimpose apply foo.cfg, where foo.cfg contains:

[general]
schema = hardcover
files = foo.pdf bar.pdf

[hardcover]
imargin = 1cm
omargin = .5cm

is equivalent to the following command line:

pdfimpose hardcover --imargin 1cm --omargin .5cm foo.pdf bar.pdf