A high-performance, privacy-focused desktop workstation for PDF manipulation, document conversion, and page curation. Built with Python, PyQt6, and the high-speed PyMuPDF (fitz) rendering engine, MasterPDF delivers sub-second document operations locally on your machine with zero cloud dependencies.
- Merge PDFs: Combine multiple PDF files in custom page order with instant drag-and-drop sequencing.
- Split & Extract: Slice large PDFs into individual documents or extract arbitrary page ranges.
- Watermarking Engine: Apply customized text watermarks across document pages with font, angle, opacity, and coordinate controls.
- Intelligent Compression: Reduce PDF footprint by optimizing embedded streams, raster assets, and vector objects without unreadable visual degradation.
- Bidirectional Conversion:
- PDF to Image: Export individual pages or full multi-page documents to high-resolution PNG / JPG files with configurable DPI.
- Image to PDF: Compile collections of images into single, print-ready PDF portfolios.
- Page Rotation & Orientation: Correct misoriented scans with 90°, 180°, and 270° batch rotations.
- Real-Time Visual Preview: Native canvas preview powered by PyMuPDF rasterization to verify document modifications before committing changes to disk.
- 100% Local & Confidential: No cloud uploads, no third-party telemetry, and no external API reliance. Your sensitive financial, medical, and personal documents never leave your workstation.
Click to expand feature screenshots
| Document Merge | Document Split |
|---|---|
![]() |
![]() |
| Watermark Engine | Compression Optimizer |
|---|---|
![]() |
![]() |
| PDF to Image Export | Interactive Preview |
|---|---|
![]() |
![]() |
graph TD
UI[PyQt6 Desktop UI Layer]
Controller[Application Controller / GUI Logic]
Engine[PyMuPDF / Fitz Core Engine]
Storage[Local File System]
UI -->|User Actions & Events| Controller
Controller -->|Page Operations & Rendering| Engine
Engine -->|Raster Page Pixmaps| UI
Engine -->|Read / Write Streams| Storage
- Presentation Layer: PyQt6 widgets providing responsive controls, progress indicators, and visual preview containers.
- Processing Layer (
operation_pdf.py): Direct manipulation of low-level PDF document trees, page dictionaries, and stream compressors viafitz.Document. - I/O Subsystem (
file_handler.py): Safe file resolution, directory validation, and atomic write operations.
| Component | Technology | Rationale |
|---|---|---|
| Language | Python 3.8+ | Rapid GUI integration and robust file system tooling |
| GUI Framework | PyQt6 | Modern, native desktop look-and-feel with native windowing |
| PDF Engine | PyMuPDF (fitz 1.24.x) |
Industry-leading C-level rendering speed and memory efficiency |
| Image Processing | Pillow (PIL) | Seamless image format conversion and raster buffering |
Ensure you have Python 3.8 or newer installed:
python --version-
Clone the repository:
git clone https://github.com/Haroon-World/MasterPDF.git cd MasterPDF -
Create and activate a virtual environment:
# Windows python -m venv venv .\venv\Scripts\activate # macOS / Linux python3 -m venv venv source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt pip install PyMuPDF==1.24.1 PyQt6==6.7.0
-
Run the application:
python main.py
MasterPDF/
├── docs/
│ └── screenshots/ # UI walkthrough screenshots
├── constant.py # Application constants, theme colors, and UI metrics
├── file_handler.py # File path utilities and format verifiers
├── gui.py # PyQt6 UI layout, panels, and event wiring
├── main.py # Application entry point and runtime bootstrap
├── operation_pdf.py # PyMuPDF document operations (merge, split, compress, watermark)
├── requirements.txt # Project package requirements
├── LICENSE # GNU Affero General Public License v3.0
└── README.md # Comprehensive project documentation
This software is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0) in compliance with the copyleft licensing terms of upstream dependency PyMuPDF (fitz). See the LICENSE file for complete terms.
Muhammad Haroon Siddique
AI & Software Engineer | Top Position, Arfa Karim Fellowship Program 2026
- LinkedIn: linkedin.com/in/muhammad-haroon-engr
- GitHub: @Haroon-World






