Skip to main content

PyCropPDF

PyCropPDF is a desktop PDF editor for cropping, rotating, and visually covering PDF pages.

PyCropPDF screenshot

Install

Standalone builds

The latest release provides x86_64 builds for Windows (.exe) and Linux (.AppImage). Both include Auto deskew.

On Linux:

chmod +x PyCropPDF-*-x86_64.AppImage
./PyCropPDF-*-x86_64.AppImage

AppImage normally uses FUSE 2. If FUSE is unavailable, run it without mounting:

APPIMAGE_EXTRACT_AND_RUN=1 ./PyCropPDF-*-x86_64.AppImage

PyPI

PyCropPDF requires Python 3.11 or later.

python -m pip install pycroppdf

Auto deskew is optional because it adds NumPy and scikit-image:

python -m pip install "pycroppdf[deskew]"

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. Without it, --save-to writes <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. Use View to choose one overlay for all pages or separate odd/even overlays.
  3. Click a thumbnail image to preview that page. Click it again or use Stack to return. Thumbnail checkboxes select pages for deletion; Ctrl/Cmd toggles and Shift selects a range.
  4. Open Rotate, choose all, odd, even, or the previewed page, and enter an angle. Click Preview to inspect a fine rotation, Discard to clear it, or Apply to change the PDF. The 90-degree buttons apply immediately; Auto deskew detects and corrects small angles per page.
  5. Click Cover, choose All, Odd, or Even, then draw the cover. In a page preview, This page only overrides that scope. New covers are added without replacing existing ones and do not remove the underlying PDF content.
  6. Click Crop, draw a crop box, then click Apply Crop. Odd/even positions are independent and their sizes stay uniform. To override one page, preview it, enable This page only, draw its crop box, and apply the crop again.
  7. Use Undo or Ctrl+Z to revert an edit, then click Save.

Crop applies to all pages. Cover uses its selected scope and remains additive. A per-page crop override replaces the stack crop only for that page.

Rotate and add covers before cropping. If a crop preview is active, reset it before using those tools. For pages with links, annotations, or form fields, the app warns before a fine-angle rotation because some appearances or destinations cannot be transformed exactly.

Tools

Tool Effect
Crop Box Changes the PDF CropBox. The content outside the visible area remains in the file.
Cover Adds a rectangle to all, odd, even, or only the previewed page. Existing covers and covered content remain in the file.
Rotation Rotates page content without rasterizing it. Exact 90-degree turns use PDF rotation metadata.
Auto deskew Detects a small text-line angle independently for each target page. Requires pycroppdf[deskew].

Crop boxes and covers change presentation; they do not securely remove content. Larger Auto deskew jobs use one fewer worker than the detected CPU count. Two-core systems use both cores. Small jobs stay in one process to avoid startup overhead.

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, rotations, and crop and cover rectangles.

Development

git clone https://github.com/lukaszliniewicz/PyCropPDF.git
cd PyCropPDF
python -m pip install -e ".[dev,deskew]"
pytest
ruff check .
ruff format --check .

Build a standalone Windows executable with PyInstaller:

python -m pip install -e ".[build,deskew]"
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\build_windows.ps1

Install pycroppdf[deskew] in the build environment to include Auto deskew. The build script supplies the PyInstaller hook needed by scikit-image's runtime package checks. Deskew roughly doubles the executable size.

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.4.1.tar.gz (51.8 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.4.1-py3-none-any.whl (41.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pycroppdf-0.4.1.tar.gz
Algorithm Hash digest
SHA256 d96c77bf19b9f39769d69c2640972b88f24c9baf0eebf7f1b3b1dd678fe2379b
MD5 87b2cbc35ed80599dbb8f983144b5996
BLAKE2b-256 3d68286f6c3315a9f1a64283bb773eb37f4561ae17053639a571c4b0905803e9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pycroppdf-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 41.4 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.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 aabc12b4302c94336da4d3c567e400beec451179f1c1b1680eccd7e93939b498
MD5 62df4802ae16e1a6be7d5734e65f8bd1
BLAKE2b-256 b0539df0122cdaf6c8f82b06451fb20dcc263e9759a946c5a3d3e8bdb47d3e75

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

This release

0.4.1 This release

2 files

0.4.0

2 files

0.3.1

2 files

0.3.0

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