SafePDF is a powerful, privacy-focused PDF manipulation tool designed to handle your documents entirely offline. Whether you're compressing large files, splitting pages, merging multiple PDFs, converting to images, rotating pages, or repairing corrupted documents—SafePDF does it all locally, ensuring your sensitive data never leaves your device.
Unlike cloud-based tools, SafePDF performs all operations directly on your device, eliminating the risk of data exposure. It's ideal for professionals, legal teams, healthcare providers, and anyone who values document confidentiality.
- PDF Compression: Reduce PDF file size with adjustable quality settings
- PDF Split/Separate: Split PDF into individual pages or custom page ranges
- PDF Merge: Combine multiple PDF files (coming soon)
- PDF to JPG: Convert PDF pages to high-quality JPG images
- PDF Rotate: Rotate PDF pages by 90°, 180°, or 270°
- PDF Repair: Attempt to repair corrupted PDF files
- Drag & Drop: Easy file selection with drag-and-drop support
- Progress Tracking: Real-time progress indication for operations
- User-friendly Interface: Intuitive tabbed interface similar to the Qt version
Released under GPL-3.0-1 by @mcagriaksoy.
- Python 3.7 or higher
- pip (Python package installer)
pip install -r requirements.txt
PyPDF2
orpypdf
: Core PDF manipulationPillow
: Image processingPyMuPDF
: High-quality PDF to image conversiontkinterdnd2
: Drag and drop support (optional)
If you encounter issues with tkinterdnd2
, the application will still work without drag-and-drop functionality.
# Run the main application
python safe_pdf_app.py
# Or run the test/demo script
python test_demo.py
# Test dependencies only
python test_demo.py --test-only
- Welcome Tab: Overview of the application and process steps
- Select File Tab:
- Drag and drop a PDF file onto the designated area, OR
- Click "Load File from Disk" to browse for a PDF file
- Select Operation Tab: Choose from available PDF operations:
- PDF Compress
- PDF Separate/Split
- PDF Merge
- PDF to JPG
- PDF Rotate
- PDF Repair
- Adjust Settings Tab: Configure operation-specific settings
- Results Tab: View operation progress and results
- Low Quality: Maximum compression, smaller file size
- Medium Quality: Balanced compression and quality
- High Quality: Minimal compression, better quality
- Split by Pages: Creates individual PDF files for each page
- Split by Range: Specify custom page ranges (e.g., "1-5,7,10-12")
- Rotate all pages by 90°, 180°, or 270°
- Converts each PDF page to a high-resolution JPG image
- Default DPI: 200 (adjustable in code)
- Attempts to recover readable pages from corrupted PDF files
- Uses relaxed parsing to handle damaged files
SafePDF/Tk/
├── safe_pdf_app.py # Main application file
├── pdf_operations.py # PDF operations backend
├── requirements.txt # Python dependencies
└── README.md # This file
- Back/Next: Navigate between tabs
- Help: View application help
- Settings: Application settings (coming soon)
- Cancel: Exit the application
The application includes comprehensive error handling:
- Invalid PDF file detection
- Missing dependency warnings
- Operation failure notifications
- Progress tracking with error recovery
-
"PyPDF2/pypdf not available"
pip install PyPDF2 # or pip install pypdf
-
"PIL/Pillow not installed"
pip install Pillow
-
"PyMuPDF not available"
pip install PyMuPDF
-
Drag and drop not working
pip install tkinterdnd2
Note: If tkinterdnd2 installation fails, you can still use the file browser button.
- For large PDF files, operations may take some time
- The application shows progress indicators for long operations
- Operations run in separate threads to keep the UI responsive
SafePDFApp
: Main application class handling UI and user interactionsPDFOperations
: Backend class with all PDF manipulation logic- Modular design allows easy addition of new operations
- Add operation logic to
PDFOperations
class - Create settings UI in
SafePDFApp.update_settings_for_operation()
- Add operation button in
create_operation_tab()
- Handle operation execution in
_run_operation_thread()
Feel free to contribute by:
- Reporting bugs
- Suggesting new features
- Submitting pull requests
- Improving documentation
- v1.0.0: Initial Tkinter implementation with core PDF operations
This Tkinter version provides the same functionality as the Qt form.ui with these advantages:
- Pure Python implementation
- No external UI framework dependencies
- Cross-platform compatibility
- Lightweight and fast startup
- Easy to modify and extend
For more information, visit: https://github.com/mcagriaksoy/SafePDF