PyMuPDF4LLM

Markdown-conversion layer built on PyMuPDF: converts PDF pages to Markdown while preserving headings, tables (ruled-line or text-position-based detection), and images, specifically tuned for feeding PDF content to LLMs as clean, structured Markdown rather than raw extracted text. A sibling package to base PyMuPDF rather than a separate engine — it reuses PyMuPDF's own C-level parsing and adds the Markdown-shaping layer on top.

Sample Results

Real output from running this tool against a sample PDF, as part of PDFog's open-source PDF tooling benchmark — pick one to see the commands and full output.