pdfimpose.schema.hardcover

Hardcover binding (done in books, like dictionaries)

Hardcover binding is the schema used to print real books (novels, dictionnaries, etc.): several destination pages are printed on a single, big, sheet of paper, which is folded, and cut. Those booklets are stacked onto each other, and bound together, to make your book.

To use this schema (without option –group, or with –group=1):

  • print your imposed PDF file, two-sided;

  • separately fold each sheet of paper;

  • stack them;

  • bind them.

With option –group=3 (for instance), repeat the step above for every group of three sheets. You get several signatures, that you have to bind together to get a proper book.

Example:

source, destination.

HardcoverImpositor

class pdfimpose.schema.hardcover.HardcoverImpositor(last: int = 0, omargin: ~pdfimpose.schema.Margins | str | ~numbers.Real | ~decimal.Decimal = <factory>, mark: list[str] = <factory>, folds: str = None, imargin: float = 0, bind: str = 'left', group: int = 1)[source]

Perform imposition of source files, with the ‘hardcover’ schema.

impose()

pdfimpose.schema.hardcover.impose(files, output, *, folds=None, signature=None, size=None, imargin=0, omargin=0, mark=None, last=0, bind='left', group=1)[source]

Perform imposition of source files into an output file, to be bound using “hardcover binding”.

Parameters:
  • files (list[str]) – List of source files (as strings or io.BytesIO streams). If empty, reads from standard input.

  • output (str) – List of output file.

  • omargin (float) – Output margin, in pt. Can also be a Margins object.

  • imargin (float) – Input margin, in pt.

  • mark (list[str]) – List of marks to add. Only crop marks are supported (mark=[‘crop’]); everything else is silently ignored.

  • folds (str) – Sequence of folds, as a string of characters h and v. Incompatible with size and signature.

  • size (str) – Size of the destination pages, as a string that is to be parsed by papersize.parse_papersize(). This option is incompatible with signature and folds.

  • signature (tuple[int]) – Layout of source pages on output pages. For instance (2, 3) means: the printed sheets are to be cut in a matrix of 2 horizontal sheets per 3 vertical sheets. This option is incompatible with size and folds.

  • bind (str) – Binding edge. Can be one of left, right, top, bottom.

  • last (int) – Number of last pages (of the source files) to keep at the end of the output document. If blank pages were to be added to the source files, they would be added before those last pages.

  • group (int) – Group sheets before folding them. See help of command line –group option for more information.