I fed 1,068 broken PDFs to five Python libraries and asked each one for the text. The files are Mozilla's pdf.js test suite: PDFs people attached to bug reports over the years, with broken cross-reference tables, strange fonts and fuzzed bytes. If your code reads PDFs that strangers upload, these are the files that will eventually reach it.
Library Failed* Failed where 3+ others worked Total time Slowest file
PyMuPDF 2.1 5 2 14 s 5.9 s
pypdfium2 5.14.0 14 2 6 s 0.6 s
pypdf 6.21.4 23 7 83 s 13.8 s
pdfminer.six 20260107 22 6 204 s timeout (60 s)
pdfplumber 0.11.10 23 7 225 s timeout (60 s)
* Raised an error or hit the 60-second limit. Not counted: 12 password-protected files that at least two libraries reported as needing a password. Python 3.13, 2-vCPU ARM server, each library in its own worker processes.
The fast two are 6 to 40 times faster
pypdfium2 got through all 1,068 files in 6 seconds. PyMuPDF needed 14.…