iamgerwin/php-pdf-to-markdown-parser
A PHP package that converts PDF files into clean Markdown, extracting text and structure for documentation, notes, and LLM workflows. Works with Laravel and standalone PHP projects.
pdftotext output. This determines whether "ask questions about your documents" ships with usable retrieval or with garbled context.Reasonable fit when:
Look elsewhere when:
pdftotext -layout plus post-processing.smalot/pdfparser (lower-level, more established) or spatie/pdf-to-text (thin wrapper over Poppler), or treat this package as a reference implementation to fork.Before adopting, run a two-day spike: assemble 30–50 real documents from your own corpus, define acceptance thresholds (% of docs with intact heading hierarchy, table-loss rate, character-fidelity vs. manual transcript), and measure. Do not decide from the README.
For executives (30 seconds): "We have a backlog of PDF content — support docs, policies, collateral — that users and our AI assistant can't search well because PDFs chunk badly. This is a free, MIT-licensed PHP library that turns those PDFs into clean Markdown, the format our docs and retrieval pipeline already prefer. Cost is essentially our own engineering time for a short spike; there's no per-page fee and no vendor contract. The tradeoff is maturity: it's a small, single-maintainer project, so I'd propose we use it to validate the feature now and keep a paid extraction API as a documented fallback if accuracy on our corpus disappoints. Decision requested: approve a one-week evaluation, not a permanent commitment."
For engineering: "Treat this as an accelerator, not a foundation. It gives us text extraction plus heading/list heuristics in PHP with no Python sidecar or external calls — useful for a fast end-to-end demo and for the admin-side import job. Two guardrails: (1) put it behind a DocumentConverter interface with toMarkdown(string $path): MarkdownDocument so swapping in pdftotext, Docling, or a hosted API is a one-class change; (2) build a golden-file test suite from our own PDFs before we trust it — we need to know the failure modes on layouts we actually have, especially tables and multi-column pages. Vendor the dependency or fork it under our org, because the upstream is one maintainer and we should assume we may end up owning it. Also confirm whether it shells out to a binary — that changes our container and deployment requirements."
For finance/ops: "Removes a plausible per-page API line item from the ingestion feature. The real cost moves from opex to engineering maintenance — estimate a small ongoing tax to track upstream or maintain our fork, versus the recurring invoice for a managed extractor. The break-even favors this library at low volume and favors a managed API at high volume or high accuracy requirements."
Recommendation: sponsor a one-week, time-boxed spike against a real document sample; ship behind an abstraction boundary; keep a managed-API escape hatch in the architecture review; do not present this to customers as a fidelity guarantee until we have measured numbers.
How can I help you explore Laravel packages today?