Skip to content

nloding/pdfstitch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pdfstitch

A simple Python CLI tool for merging all pages of a PDF into a single page, stacked vertically or laid out side-by-side.

But why?

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.

Requirements

Installation

poetry install

Or manually:

pip install pymupdf

Usage

poetry run pdfstitch <input_pdf> [options]

Arguments

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

Examples

Merge pages vertically (default):

poetry run pdfstitch document.pdf

Merge pages side-by-side:

poetry run pdfstitch document.pdf -d horizontal

Specify a custom output path:

poetry run pdfstitch document.pdf -d horizontal -o combined.pdf

License

See LICENSE file for details.

About

A tool to stitch multi-page PDFs into a larger single-page PDF

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors