Skip to main content

A powerful file processing tool supporting PDF compression and PDF/PPTX conversion with GUI and CLI interfaces

Project description

🗜️ PDF Zipper

PyPI version Python License Platform Status

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

GUI Interface Interactive file browser with drag & drop support

⌨️ Powerful Command Line Interface

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

# Option 1: App Bundle (Recommended for GUI users)
# Download PDF-Zipper-darwin-arm64.app from releases page
# Double-click to launch GUI interface

# Option 2: Command Line Executable
# Download from releases page
chmod +x pdf-zipper-gui-darwin-arm64
./pdf-zipper-gui-darwin-arm64 --help
./pdf-zipper-gui-darwin-arm64 gui  # Launch GUI

Windows

REM Download from releases page
pdf-zipper-cli-windows-x64.exe --help

Linux

# Download from releases page
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:

# 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 PPTX to PDF (new feature!)
pdf-zipper compress presentation.pptx

# Convert PDF to PowerPoint
pdf-zipper convert input.pdf

# Convert PowerPoint to PDF (new feature!)
pdf-zipper convert presentation.pptx

# Show file information (supports PDF and PPTX)
pdf-zipper info input.pdf
pdf-zipper info presentation.pptx

# 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, autocompress_pdf, autocompress_pptx, autocompress_pdf_to_pptx, compress_pdf, convert_to_ppt

# Universal auto compression (supports format conversion)
autocompress("input.pdf", "output.pdf", 5.0, print)      # PDF → PDF
autocompress("input.pptx", "output.pptx", 5.0, print)    # PPTX → PPTX
autocompress("input.pdf", "output.pptx", 5.0, print)     # PDF → PPTX (NEW!)

# Specific auto compression functions
autocompress_pdf("input.pdf", "output.pdf", 5.0, print)           # PDF → PDF
autocompress_pptx("input.pptx", "output.pptx", 5.0, print)        # PPTX → PPTX
autocompress_pdf_to_pptx("input.pdf", "output.pptx", 5.0, print)  # PDF → PPTX (NEW!)

# Manual compression and conversion
compress_pdf("input.pdf", "output.pdf", 150, print)      # Manual PDF compression
convert_to_ppt("input.pdf", "output.pptx", 150, print)   # PDF → PPTX conversion

🛠️ 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

  1. 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!)
  2. Manual Compression: Converts PDF pages to images at specified DPI and recreates the PDF
  3. 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.

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

pdf_zipper-1.2.2.tar.gz (20.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pdf_zipper-1.2.2-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

Details for the file pdf_zipper-1.2.2.tar.gz.

File metadata

  • Download URL: pdf_zipper-1.2.2.tar.gz
  • Upload date:
  • Size: 20.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for pdf_zipper-1.2.2.tar.gz
Algorithm Hash digest
SHA256 55693bebc386b421959d11ddf58ebbbeae1ba921699f13ab3d5f82d85275071f
MD5 2eec485a6b7c01bcd5e5f5471c6834e8
BLAKE2b-256 fd51c74479f3fd9a768d3218d861b19ae2301738341b08e726102b721faee239

See more details on using hashes here.

File details

Details for the file pdf_zipper-1.2.2-py3-none-any.whl.

File metadata

  • Download URL: pdf_zipper-1.2.2-py3-none-any.whl
  • Upload date:
  • Size: 20.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for pdf_zipper-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 23bfc50f28b617c4c3180fc0d4947a21c139f5d0a5872a096453cf912c2cb06c
MD5 a77ec173b7ea53a02043230d8a73783c
BLAKE2b-256 453c84323195d9694961d282011d3ccbf26b03cf8888485ffe6003aec4537b87

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page