A complete, cross-platform PDF compression tool featuring a Flutter frontend and a Flask backend. This project is designed to solve a common problem for students and professionals: reducing large PDF file sizes without relying on slow, ad-filled online services.
The Flutter app provides a clean, native experience on mobile and desktop, while the Flask server handles the heavy lifting of PDF compression using the powerful Ghostscript engine.
The main interface of the PDF Compressor app in action.
- Student-Focused: Built to help students meet assignment upload size limits on university portals.
- Cross-Platform: The Flutter app is designed to run seamlessly on Android, iOS, Windows, macOS, and Linux.
- Self-Hosted & Private: The backend can be run locally. Your files never leave your machine, ensuring privacy.
- Quality Control: Offers multiple compression presets to balance file size and visual quality.
- π File Selection: Pick any PDF file from your device.
- βοΈ Multiple Compression Levels:
screen
: Low resolution, maximum compression.ebook
: Balanced quality for on-screen reading.printer
: High quality, suitable for printing.prepress
: Highest quality for professional use.
- π₯ One-Tap Operation: Compress and download the resulting file with a single button press.
- πΎ Save As Dialog: Choose the name and location for your saved file.
The repository is organized into two main parts: the frontend
(Flutter app) and the backend
(Flask server).
PDF_Compressor/
βββ backend/ # Flask server for PDF compression
β βββ main.py
β βββ requirements.txt
β βββ README.md
βββ frontend/ # Flutter app for all platforms
β βββ lib/main.dart
β βββ pubspec.yaml
β βββ README.md
βββ .github/assets/ # Contains assets like images for the README
βββ README.md # You are here!
Layer | Technology |
---|---|
Frontend | Flutter (Dart) |
Backend | Flask (Python) |
Compression | Ghostscript |
Follow these steps to get the project running on your local machine.
π Full instructions are in the
backend/README.md
file.
- Prerequisites: Ensure you have Python 3, pip, and Ghostscript installed and added to your system's PATH.
- Navigate & Install:
cd backend pip install -r requirements.txt
- Run the Server:
The server will start, typically at
python app.py
http://127.0.0.1:5000
.
π± Full instructions are in the
frontend/README.md
file.
- Prerequisites: Ensure you have the Flutter SDK installed.
- Navigate & Install Dependencies:
cd frontend flutter pub get
- Configure API Endpoint:
Open
frontend/lib/main.dart
and update the_uploadUrl
to match your running Flask server's address.// Example for a local server const String _uploadUrl = 'http://127.0.0.1:5000/upload';
- Run the App:
flutter run
Layer | Technology |
---|---|
Frontend | Flutter (Dart) |
Backend | Flask (Python) |
Compression Engine | Ghostscript |
Once the backend server is running and the Flutter app is launched:
- Select a PDF: Tap the "Select PDF" button to open your device's file picker.
- Choose Quality: Use the dropdown menu to select the desired compression level.
- Compress: Tap the "Compress & Download" button.
- Save File: A "Save As" dialog will appear, allowing you to name the file and choose where to save it.
For more specific details on each component, please refer to their individual README files:
- Backend Details:
backend/README.md
- Frontend Details:
frontend/README.md
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
Please feel free to fork the repository and submit a pull request. You can also open an issue with the tag "enhancement" to suggest new features.
Made with π by M-Salman-khan
This project is distributed under the MIT License. See LICENSE
for more information.
If this project helped you, please give it a βοΈ on GitHub! This helps others find it and encourages future development.