A minimal, fast, and student-friendly PDF compression web app built using Python Flask and Ghostscript. This tool allows users to upload any PDF and compress it instantly to reduce file size while retaining readable quality β all through a sleek dark-mode UI.
This application solves a common frustration among students: large PDF assignment file sizes that exceed upload limits on university portals or emails. Instead of using sketchy online tools or installing heavy software, this lightweight web app gives you quick, quality-controlled PDF compression right from your browser.
β‘ Completely Offline β Unlike most online tools that require high-speed internet, this app works entirely offline once set up. You can compress PDFs anytime, anywhere β perfect for students with limited or no internet access.
- π Upload any PDF file and compress it in seconds
- π§ Choose from multiple quality levels: screen, ebook, printer, prepress
- πΎ Download compressed files with size info
- π Sleek dark mode UI for late-night usage
- πΆ No internet? No problem β fully functional offline for uninterrupted productivity
- π Loading spinner and blur effect during compression
- π Auto-redirect or manual return to homepage after download
- Backend: Flask (Python)
- Compression Engine: Ghostscript
- Frontend: HTML, CSS (Dark UI), JS
PDF_Compressor/
βββ templates/
β βββ index.html # Main frontend UI
βββ static/ # Static files (CSS & JS)
β βββ styles.css # Custom dark theme styles
β βββ script.js # Frontend interactivity (spinner, blur, etc.)
βββ uploads/ # Stores uploaded and compressed files
βββ app.py # Flask app logic
βββ requirements.txt # Python dependencies
βββ README.md # Project documentation
- Python 3.10 or higher
- Flask:
pip install flask
- Ghostscript installed on system (Windows/Mac/Linux)
- Add Ghostscript to system PATH (or update the path in
app.py
)
-
Clone the repository:
git clone https://github.com/M-Salman-khan/PDF_Compressor.git cd PDF_Compressor
-
Install Flask:
pip install flask
-
Install Ghostscript:
-
Set Ghostscript path in
app.py
:GS_PATH = "C:\Program Files\gs\gs10.05.1\bin\gswin64c.exe"
-
Run the Flask app:
python app.py
Then open your browser at:
http://localhost:5000
After compression, the user sees:
- β A download section with filename and compressed size
- π½ A download button
- π A button to go back and compress another file
This tool was built with students in mind β especially those who struggle with:
- Uploading large assignment PDFs to college portals (with size limits)
- Emailing presentations or scanned notes
- Sharing lecture notes on WhatsApp, Telegram, etc.
- Compressing files in low or no internet zones β thanks to full offline support With no login, no ads, no tracking β it just gets the job done.
Option | Description | Compression |
---|---|---|
screen |
Lowest quality (max size cut) | π» Maximum |
ebook |
Balanced for readability | β Recommended |
printer |
Medium quality for prints | π¨οΈ Moderate |
prepress |
High quality for publishing | π Least |
- Drag & Drop Upload
- Real-time size preview
- Multi-file compression
- Fork the repo
- Create a feature branch (
git checkout -b feature/new-feature
) - Commit your changes (
git commit -m 'Add new feature'
) - Push to GitHub (
git push origin feature/new-feature
) - Open a Pull Request
This project is licensed under the MIT License.
See the LICENSE file for more information.
M Salman Khan
π GitHub Profile
β Star this repo if this project helped you compress your assignments smoothly!