Skip to content

πŸŽ“ An offline PDF_Compressor - Compress Like a Pro! Added Flask-based PDF compression tool with UI, quality control & download module

License

Notifications You must be signed in to change notification settings

M-Salman-khan/PDF_Compressor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

PDF Compressor Web App πŸ“„βš‘

Flask Python Ghostscript License

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.

πŸ“Œ Description

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.

πŸš€ Features

  • πŸ“„ 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

βš™οΈ Tech Stack

  • Backend: Flask (Python)
  • Compression Engine: Ghostscript
  • Frontend: HTML, CSS (Dark UI), JS

πŸ“ Project Structure

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

πŸ’‘ Prerequisites

  • 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)

πŸ› οΈ Installation

  1. Clone the repository:

    git clone https://github.com/M-Salman-khan/PDF_Compressor.git
    cd PDF_Compressor
  2. Install Flask:

    pip install flask
  3. Install Ghostscript:

  4. Set Ghostscript path in app.py:

    GS_PATH = "C:\Program Files\gs\gs10.05.1\bin\gswin64c.exe"
  5. Run the Flask app:

    python app.py

    Then open your browser at:
    http://localhost:5000

πŸ“¦ Output Example

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

🎯 Why Students Love It

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.

πŸ§ͺ Compression Quality Options

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

🌐 Future Plans

  • Drag & Drop Upload
  • Real-time size preview
  • Multi-file compression

🀝 Contributing

  1. Fork the repo
  2. Create a feature branch (git checkout -b feature/new-feature)
  3. Commit your changes (git commit -m 'Add new feature')
  4. Push to GitHub (git push origin feature/new-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License.
See the LICENSE file for more information.

πŸ‘¨β€πŸ’» Author

M Salman Khan
πŸ”— GitHub Profile


⭐ Star this repo if this project helped you compress your assignments smoothly!

About

πŸŽ“ An offline PDF_Compressor - Compress Like a Pro! Added Flask-based PDF compression tool with UI, quality control & download module

Topics

Resources

License

Stars

Watchers

Forks