Metadata-Version: 2.4
Name: book-printing-pbc
Version: 0.1.0
Summary: Book printing cut-stack imposer: pairs PDF pages for A4 booklet cutting
License: MIT License
        
        Copyright (c) 2026 Amr Bassem
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS
Classifier: Topic :: Printing
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pypdf>=3.0
Dynamic: license-file

# pbc

Impose a PDF into a **cut-stack** layout for A4 booklet printing. Pairs pages in
opposite halves of the document onto landscape A4 sheets with a spine gutter,
and draws a dashed center cut/fold line on each sheet.

## Install

Requires Python 3.9+. The PyPI project is named `book-printing-pbc` (the
command is `pbc`; the bare name `pbc` is taken on PyPI by an unrelated
project).

### PyPI (pip / pipx)

```sh
pip install book-printing-pbc
# or, isolated:
pipx install book-printing-pbc
```

The `pbc` command will then be on your PATH.

### Arch Linux (AUR, system-wide)

A PKGBUILD is provided in `packaging/aur/PKGBUILD`. It builds the PyPI
package and installs the `pbc` binary into `/usr/bin`:

```sh
cd packaging/aur
makepkg -si          # build + install with pacman
# or, once published to the AUR:
# yay -S python-book-printing-pbc
```

Installing this way puts `pbc` on your system PATH for all users, with no venv.

## Usage

```sh
pbc input.pdf [-o output.pdf] [-g gutter_mm]
```

- `input` (required): PDF to impose.
- `-o, --output`: output path (default `cut_stack_output.pdf`).
- `-g, --gutter`: spine gutter in millimeters (default `12`).

### Example

```sh
pbc my_book.pdf -o print_ready.pdf
```

Each output sheet holds two source pages side by side on a landscape A4 page,
with the second half of the book mapped behind the first for cut-and-stack
collation. The dashed vertical line marks the fold/cut position.
# perfect-binding-converter
