Your Swiss Army Knife for Academic PDFs - A modular, privacy-focused command-line tool for PDF manipulation designed specifically for academic use.
Unlike online converters that expose your sensitive documents, PDF Wizard runs entirely on your local machine. Your lab reports, transcripts, and personal documents never leave your computer.
- π Privacy-First: 100% offline processing - zero network requests
- π¦ Smart Compression: 3-stage intelligent compression to meet any size limit (500KB, 1.5MB, 2MB, etc.)
- πΈ Passport Photo Optimizer: Resize & compress images to exact dimensions AND file size
- π Academic Innovations: Blank page removal, auto-rotation, QR verification, and more
- β‘ Batch Processing: Process multiple files at once
- π¨ Beautiful UX: Colorful terminal output with real-time progress bars
# Clone the repository
git clone https://github.com/yourusername/pdf-wizard-cli.git
cd pdf-wizard-cli
# Install with pip
pip install -e .
# Verify installation
pdf-wizard --version# Merge multiple PDFs
pdf-wizard merge file1.pdf file2.pdf file3.pdf -o combined.pdf
# Compress PDF to 2MB
pdf-wizard compress large.pdf -o small.pdf --target-size 2.0
# Create a passport photo (50KB, 600x600px)
pdf-wizard resize-image photo.jpg -o passport.jpg -s 50 -d 600x600pdf-wizard merge lab1.pdf lab2.pdf lab3.pdf -o complete_lab.pdf# One file per page
pdf-wizard split document.pdf -o output_folder/
# Custom page ranges
pdf-wizard split document.pdf -o output_folder/ --mode ranges --ranges "1-5,6-10,11-15"# For 2MB university portal
pdf-wizard compress thesis.pdf -o compressed.pdf --target-size 2.0
# For 500KB submission limit
pdf-wizard compress report.pdf -o tiny.pdf -t 500KB -q low
# High quality, moderate compression
pdf-wizard compress scan.pdf -o optimized.pdf -t 1.5MB -q highQuality Presets:
low- Aggressive compression (smallest size)medium- Balanced (default)high- Minimal loss (best quality)
pdf-wizard protect sensitive.pdf -o protected.pdf -p mypasswordpdf-wizard watermark document.pdf -o watermarked.pdf -w watermark_file.pdfpdf-wizard strip-metadata document.pdf -o clean.pdfpdf-wizard view-metadata document.pdf# Perfect for college applications: 50KB, 600x600px
pdf-wizard resize-image photo.jpg -o passport.jpg -s 50 -d 600x600
# Just resize dimensions
pdf-wizard resize-image large.jpg -o resized.jpg -d 1024x768
# Just compress to size
pdf-wizard resize-image photo.png -o compressed.jpg -s 100pdf-wizard compress-image large.png -o small.jpg -s 100# Multiple images to PDF
pdf-wizard img2pdf page1.jpg page2.jpg page3.jpg -o document.pdf
# PDF pages to images
pdf-wizard pdf2img document.pdf -o images/ --format PNG --dpi 300Perfect for scanned lab notebooks that have extra blank pages:
pdf-wizard remove-blanks scanned_notebook.pdf -o clean.pdfFix tilted scanned documents:
pdf-wizard auto-rotate tilted_scan.pdf -o corrected.pdf# Swap pages 2 and 3
pdf-wizard reorder document.pdf -o fixed.pdf --order "1,3,2,4-10"Generate a QR code with your document's hash - share with professors to prove authenticity:
pdf-wizard qr-share final_thesis.pdf -o verification_qr.pngTrack changes between assignment drafts:
pdf-wizard compare draft_v1.pdf draft_v2.pdf -o differences.pdfpdf-wizard add-numbers report.pdf -o numbered.pdf --position bottom-right --start 1Positions: bottom-right, bottom-center, bottom-left, top-right, top-center, top-left
Formats: numeric (1,2,3), roman (i,ii,iii), alpha (a,b,c)
# Step 1: Optimize passport photo
pdf-wizard resize-image photo.jpg -o passport.jpg -s 50 -d 600x600
# Step 2: Compress marksheet to 500KB
pdf-wizard compress marksheet.pdf -o compressed_marksheet.pdf -t 500KB
# Step 3: Merge all documents
pdf-wizard merge passport.pdf compressed_marksheet.pdf certificates.pdf -o complete_application.pdf
# Step 4: Strip metadata for privacy
pdf-wizard strip-metadata complete_application.pdf -o final_application.pdf# Clean up scanned notebook
pdf-wizard remove-blanks scanned_lab.pdf -o step1.pdf
pdf-wizard auto-rotate step1.pdf -o step2.pdf
pdf-wizard add-numbers step2.pdf -o step3.pdf --position bottom-right
# Compress to 2MB portal limit
pdf-wizard compress step3.pdf -o final_lab.pdf -t 2.0
# Generate verification QR
pdf-wizard qr-share final_lab.pdf -o verification.png# Compare versions
pdf-wizard compare paper_v1.pdf paper_v2.pdf -o diff.pdf
# Prepare final version
pdf-wizard strip-metadata paper_final.pdf -o paper_clean.pdf
pdf-wizard split paper_clean.pdf -o sections/ --mode ranges --ranges "1-5,6-10,11-15"PDF Wizard follows a modular 3-layer design:
pdf-wizard-cli/
βββ pdf_wizard/
β βββ cli.py # Interface Layer - Command parsing
β βββ controller.py # Dispatcher Layer - Routing logic
β βββ utils.py # Helper functions
β βββ engine/ # Core Engine - PDF operations
β βββ merger.py # Merge & Split
β βββ security.py # Password & Watermark
β βββ compressor.py # Smart 3-stage compression
β βββ image_processor.py # Image optimization
β βββ metadata.py # Metadata operations
β βββ academic.py # Academic features
βββ tests/ # Test files
βββ requirements.txt
βββ setup.py
PDF Wizard uses a sophisticated 3-stage approach:
- Image Downsampling - Intelligently reduces image DPI based on target size
- Object Removal - Strips metadata, duplicate fonts, and thumbnails
- Lossless Compression - Compresses text streams without quality loss
The system iteratively adjusts compression levels to hit your exact target size (Β±5% tolerance).
- β Zero network requests - confirmed via network monitoring
- β All processing is local - files never uploaded
- β Metadata stripping - removes identifying information
- β No telemetry - no data collection of any kind
- PyPDF2 - Core PDF operations
- PyMuPDF (fitz) - Advanced compression & image manipulation
- Pillow - Image processing
- click - CLI framework
- tqdm - Progress bars
- qrcode - QR code generation
- python-dotenv - Environment configuration
- pytesseract - For OCR-based auto-rotation (requires Tesseract installation)
Get quick examples for any operation:
pdf-wizard examplesThis displays a comprehensive guide with real-world command examples.
- Compression targets are flexible: Use
"2MB","500KB", or just"1.5"(assumes MB) - Quality matters: Use
highquality for important submissions,lowfor drafts - Batch operations: Process entire folders efficiently
- Chain commands: Use output of one command as input to another
- Check file size first: Use
view-metadatato see current size before compressing
Contributions are welcome! Feel free to:
- Report bugs
- Suggest new features
- Submit pull requests
- Improve documentation
MIT License - see LICENSE file for details
Built with β€οΈ for students who deserve better tools for their academic work.
Special thanks to the open-source community for the amazing libraries that make this possible.
Having issues? Have questions?
- Check the examples:
pdf-wizard examples - Use
--helpon any command:pdf-wizard compress --help - Open an issue on GitHub