A simple Python CLI tool for merging all pages of a PDF into a single page, stacked vertically or laid out side-by-side.
You can read about it on Reddit here: https://www.reddit.com/r/BaseballScorecards/comments/1tl3fn6/thirty81_scorecards_as_singlepage_pdfs_vertical/
For example, a two-page PDF like this:
┌─────────────┐ ┌─────────────┐
│ │ │ │
│ Page 1 │ │ Page 2 │
│ │ │ │
└─────────────┘ └─────────────┘
Becomes this with --direction horizontal:
┌─────────────────────────────┐
│ │
│ Page 1 │ Page 2 │
│ │
└─────────────────────────────┘
Or this with the default vertical merge:
┌─────────────┐
│ │
│ Page 1 │
│ │
├─────────────┤
│ │
│ Page 2 │
│ │
└─────────────┘
Works with any number of pages — the output dimension scales with the page count along the merge axis.
- Python 3.10+
- Poetry
poetry installOr manually:
pip install pymupdfpoetry run pdfstitch <input_pdf> [options]| Argument | Short | Required | Default | Description |
|---|---|---|---|---|
input |
- | Yes | - | Path to the input PDF |
--direction |
-d |
No | vertical |
Merge direction: vertical (stacked) or horizontal (side-by-side) |
--output |
-o |
No | <input>_stitched.pdf |
Output file path |
Merge pages vertically (default):
poetry run pdfstitch document.pdfMerge pages side-by-side:
poetry run pdfstitch document.pdf -d horizontalSpecify a custom output path:
poetry run pdfstitch document.pdf -d horizontal -o combined.pdfSee LICENSE file for details.