MergePDF is a modular PDF utility with both a CLI and a Streamlit GUI.
You can use the app right now on the Streamlit website here!
MergePDF/
├── mergepdf/ # Core engine (pure PDF logic)
│ ├── __init__.py
│ └── engine.py
├── cli/ # CLI interface
│ └── main.py
├── gui/ # Streamlit GUI
│ ├── app.py
│ ├── controller.py
│ ├── components.py
│ └── theme.py
├── tests/
│ └── test_engine.py
└── mergePDF.py # Backward-compatible CLI launcher
The engine (mergepdf/engine.py) is the single source of truth for merge behavior.
CLI and GUI both delegate to the engine.
- Python 3.8+
- Dependencies in
requirements.txt:pypdf>=6.14.2,<7.0.0streamlit>=1.37.0,<2.0.0
python -m venv .venv
.venv\Scripts\Activate.ps1
pip install -r requirements.txtShow help:
python mergePDF.py --helpMerge specific files:
python mergePDF.py files -o combined.pdf -i a.pdf b.pdf c.pdfMerge all PDFs in a directory:
python mergePDF.py dir -o merged.pdf -d .\reportsExtract page range:
python mergePDF.py pages -o extract.pdf -p big.pdf -s 0 -e 4Run the GUI:
streamlit run gui/app.pyGUI features:
- Drag-and-drop multi-file PDF uploader.
- SOC-style terminal console with merge progress.
- Neon-accent merge action.
- Download button for merged output.
Run tests:
python -m unittest discover -s tests -vCurrent tests cover:
- File validation
- Directory ordering
- Merge ordering
- Page extraction correctness
- Error handling for invalid PDF content
This repository includes a Copilot architecture skill:
.github/skills/mergepdf-architecture-skill/SKILL.md
Use it to preserve engine/controller/interface boundaries and theme consistency.