🗜️ PDF Zipper
A powerful file processing tool supporting PDF compression, format conversion (PDF ↔ PPTX), with both GUI and CLI interfaces, built with modern Python.
📸 Screenshots
🖥️ Beautiful Terminal GUI
Interactive file browser with drag & drop support
|
⌨️ Powerful Command Line Interface
Rich output with progress indicators and detailed info
|
✨ Features
- 🎯 Auto Compression: Automatically compress PDFs and PPTX files to a target file size
- 🔧 Manual Compression: Compress PDFs with custom DPI settings
- 📊 Bi-directional Conversion: Convert between PDF and PowerPoint formats (PDF ↔ PPTX)
- 📁 Multi-format Support: Process both PDF (.pdf) and PowerPoint (.pptx) files
- 🖥️ 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
- 🔄 Format Detection: Automatic file type detection and validation
- 📦 Easy Installation: Install as a system command
🚀 Installation
From PyPI (Recommended)
pip install pdf-zipper
From Source
git clone https://github.com/your-username/pdf-zipper.git
cd pdf-zipper
pip install -e .
Standalone Executable (No Python Required)
🧪 Working in Progress
Download the pre-built executable for your platform:
macOS (Apple Silicon)
chmod +x pdf-zipper-gui-darwin-arm64
./pdf-zipper-gui-darwin-arm64 --help
./pdf-zipper-gui-darwin-arm64 gui
Windows
REM Download from releases page
pdf-zipper-cli-windows-x64.exe --help
Linux
chmod +x pdf-zipper-cli-linux-x64
./pdf-zipper-cli-linux-x64 --help
From Source
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
📖 Usage
CLI Commands
After installation, you can use pdf-zipper
or pdfzip
commands:
pdf-zipper gui
pdf-zipper compress input.pdf --target-size 5.0
pdf-zipper compress input.pdf --dpi 150
pdf-zipper compress presentation.pptx
pdf-zipper convert input.pdf
pdf-zipper convert presentation.pptx
pdf-zipper info input.pdf
pdf-zipper info presentation.pptx
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, autocompress_pdf, autocompress_pptx, autocompress_pdf_to_pptx, compress_pdf, convert_to_ppt
autocompress("input.pdf", "output.pdf", 5.0, print)
autocompress("input.pptx", "output.pptx", 5.0, print)
autocompress("input.pdf", "output.pptx", 5.0, print)
autocompress_pdf("input.pdf", "output.pdf", 5.0, print)
autocompress_pptx("input.pptx", "output.pptx", 5.0, print)
autocompress_pdf_to_pptx("input.pdf", "output.pptx", 5.0, print)
compress_pdf("input.pdf", "output.pdf", 150, print)
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:
- PDF → PDF: Uses binary search to find the optimal DPI that achieves the target file size
- PPTX → PPTX: Converts PPTX → PDF → optimizes DPI → converts back to PPTX
- PDF → PPTX: Optimizes PDF DPI → converts to PowerPoint format (NEW!)
- Manual Compression: Converts PDF pages to images at specified DPI and recreates the PDF
- Format Conversion:
- PDF to PPT: Extracts each page as an image and creates PowerPoint slides
- PPTX to PDF: Uses system tools (LibreOffice, unoconv) or Windows COM interface
💡 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
- Format Conversion Options:
- PDF → PDF: Direct optimization for fastest processing
- PPTX → PPTX: Maintains PowerPoint format while achieving target size
- PDF → PPTX: Convert and optimize in one step (NEW!)
- 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.