Skip to content
Haroon-WorldPublic

About

High-performance, privacy-first desktop PDF workstation built with Python, PyQt6, and PyMuPDF for merging, splitting, compressing, watermarking, and converting documents.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

MasterPDF

Python 3.8+ GUI-PyQt6 Engine-PyMuPDF License: AGPL v3 Privacy-100% Offline

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.


Key Capabilities

  • 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.

Visual Walkthrough

Application Dashboard & Document Viewer

MasterPDF Dashboard

Click to expand feature screenshots
Document Merge Document Split
Merge Tool Split Tool
Watermark Engine Compression Optimizer
Watermarking Compression
PDF to Image Export Interactive Preview
PDF to Image Preview

Architecture

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
Loading
  • 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 via fitz.Document.
  • I/O Subsystem (file_handler.py): Safe file resolution, directory validation, and atomic write operations.

Tech Stack

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

Getting Started

Prerequisites

Ensure you have Python 3.8 or newer installed:

python --version

Installation

  1. Clone the repository:

    git clone https://github.com/Haroon-World/MasterPDF.git
    cd MasterPDF
  2. Create and activate a virtual environment:

    # Windows
    python -m venv venv
    .\venv\Scripts\activate
    
    # macOS / Linux
    python3 -m venv venv
    source venv/bin/activate
  3. Install dependencies:

    pip install -r requirements.txt
    pip install PyMuPDF==1.24.1 PyQt6==6.7.0
  4. Run the application:

    python main.py

Project Structure

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

Licensing & Compliance

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.


Author & Contact

Muhammad Haroon Siddique
AI & Software Engineer | Top Position, Arfa Karim Fellowship Program 2026

About

High-performance, privacy-first desktop PDF workstation built with Python, PyQt6, and PyMuPDF for merging, splitting, compressing, watermarking, and converting documents.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages