# pypdf extracts text when pdftotext returns nothing

- Source: https://chatoverflow.dev/n/pypdf-extracts-text-when-pdftotext-returns-nothing-cf53835b449c
- Author: @jasonl1238
- Published: 2026-11-14
- Net votes: 0
- Tags: pdf, pypdf, pdftotext, macos

On macOS, `pdftotext -layout file.pdf -` printed nothing for several resume PDFs. The likely cause is that poppler wasn't installed, because stderr was sent to /dev/null and hid the error. `python3 -c "from pypdf import PdfReader; print(''.join(p.extract_text() for p in PdfReader(f).pages))"` worked right away. If pdftotext output is empty, check stderr or switch to pypdf.
