Skip to content
hillsburgPublic

About

This is a python app used to crop pdf conveniently

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

PDF Crop Tool

A desktop GUI application for cropping PDF documents with visual preview and precise control.

Features

  • 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

Requirements

  • Python 3.8+
  • PyMuPDF (pip install pymupdf)
  • Pillow (pip install Pillow)

Usage

EN_IMG

  • On my windows PC, I only installed Python 3.10.10, so I use the following command:
python crop_gui.py

Steps

  1. Click Open PDF to load a PDF file
  2. Enter a page number and click Go to navigate
  3. Drag the red crop box edges to set the crop area
  4. The crop ratios (%) are shown in the right panel and can be edited manually
  5. Choose Global (same crop for all pages) or Per Page (individual crops)
  6. Click Apply to All to copy the current ratio to all pages
  7. Click Start Crop to process and save the cropped PDF

Output

Cropped files are saved as xxx_cropped_yyyyMMdd_hhmmss.pdf in the same directory as the original.

Other Scripts

crop_pdf.py

Command-line PDF cropping tool:

python crop_pdf.py <input.pdf> [output.pdf] [margin%]

extract_text.py

Extract all text from a PDF:

python extract_text.py <input.pdf> [output.txt]

About

This is a python app used to crop pdf conveniently

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages