A desktop GUI application for cropping PDF documents with visual preview and precise control.
- Visual Crop Box - Drag edges to define the crop area directly on the PDF preview
- Per-Edge Control - Set independent crop ratios for top, bottom, left, and right edges
- Two Crop Modes - Global mode applies the same crop to all pages; Per-Page mode allows individual overrides
- Progress Feedback - Real-time progress bar with cancel support during cropping
- Bilingual UI - Switch between English and Chinese interface
- Python 3.8+
- PyMuPDF (
pip install pymupdf) - Pillow (
pip install Pillow)
- On my windows PC, I only installed Python 3.10.10, so I use the following command:
python crop_gui.py- Click Open PDF to load a PDF file
- Enter a page number and click Go to navigate
- Drag the red crop box edges to set the crop area
- The crop ratios (%) are shown in the right panel and can be edited manually
- Choose Global (same crop for all pages) or Per Page (individual crops)
- Click Apply to All to copy the current ratio to all pages
- Click Start Crop to process and save the cropped PDF
Cropped files are saved as xxx_cropped_yyyyMMdd_hhmmss.pdf in the same directory as the original.
Command-line PDF cropping tool:
python crop_pdf.py <input.pdf> [output.pdf] [margin%]Extract all text from a PDF:
python extract_text.py <input.pdf> [output.txt]