pdfimpose.schema

Common classes and function to different imposition schemas.

Each submodule provides:

  • a class SCHEMAImpositor, where:

    • its SCHEMAImpositor.__init__() method takes the schema arguments (which are more or less the same ones as the corresponding command line subcommand);

    • its SCHEMAImpositor.impose() method take the source and destination file names as arguments, and performs the imposition;

  • a function impose(), which is barely more than a wrapper to the aforementionned class.

Margins

class pdfimpose.schema.Margins(left: float = 0, right: float = None, top: float = None, bottom: float = None)[source]

Left, right, top, bottom margins.

  • If the constructor has only one argument, all four margins are equal to this value.

  • If the constructor has no argument, all four margins are 0.

Page

class pdfimpose.schema.Page(number: int, rotate: int = 0, left: int = 0, right: int = 0, top: int = 0, bottom: int = 0)[source]

A virtual page: a page number, a rotation, and margins.

Matrix

class pdfimpose.schema.Matrix(pages: list[list[~pdfimpose.schema.Page]] = <factory>, rotate: dataclasses.InitVar[int] = 0)[source]

Imposition matrix.

This matrix does not contain actual pages, but an array of which source page numbers should go where on one output page.

AbstractImpositor

class pdfimpose.schema.AbstractImpositor(last: int = 0, omargin: ~pdfimpose.schema.Margins | str | ~numbers.Real | ~decimal.Decimal = <factory>, mark: list[str] = <factory>)[source]

Perform imposition of source files onto output file.

This is an abstract method, with common methods, to be inherited by imposition schemas.