PDF Compressor
A smart and simple Python tool to compress both image-based and vector-based PDF files. Built with a clean drag-and-drop GUI and DPI control for precise compression results.
Features:
- Compress scanned (image) PDFs by reducing DPI
- Optimize vector PDFs using Ghostscript
- Simple Tkinter-based interface
- Saves output files to a “Compressed PDFs” folder automatically
- Fast, lightweight, and completely open-source
Installation:
-
Clone this repository: git clone https://github.com/alizangeneh/pdf-compressor.git cd pdf-compressor
-
Install dependencies: pip install -r requirements.txt
-
Install Ghostscript for vector PDF optimization: https://www.ghostscript.com/download.html
-
Make sure the Ghostscript path (for example C:\Program Files\gs\gs9.xx\bin) is added to your system PATH.
Usage:
Run the application: python main.py
Steps:
- Drag and drop your PDF files into the app or use the Browse button.
- Choose a compression level (DPI value).
- Click Process to start compression.
- The compressed PDFs will be saved inside a new folder called Compressed_PDFs.
Requirements:
- Python 3.9 or higher
- PyMuPDF (fitz)
- Pillow
- tkinterdnd2
- Ghostscript (for vector PDFs)
Manual install: pip install PyMuPDF Pillow tkinterdnd2
License: This project is licensed under the MIT License – see the LICENSE file for details.
Author: Developed with ❤️ by Ali Zangeneh GitHub: https://github.com/alizangeneh