eva-207's profile picture
eva-207

read-pdf

Public

Forked from zexigh/read-pdf

Transcribe PDFs to Markdown using whichever vision-language model is loaded in LM Studio (tested with Qwen3-VL). Each page is rasterized locally and read by the VL model — no OCR install, no Python, no cloud.

16 Downloads

README

read-pdf

Transcribe a PDF to Markdown by rasterising every page to a PNG and asking the vision-language model loaded in LM Studio to read it.

Why this exists

LM Studio has no built-in OCR, and the existing alternatives (MinerU, Marker, Docling…) require a heavy Python/Tesseract install. If you already have a VL model loaded, a PDF is just a stack of images — this plugin runs that loop, locally, with no network call.

Requirements

  • LM Studio with a vision-capable model loaded.
  • Tested OK with: Qwen3-VL 8B Q4 on a 4-page native PDF. Add your own combinations to this list as you try them.

Tool exposed

read_pdf_to_markdown({ path, pages?, page_render_scale?, transcription_hint?, include_page_separators? }) returns { markdown, pages_processed, pages_failed, total_chars, ms_total, ms_per_page, warnings } or { error } on hard failures (file missing, encrypted PDF, no VL loaded…).

pages accepts forms like "1", "1-3", "1,3,5-7", "5-", "-3".

Configuration

Editable from the plugin settings panel in LM Studio:

  • Default render scale (0.5–4, default 2.0) — pdf.js scale factor; ≈ 144 DPI at 2.0.
  • Max pages per call (default 50, 0 = unlimited).
  • Max file size (MB) (default 100).
  • Vision model identifier — leave empty to auto-pick the first vision-capable loaded model.
  • Document language — auto, fr, en, … fed into the per-page prompt.
  • Transcription style — faithful / clean / structured. clean strips lines that recur across ≥ 3 pages (running headers/footers).
  • Page concurrency (1, leave at 1 for now).
  • Verbose logging — log a line per page in the plugin console.

How fast

Rendering pdf.js → PNG is ~50–100 ms per page; everything else is the VL roundtrip. Expect 5–30 s per page depending on the model. A 30-page lesson can therefore take several minutes — warn the user before launching.

Limitations

  • No password-protected PDFs.
  • Tables and complex multi-column layouts are approximated, not perfect.
  • No fallback OCR — if the VL fails on a page, that page is logged in pages_failed and the run continues.
  • One model, one call per page, sequential. Parallelisation is a future iteration.

License

MIT.