There is now a native MacOS version of CroPDF built with SwiftUI! Check it out under https://github.com/ericceg/CroPDF-MacOS.
Lightweight PDF cropper that keeps vector quality. Extract figures from textbooks for Typst, LaTeX, or any other document.
I write my math notes in Typst and often want to include figures from textbooks (which I have as PDFs). To preserve the best possible quality (sharp text, scalable diagrams, no compression artifacts) I need to crop the original PDF and keep it in PDF format.
Yes, some PDF viewers can do this. But I wanted something:
- Lightweight — no bloated software, just a simple tool
- Fast — open, crop, save, done
- Lossless — true vector output, not a rasterized screenshot
So I built CroPDF: ~280 lines of Python, one dependency, does one thing well.
- 📄 Vector-quality output — crops PDFs without rasterization
- 🖱️ Visual selection — draw a rectangle to define the crop area
- ⌨️ Pixel-perfect adjustment — fine-tune with arrow keys
- 📖 Page navigation — browse multi-page PDFs easily
- 💻 CLI launch options — convenient command-line usage
- 🪶 Minimal footprint — just PyMuPDF
Python 3.8+ is required. Install if needed:
- macOS:
brew install python(or download from python.org) - Windows: Download from python.org
- Linux: Usually pre-installed, or
sudo apt install python3
uv (recommended) — fast Python package installer:
curl -LsSf https://astral.sh/uv/install.sh | shOr see uv installation docs.
uv tool install git+https://github.com/ericceg/CroPDF.gitThen run from anywhere:
cropdfpip install git+https://github.com/ericceg/CroPDF.gitgit clone https://github.com/ericceg/CroPDF.git
cd CroPDF
uv tool install .
# or: pip install .cropdfOr open a file directly:
cropdf path/to/file.pdfOr open a file and jump to a page immediately (1-based):
cropdf path/to/file.pdf --page 12- Run
cropdf(orcropdf path/to/file.pdf) - Navigate to the page with the figure you want
- Click and drag to draw a crop rectangle
- Fine-tune the selection:
- Arrow keys — move the rectangle (1px)
- Shift + Arrow — resize the rectangle
- Space + Arrow — move/resize by 25px
- Click Crop and Save → choose output location
The output is a proper PDF — scalable, searchable, perfect for embedding.
| Shortcut | Action |
|---|---|
⌘O / Ctrl+O |
Open PDF file |
⌘S / Ctrl+S |
Crop and save |
⌘G / Ctrl+G |
Go to page |
← → |
Navigate pages (when no selection) |
Arrow keys |
Move selection (1px) |
Shift + Arrow |
Resize selection |
Space + Arrow |
Move/resize by 25px |
Escape |
Deselect area |
- 📚 Extract figures from textbooks for your notes
- 📝 Include diagrams in Typst/LaTeX documents
- 🎓 Crop theorems or examples for presentations
- 📊 Pull charts from papers for slides
- Python 3.8+
- tkinter (GUI library)
Note: tkinter is included with most Python installations. If you get ModuleNotFoundError: No module named '_tkinter':
- macOS (Homebrew):
brew install python-tk - Ubuntu/Debian:
sudo apt-get install python3-tk - Windows: tkinter is included by default
MIT. See LICENSE.