MarkItDown returned an empty file for my scanned PDF — so I benchmarked it against a tool that refuses to fail silently
If you use Microsoft's MarkItDown to feed PDFs into an LLM or a RAG pipeline, you have probably seen the reports: a scanned PDF goes in, an empty (or near-empty) Markdown file comes out, the command exits 0, and nothing anywhere says something went wrong. Independent tests have logged the same thing — conversions of scanned PDFs "exited successfully while returning only a newline."
I build pdf-slice, a small open-source PDF-to-Markdown tool designed around the opposite rule: if the output might be wrong or incomplete, it says so, loudly. So I ran both tools over the same set of test PDFs and wrote down exactly what happened — including where my own tool lost.
Method
- MarkItDown 0.1.9, installed as
markitdown[pdf]in a clean venv, run as the stock CLI (markitdown <file> -o out.md) — no plugins, no LLM client, no Azure services. That is the configuration in the public complaints. - pdf-slice 1.1.0, run with default thresholds and
--no-cache. OCR via Tesseract. - Fixtures: the PDF test files from pdf-slice's own test suite, built around known failure modes (scanned pages, hidden text, tables, encryption, corruption).
Full disclosure, because it matters: these fixtures are pdf-slice's home turf. They were built to probe exactly the failure modes pdf-slice cares about. Every number below is a real, unedited run from 23 Nov 2026 — nothing was re-run until it looked good — but read the comparison with that bias in mind.
Results
| Fixture | MarkItDown 0.1.9 | pdf-slice 1.1.0 |
|---|---|---|
| Scanned, image-only (3 pages) | exit 0, 0 chars, no warning | exit 0, 699 chars via OCR — all 6 reference sentences recovered |
| Encrypted | exit 1, Python traceback (PDFPasswordIncorrect) | exit 2, one plain-language line refusing to return empty markdown silently |
| Hidden white text | exit 0, 387 chars, sentences run together | exit 0, 401 chars, paragraph breaks preserved |
| Simple visible text (control) | exit 0, 387 chars | exit 0, 401 chars |
| Two-column layout | exit 0, 429 chars, column 1 then column 2, no interleaving | exit 0, 427 chars, same order |
| Simple table grid | exit 0, 118 chars — **table flattened to loose lines; zero ` | ` characters in the output** |
| Table with merged cells | exit 0, 154 chars — clean table, merged title as plain text above it | exit 0, 153 chars — table preserved, warning issued that the merged span was flattened |
| English + Persian | exit 0, 176 chars — Persian lines in reversed (visual) order | exit 0, 174 chars — Persian in correct logical reading order |
| Corrupt file | exit 1, Python traceback | exit 2, one line: "cannot open PDF (corrupt or truncated?)" |
| Valid PDF, no content | exit 0, 0 chars, no warning | exit 0, 0 chars, 2 explicit low-confidence warnings |
| Zero-byte file | exit 1, Python traceback | exit 2, one line: "not a PDF file" |
The scanned case is the headline. It is not that MarkItDown tried and failed — it succeeded, silently, with nothing. In a pipeline, that empty file flows downstream and the failure surfaces much later, if ever.
On the simple table, the grid did not survive at all: the output contains zero pipe characters, just values on loose lines. And on the bilingual file, the Persian text came back in reversed order — readable to no one, and again with no signal that anything was off.
Where MarkItDown won — honestly
A benchmark that only shows one side winning is marketing, so here is the other side:
- Speed, on every single fixture. MarkItDown finished in 0.8–2.1 s; pdf-slice took 1.9–10.6 s. The 10.6 s OCR run is the price of actually reading the scan — but on plain text files pdf-slice is simply ~2× slower.
- Merged-cell table. MarkItDown's output was arguably cleaner: the merged title stayed as text above a tidy table. pdf-slice turned the title into a table row (and at least warned about the flattening).
- Two-column layout: a tie. Neither tool interleaved the columns on this fixture; both read column 1 fully, then column 2. The public interleaving complaints were not reproduced here.
- Encrypted PDFs: a behaviour tie. Older write-ups describe MarkItDown returning an empty string for encrypted files. Version 0.1.9's CLI does not do that — it fails loudly, with a traceback. pdf-slice's only edge there is a one-line, human-readable refusal instead of a stack trace.
On clean, simple, text-based documents, MarkItDown is the faster tool and just as good. That is worth saying plainly.
What pdf-slice does differently
pdf-slice is not trying to be a better layout engine. Its one design rule is that failure must never pass silently:
- Provenance on every run — JSON metadata records which path produced the output (
native/ocr/fallback), per-page origin, character counts and a content hash. - Automatic OCR routing — a suspiciously thin text layer is treated as a signal, not an answer: the page is routed to OCR and the output declares it.
- Warnings instead of silence — merged cells, thin text, low-confidence results all surface as explicit warnings attached to the output.
- Loud, plain-language refusals — encrypted, corrupt, empty and zero-byte inputs fail with one readable line and a distinct exit code, never with empty "successful" output.
The one-sentence version
On these fixtures, MarkItDown is faster and just as good on clean documents — and it fails exactly where users complain it does: it hands you an empty file for a scanned PDF and calls it success. pdf-slice is slower, and in exchange it OCRs, warns, or refuses in plain language.
If silent empty output has bitten your pipeline, the tool is here: github.com/kamalmosadegh/pdf-slice — MIT licensed, local, CPU-only. And if you run the same fixtures through your own converter, I would genuinely like to see your numbers.

