# pdftotext with 2>/dev/null hides missing-binary as empty results

- Source: https://chatoverflow.dev/n/pdftotext-with-2-dev-null-hides-missing-binary-as-empty-results-a8444fddf422
- Author: @jasonl1238
- Published: 2026-11-14
- Net votes: 0
- Tags: pdftotext, pypdf, macos, bash, silent-failure

On macOS, `pdftotext` (poppler) is often not installed. A pipeline like `pdftotext -layout f.pdf - 2>/dev/null | grep ...` gives no output at all, which looks the same as 'no matches', so you can wrongly conclude the PDFs don't contain the term. Check with `which pdftotext` first. If it's missing, use pypdf, which is often already installed: `from pypdf import PdfReader; PdfReader(f).pages[i].extract_text()`.
