🌙 Dark & Light themes · 🔌 8 engines · 📚 Courses · 👀 Editable preview · 📤 HTML / DOCX export · 🔭 Watch folder · 🦙 Offline ready
Distilmark is a modern, lovingly-designed desktop app that converts PDF files into
clean Markdown. Pick a backend — fully offline native parser, a local Ollama vision
model, or any hosted LLM — drop your files in, and grab your .mds. That's it.
💡 Originally a fork of a PDF editor (
pyPDFeditor-GUI), now reborn as a focused PDF → Markdown converter. The legacy editor still ships in the same repo.
| 🪟 Windows |
Grab the prebuilt |
| 🐍 From source |
pip install git+https://github.com/Hesamsamani/distilmark.git
distilmark |
| 🛠️ Dev mode |
git clone https://github.com/Hesamsamani/distilmark.git
cd distilmark && pip install -r requirements.txt
python -m distilmark |
📖 Full setup notes: INSTALL.md
Pick whichever vibe matches you:
| Engine | Icon | Offline? | Best for | Notes |
|---|---|---|---|---|
| Native | ⚡ | ✅ | Speed, privacy, simple PDFs | PyMuPDF + pymupdf4llm, with a heading heuristic fallback. Zero cost. |
| pdfplumber | 📐 | ✅ | Table-heavy, layout-sensitive PDFs | Layout-aware extraction, tables → GitHub-flavored Markdown. Tunable. |
| Compare | ⚖ | ✅ | Deciding which engine wins | Runs native and pdfplumber at once, writes two files + a diff view. |
| Ollama | 🦙 | ✅ | Tricky layouts, all-local LLM | Uses local vision models (llama3.2-vision, llava, …). |
| OpenAI | 🤖 | ❌ | Highest fidelity, easy setup | gpt-4o-mini and friends. |
| Anthropic | 🧠 | ❌ | Great structure on dense PDFs | Claude Haiku/Sonnet/Opus with vision. |
| OpenAI-compatible | 🌐 | 🤷 | Groq · OpenRouter · LM Studio · vLLM · anything custom | Plug in any /chat/completions endpoint. |
| AWS Bedrock | ☁️ | ❌ | Claude · Nova on your own AWS account | Native SigV4 (no boto3, no proxy). Uses the Bedrock Converse API, so any vision model works. |
- 🎯 Multiple engines — eight backends, one UI, switch in a single click
- 📚 Courses & chapters — organise PDFs into courses with chapters and a library view showing which files are added vs converted. Built for exam prep when you've got dozens of per-chapter PDFs; convert all pending docs in one click and double-click any converted file to open it in Preview.
- 👀 Live preview, editable — source PDF page beside the rendered Markdown, with a Source/Edit tab to tweak the output and Save back to disk. Compare mode adds Native / pdfplumber / Diff tabs side-by-side.
- 📤 Export anywhere — one click for HTML, DOCX (Pandoc when available, python-docx fallback), or combined
.mdwhen batching a folder. - 🤖 Custom LLM prompt — edit the conversion prompt right from the Engines tab; presets for Academic paper, Code-heavy, Tables-only.
- 🔬 Math mode — wraps formulas in
$…$/$$…$$LaTeX for academic PDFs. - 🌀 Streaming output — watch the Markdown appear token-by-token from Ollama/OpenAI/Anthropic.
- 🔭 Watch folder — point Distilmark at a folder; new PDFs are auto-queued (and optionally auto-converted) — perfect for scanner workflows.
- 🧪 Auto-detect scanned PDFs — files with no extractable text get tagged in the queue so you know to enable OCR.
- 🎚️ Per-file engine override — right-click a queued file to convert it with a different engine than the rest of the batch.
- 🔀 Drag-reorder + multi-select queue — reorder, remove, or delete-key your queue items.
- ⌨️ Keyboard shortcuts —
Ctrl+Oadd files ·Ctrl+Shift+Oadd folder ·Ctrl+Enterconvert ·Esccancel ·Ctrl+1..5switch tabs. - ⚡ Quick actions after a conversion — Open output folder, Copy Markdown to clipboard, Open in Obsidian, Export HTML/DOCX, Combine.
- 📂 More input formats — PDF, DOCX (via Pandoc), EPUB, XPS, FictionBook (FB2), comic archives (CBZ), SVG, TXT, and image inputs (PNG/JPG).
- ⚖ Dual-engine compare — run native + pdfplumber together and get two files (
name_native.md+name_pdfplumber.md) to judge for yourself - 🔍 OCR fallback — scanned/image-only pages are run through Tesseract automatically (when installed)
- 🎯 Page-range selection — convert just pages 5–20 of a 500-page monster
- 🛑 Cancel anytime — a Cancel button stops a long batch mid-run
- 💲 Cost estimator — see a rough $ estimate before firing off a paid LLM job
- ⚡ Parallel pages — hosted LLM engines can process N pages concurrently for a big speedup
- 🧹 Post-processing — merge hyphenated line breaks, collapse blank lines, strip repeating headers/footers
- 🔧 pdfplumber tuning — table strategies & snap tolerance exposed in Advanced options
- 🔒 Privacy-first — fully offline mode, your PDFs never leave your machine
- 🪄 Drag & drop files or folders — drop a whole folder and every PDF inside gets queued automatically
- 📂 Smart folder scanning — recursively finds all
.pdffiles in a folder, adds them to the queue in one click - 📚 Batch convert — feed it dozens of PDFs at once, processed one by one with live progress
- 🖼️ Image extraction with relative paths — embedded images are saved and referenced as
./name_images/page1_img1.pngso previews work in VS Code, Obsidian, Typora, and any markdown viewer - 📋 Conversion history — every run (success or failure) is logged with timestamp, engine, filename, and page count; persisted across sessions at
~/.distilmark/history.json - 🦙 Ollama model management — choose a preset tier, browse installed models, and download new ones — all from inside the app
- 🌗 Dark & Light themes — modern Tokyo-Night–style dark / clean light
- 🧵 Threaded worker — UI stays buttery smooth on long jobs
- 📊 Live progress — per-page progress bar and status messages
- 🧩 Persistent settings —
~/.distilmark/config.json - 🔑 Hidden keys — API tokens entered as password fields
- 📦 Prebuilt
.exe— one-click Windows install via GitHub Actions
Convert — drag in files or a folder, pick an engine, tune the advanced options:
Courses — organise your PDFs into courses & chapters and track what's converted:
Preview (live side-by-side) — original PDF page next to the rendered + editable Markdown.
The preview pane now has improved guidance: when no file is loaded it tells you to convert a PDF containing images (use files under test/ or any PDF with figures) so you can see the left-side PDF render + right-side Markdown with properly resolved extracted images (./..._images/...png).
This makes the image extraction + preview demo much clearer.
Engines — manage Ollama and configure every offline & hosted back-end:
Light theme — the same UI, clean and bright:
Distilmark has built-in Ollama model management — no terminal needed.
| Tier | Model | VRAM needed | Best for |
|---|---|---|---|
| 🚀 Powerful | llama3.2-vision:90b |
64 GB+ | Maximum accuracy, research PDFs |
| ⚡ Balanced | llama3.2-vision:11b |
8 GB+ | Great quality, most users |
| 💨 Light | moondream:latest |
4 GB+ | Speed, simple documents |
- Open Engines tab → Ollama section
- Click a preset button to fill the model name, or type your own
- Click ⬇ Pull / Download — a live progress bar shows GB downloaded
- When done, the model appears in the Active model dropdown automatically
# install Ollama: https://ollama.com/download
ollama serve # start the server
ollama pull llama3.2-vision:11b # or any vision model
# in Distilmark → Engines → Test connection → ✓ Connected — 1 model100% local. Zero network calls. Zero API bills. 🎉
Every file you convert is logged automatically:
✓ 2026-06-01 15:30:12 | report.pdf → report.md | native | 12 pages
✓ 2026-06-01 14:55:08 | thesis.pdf → thesis.md | ollama | 87 pages
✗ 2026-06-01 14:40:01 | broken.pdf | native | 0 pages
- History is stored at
~/.distilmark/history.jsonand survives restarts - Switch to the History tab any time to review past conversions
- Colour-coded: green ✓ for success, red ✗ for errors
- Clear button wipes the log when you no longer need it
Drop a whole folder onto the window (or click Add Folder) and Distilmark
recursively finds every PDF inside — including sub-folders — and adds
them all to the queue. Files are then converted one by one with a
File N/total counter so you always know where you are.
Recommended (lean + fast binary):
Use a clean virtual environment with only the real dependencies, then build with the project spec (it excludes heavy ML packages like torch/sklearn that bloat the exe to 400-500 MB and slow startup).
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt pyinstaller pillow
# Now build using the spec (excludes unnecessary huge packages)
pyinstaller --clean -y Distilmark.spec
# → dist\Distilmark.exe (~110 MB typical, much faster to start)If you prefer the manual command, at least add excludes:
pyinstaller --noconfirm --onefile --windowed --name Distilmark `
--collect-all pymupdf --collect-all pymupdf4llm --collect-all pdfplumber `
--exclude-module torch --exclude-module tensorflow --exclude-module sklearn `
--exclude-module pandas --exclude-module matplotlib --exclude-module scipy `
--icon icon.ico distilmark_launcher.pyOr just push a v* tag — the release workflow
builds and uploads Distilmark.exe to GitHub Releases automatically (using the lean spec).
| OS | Path |
|---|---|
| 🪟 Windows | C:\Users\YOU\.distilmark\config.json |
| 🍎 macOS | ~/.distilmark/config.json |
| 🐧 Linux | ~/.distilmark/config.json |
The original PDF-editor app this fork was born from is still included. Launch it with:
pdfeditorFeatures include: merging PDFs/images/e-books · deleting/rotating/rearranging pages · extracting images · adding watermarks · password & permissions · catalogue & metadata editing.
📁 Its settings live at ~/.pyPDFeditor-GUI/.
PRs, issues, and ✨ stars ✨ all warmly welcome.
- 🍴 Fork
- 🌿 Create a branch
- 🛠️ Code away
- 📬 Open a PR
Distilmark stands on the shoulders of some excellent open-source projects. Huge thanks to all of them:
Foundations
- pyPDFeditor-GUI by Nianze A. TAO — the original PDF-editor project Distilmark was forked from.
- PyMuPDF (
fitz) — core PDF parsing, rendering, and image extraction. - pymupdf4llm — high-quality Markdown extraction for the native engine.
- pdfplumber by Jeremy Singer-Vine — the layout-aware, table-savvy extraction engine.
- PyQt6 / Qt — the cross-platform GUI toolkit.
Engines & runtimes
- Ollama — local LLM runtime for fully offline vision conversion.
- tz-ollama-utils by taggedzi — inspiration for the Ollama model-management and direct-download logic.
- Tesseract (via PyMuPDF) — OCR fallback for scanned PDFs.
- OpenAI, Anthropic Claude, and OpenAI-compatible providers (Groq, OpenRouter, LM Studio, vLLM) — supported hosted conversion back-ends.
Design & tooling
- UI/UX Pro Max by nextlevelbuilder — the design-intelligence skill that guided the v1.0 redesign (palette, typography, layout, accessibility).
- Inter by Rasmus Andersson — the primary UI typeface.
- PyInstaller — packages the Windows
.exe.
MIT — see LICENSE. Use it, fork it, ship it. 💜
Made with ❤️ + ☕ + a lot of 🐍
⭐ If Distilmark saved you time, give it a star! ⭐



