Metadata-Version: 2.4
Name: perfect-binding-converter
Version: 0.1.0
Summary: Perfect binding converter: imposes PDF pages into A4 cut-stack layout with a center fold line
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

# perfect-binding-converter

Imposes a PDF into a **perfect-binding** 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.

The CLI command is **`pbc`** (the bare `pbc` name is taken on PyPI by an
unrelated project, so the package is published under this longer name).

## Install

Requires Python 3.9+.

### PyPI (pip / pipx)

```sh
pip install perfect-binding-converter
# or, isolated:
pipx install perfect-binding-converter
```

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-perfect-binding-converter
```

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
