A GUI application to crop PDF files. It is primarily designed for documents where multiple pages need the same cropping, such as removing headers, footers, or margins.
- Visual Cropping: Draw a crop box directly on a preview of your PDF.
- Overlay Previews: All pages are overlaid with transparency, making it easy to define a crop area that fits all pages.
- Odd/Even Page Modes: View and crop odd and even pages separately, useful for books or two-sided documents with different layouts.
- Page Deletion: Select and remove unwanted pages.
- Cross-Platform: Built with Python and PyQt6, it runs on Windows, macOS, and Linux.
The easiest way to install PyCropPDF is from PyPI:
pip install pycroppdfYou can also install the latest development version directly from GitHub. Ensure you have Python 3.8+ and git installed.
pip install git+https://github.com/lukaszliniewicz/PyCropPDF.gitThis command will handle downloading and installing the package and its dependencies.
If you plan to modify the code, clone the repository and install it in "editable" mode:
git clone https://github.com/lukaszliniewicz/PyCropPDF.git
cd PyCropPDF
pip install -e .This will install the package in editable mode and handle all dependencies.
After installation, you can run the application from your terminal:
pycroppdfYou can also provide a PDF file to open on startup:
pycroppdf --input /path/to/your/document.pdfThe application supports command-line arguments that can be useful in scripts or automated workflows that still require manual user input (e.g., for selecting crop boxes).
--input /path/to/file.pdf: Opens a PDF on startup.--save-to /path/to/directory/: Sets the directory for saving the modified PDF.--save-as filename.pdf: Sets the filename for the saved PDF.
When --save-to or --save-as are used, the "Save" dialog is skipped, and the file is saved directly to the specified location after the user clicks "Save PDF..." in the File menu.
A pycroppdf.py script is included for backward compatibility with existing programmatic usage; it is a simple wrapper for run.py.
- Launch the application.
- Open a PDF file using File > Open PDF... or by dragging and dropping the file onto the window.
- The pages will be displayed as an overlay. Use the View menu to switch between a single overlay for all pages or separate overlays for odd and even pages.
- Click and drag on a page preview to draw a crop box. Adjust the box by dragging its edges or corners.
- Click the Crop Selection button to apply the crop. A preview of the cropped pages will be shown.
- Use the checkboxes next to the page thumbnails to select pages for deletion, then click Delete Selected Pages.
- Save the modified PDF using File > Save PDF....
This project is licensed under the MIT License. See the LICENSE file for details.
