Skip to content

Latest commit

 

History

History
75 lines (54 loc) · 3.07 KB

File metadata and controls

75 lines (54 loc) · 3.07 KB

PDF Mixer — Implementation Options

Key Technical Requirements

  • Render PDF pages as thumbnails (both left/main and right/source panels)
  • Drag-and-drop pages between panels with insertion between existing pages
  • Multi-select pages in either panel
  • Delete pages from the main document
  • Load, merge, and save PDF files

Option 1: Python + PySide6 + PyMuPDF

Stack:

  • PySide6 — Qt6 bindings for Python; mature, cross-platform desktop UI
  • PyMuPDF (fitz) — fast PDF rendering to images and PDF manipulation (merge, split, reorder pages)

Highlights:

  • PyMuPDF renders high-quality page thumbnails with a single function call
  • Qt's QListWidget / QGraphicsView with drag-and-drop is well-suited to a page-picker UI
  • PySide6 supports custom drag-and-drop between widgets natively
  • Packaging via PyInstaller or cx_Freeze produces a single executable

Pros: Excellent PDF handling, fast thumbnail rendering, mature UI toolkit, short development time
Cons: Python runtime must be bundled; startup slightly slower than native


Option 2: Electron + TypeScript + PDF.js + pdf-lib

Stack:

  • Electron — Chromium + Node.js desktop shell; cross-platform
  • PDF.js — Mozilla's library for rendering PDF pages to <canvas> elements
  • pdf-lib — pure-JS library for reading, writing, and reordering PDF pages
  • React or Vue for the component-based UI

Highlights:

  • PDF.js renders pages in-browser at any resolution; well-maintained
  • pdf-lib handles page insertion and document saving entirely client-side
  • HTML/CSS makes it straightforward to build a two-panel layout with thumbnail grids
  • Drag-and-drop via the HTML5 native API or a library (dnd-kit, SortableJS)

Pros: Familiar web toolchain, rich styling, large ecosystem
Cons: Large bundle (Electron ships Chromium); higher RAM usage; slower cold start


Option 3: Tauri + TypeScript + PDF.js + pdf-lib

Stack:

  • Tauri — Rust-based desktop shell using the OS web view (no bundled Chromium)
  • Same web frontend as Option 2: PDF.js + pdf-lib + React/Vue
  • Rust backend for file I/O; PDF manipulation stays in the frontend via pdf-lib

Highlights:

  • Produces a very small installer (~5–15 MB vs. ~150 MB for Electron)
  • Uses the system web view (WebView2 on Windows, WebKit on macOS/Linux)
  • Otherwise identical developer experience to Electron for the frontend layer
  • pdf-lib runs in WASM-compatible JS; no heavy Rust PDF crate needed

Pros: Tiny binary, lower memory footprint, same web tech as Option 2
Cons: System web view version differences can cause minor rendering inconsistencies; Rust toolchain required to build


Recommendation

Option 1 (Python + PySide6 + PyMuPDF) is the most practical choice for direct implementation:

  • PyMuPDF is the best-in-class PDF renderer for desktop apps (used in Calibre, etc.)
  • PySide6 drag-and-drop between QListWidget panels is well-documented
  • No secondary runtime or web-view quirks to manage
  • Shortest path from code to a working, shippable executable

Select an option and development will begin.