A powerful PDF compression tool with GUI and CLI interfaces
Project description
🗜️ PDF Zipper
A powerful PDF compression tool with both GUI and CLI interfaces, built with modern Python.
📸 Screenshots
🖥️ Beautiful Terminal GUI
|
⌨️ Powerful Command Line Interface
|
✨ Features
- 🎯 Auto Compression: Automatically compress PDFs to a target file size
- 🔧 Manual Compression: Compress PDFs with custom DPI settings
- 📊 PDF to PowerPoint: Convert PDF pages to PowerPoint slides
- 🖥️ Beautiful GUI: Modern terminal-based interface using Textual
- ⌨️ CLI Interface: Full command-line support with rich output
- 📁 Drag & Drop Support: Easy file selection in GUI mode
- 📦 Easy Installation: Install as a system command
🚀 Installation
From Source (Current Method)
git clone https://github.com/your-username/pdf-zipper.git
cd pdf-zipper
pip install -e .
Using Installation Script
git clone https://github.com/your-username/pdf-zipper.git
cd pdf-zipper
./install.sh
From Built Package (Local)
# After building the package
pip install dist/pdf_zipper-1.0.0-py3-none-any.whl
Future: From PyPI (Coming Soon)
# Will be available after publishing to PyPI
pip install pdf-zipper
📖 Usage
CLI Commands
After installation, you can use pdf-zipper or pdfzip commands:
# Launch GUI
pdf-zipper gui
# Compress PDF to specific size (auto mode)
pdf-zipper compress input.pdf --target-size 5.0
# Compress PDF with specific DPI (manual mode)
pdf-zipper compress input.pdf --dpi 150
# Convert PDF to PowerPoint
pdf-zipper convert input.pdf
# Show PDF information
pdf-zipper info input.pdf
# Show help
pdf-zipper --help
The CLI provides rich, colorful output with progress indicators and detailed information (see CLI screenshot above).
GUI Mode
pdf-zipper gui
The GUI provides an intuitive interface with file browser, drag & drop support, and real-time progress logging (see screenshot above).
Programmatic Usage
from pdf_zipper import autocompress_pdf, compress_pdf, convert_to_ppt
# Auto compress to 5MB
autocompress_pdf("input.pdf", "output.pdf", 5.0, print)
# Manual compress with 150 DPI
compress_pdf("input.pdf", "output.pdf", 150, print)
# Convert to PowerPoint
convert_to_ppt("input.pdf", "output.pptx", 150, print)
🛠️ Development
Setup Development Environment
git clone https://github.com/your-username/pdf-zipper.git
cd pdf-zipper
pip install -e ".[dev]"
Run Tests
pytest
Code Formatting
black src/
isort src/
📋 Requirements
- Python 3.8+
- PyMuPDF (fitz)
- Pillow
- python-pptx
- rich
- textual
- typer
🔧 How It Works
- Auto Compression: Uses binary search to find the optimal DPI that achieves the target file size
- Manual Compression: Converts PDF pages to images at specified DPI and recreates the PDF
- PDF to PPT: Extracts each page as an image and creates PowerPoint slides
💡 Tips
- Higher DPI = better quality but larger file size
- Auto compression may take longer but provides precise size control
- For best results, start with the auto compression feature
- Use the GUI for interactive file selection and real-time progress
- Use CLI for batch processing and automation
📄 License
MIT License - see LICENSE file for details.
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pdf_zipper-1.0.0.tar.gz.
File metadata
- Download URL: pdf_zipper-1.0.0.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8f635ae8b95108ac871b48dfe977b894b2934ef0adaae1740cfca3ff3fb8452
|
|
| MD5 |
dd071dbea7d581743ca036170fba8412
|
|
| BLAKE2b-256 |
66e5076e84a5a6177233151f496c2b1a5604f9acf15174d2a5bdf1dc4c89c754
|
File details
Details for the file pdf_zipper-1.0.0-py3-none-any.whl.
File metadata
- Download URL: pdf_zipper-1.0.0-py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
739be49a3d69c1072a3e3c16909df812789350b966e7e3d0b7a152e9a1287b90
|
|
| MD5 |
ad4c11c8ff7be8f2799f94025e7a0da7
|
|
| BLAKE2b-256 |
370c74ab963f28edc09749eeeee4dc009235010d0b3c31816dcfcf21f61bc360
|