Skip to main content

PyCropPDF

PyCropPDF is a desktop PDF editor for cropping pages, adding visual masks, and redacting selected content.

PyCropPDF screenshot

Install

PyCropPDF requires Python 3.10 or later.

pip install pycroppdf

For development:

git clone https://github.com/lukaszliniewicz/PyCropPDF.git
cd PyCropPDF
pip install -e ".[dev]"

Run

pycroppdf
pycroppdf --input /path/to/document.pdf

Optional arguments:

  • --save-to DIRECTORY saves to that directory instead of opening a Save dialog.
  • --save-as NAME.pdf sets the output name when used with --save-to; otherwise the default is <input>_modified.pdf.
  • --manifest-out PATH sets the JSON provenance-manifest path. By default it is saved next to the PDF as <output>.pycroppdf.json.

Edit a PDF

  1. Open a PDF with File > Open PDF... or drag it into the window.
  2. Choose an overlay view for all pages, separate odd/even pages, or a single page from the thumbnail list.
  3. Select thumbnails to limit an operation to specific pages. Use Ctrl/Cmd-click to toggle pages and Shift-click to select a range.
  4. Draw visual masks or redactions first. To make further masks or redactions after cropping, click Reset Crop.
  5. Select Crop Box, draw a rectangle, then click Apply Crop. Odd/even view supports separate rectangles for each group.
  6. Use Undo or Ctrl+Z to revert an edit, then click Save PDF.

Tools

Tool Effect
Crop Box Changes the PDF CropBox. The content outside the visible area remains in the file.
Visual Mask Draws a colored rectangle over page content. The covered content remains in the file.
Redact Removes text and overlapping images or graphics in the selected rectangle. It does not remove metadata, attachments, or copies of the same information elsewhere in the document.

Use Redact when the content itself must be removed. Crop boxes and visual masks only change presentation.

Provenance manifest

Each save writes a JSON sidecar manifest unless a different path is supplied with --manifest-out. It records source and output SHA-256 hashes, page mapping and deletions, plus the crop, mask, and redaction rectangles applied.

Development

pytest
ruff check .

Build a standalone executable with PyInstaller:

pyinstaller --onefile --noconsole --name PyCropPDF run.py

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pycroppdf-0.3.0.tar.gz (28.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pycroppdf-0.3.0-py3-none-any.whl (24.2 kB view details)

Uploaded Python 3

File details

Details for the file pycroppdf-0.3.0.tar.gz.

File metadata

  • Download URL: pycroppdf-0.3.0.tar.gz
  • Upload date:
  • Size: 28.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for pycroppdf-0.3.0.tar.gz
Algorithm Hash digest
SHA256 aac4062ff65aa3337693688dc5a99cf1c7e37ea229054af1b2af864248aa4422
MD5 bbd764c265d7784b8a8c6360b6055981
BLAKE2b-256 14ebf1d6dc5b623f1d317810dc9d0805cd6ccba18a768b0a2f80fa548c2f5795

See more details on using hashes here.

File details

Details for the file pycroppdf-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: pycroppdf-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 24.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for pycroppdf-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 270e1bb000889e31249e78a1cf807b2ad4b1e18da7b389e413d47f9c61c8ea47
MD5 88a9c6d564c8f4614a972ccce54282e7
BLAKE2b-256 4e1e8ce4e9cd62cfdd4b7b1fd721e9b566562f14508f231f2663fc551924d2f3

See more details on using hashes here.

Release history Release notifications | RSS feed

0.4.4

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.1

2 files

This release

0.3.0 This release

2 files

0.2.1

2 files

0.2.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page