Poppler (pdftotext)
$ pdftotext Foundation Low RiskPoppler's pdftotext extracts plain, layout-preserved (-layout), TSV (-tsv), or bounding-box HTML (-bbox) text from PDFs directly to stdout (-). Paired with pdfinfo for metadata and pdftoppm for rasterizing pages, it provides deterministic local PDF parsing for AI agents.
brew install poppler Local PDF text extraction with pdftotext -layout and pdfinfo runs in milliseconds without uploading documents to an MCP server.
Agent-Readiness Checklist
Local Probe EvidenceCaptured --help excerpt
pdftotext version 26.08.0 Copyright 2005-2026 The Poppler Developers - http://poppler.freedesktop.org Copyright 1996-2011, 2022 Glyph & Cog, LLC Usage: pdftotext [options] <PDF-file> [<text-file>] -f <int> : first page to convert -l <int> : last page to convert -r <fp> : resolution, in DPI (default is 72) -x <int> : x-coordinate of the crop area top left corner -y <int> : y-coordinate of the crop area top left corner -W <int> : width of crop area in pixels (default is 0) -H <int> : height of crop area in pixels (default is 0) -layout : maintain original physical layout -fixed <fp> : assume fixed-pitch (or tabular) text -raw : keep strings in content stream order -remove-hyphens <string>: end-of-line hyphen handling: none, soft, or all (default: all) -nodiag : discard diagonal text -htmlmeta : generate a simple HTML file, including the meta information -tsv : generate a simple TSV file, including the meta information for bounding boxes -enc <string> : output text encoding name -listenc : list available encodings -eol <string> : output end-of-line convention (unix, dos, or mac) -nopgbrk : don't insert page breaks between pages -bbox : output bounding box for each word and page size to html. Sets -htmlmeta -bbox-layout : like -bbox but with extra layout bounding box data. Sets -htmlmeta -cropbox : use the crop box rather than media box -colspacing <fp> : how much spacing we allow after a word before considering adjacent text to be a new column, as a fraction of the font size (default is 0.7, old releases had a 0.3 default) -opw <string> : owner password (for encrypted files) -upw <string> : user password (for encrypted files) -q : don't print any messages or errors -v : print copyright and version info -h : print usage information -help : print usage information --help : print usage information -? : print usage information
FCRS-1.0 6-Dimension Breakdown
Deterministic non-interactive execution with - stdout streaming, -tsv tabular output, and -q quiet mode, though it lacks native --json output.
- Supports
-layout,-tsv,-bbox,-q, and-stdout streaming - No native
--jsonoutput flag
Read-only by default when writing to stdout (-), never mutates input PDFs, and supports -f/-l page slicing.
- Writing to
-performs zero filesystem mutations
Pre-packaged across Homebrew (poppler), Linux distros (poppler-utils), and Windows builds with instant C++ startup.
- Available via
brew install popplerand standard OS repositories
Single package delivers pdftotext, pdfinfo, pdftoppm, and pdfimages covering nearly all local PDF inspection tasks.
- Includes text extraction, metadata, image extraction, and page rendering
Long-standing freedesktop.org project maintained actively across major Linux and macOS ecosystems.
- Maintained under
freedesktop.orgPoppler project
Clear -h flag summary and man pages, though flags use legacy single-dash style (-layout, -nopgbrk) rather than GNU --long flags.
- Built-in
pdftotext -hlists all options concisely
Security, Auth & Guardrails
None required; optional -opw and -upw flags accept passwords inline for encrypted local PDFs.
Free GPL-2.0-or-later open-source binary suite.
# Poppler (pdftotext) Agent Rules - Pass `-` as the output argument (`pdftotext -layout in.pdf -`) to read text directly via stdout without creating temporary files. - Use `-f` and `-l` page bounds on large PDFs so output does not overflow agent context.
Agent-Ready Command Recipes
Safe Read-Only Queries
pdftotext -layout -q -f 1 -l 5 input.pdf -
Extracts pages 1–5 with physical column alignment directly to stdout (-) while suppressing warnings (-q).
pdftotext -tsv -q input.pdf -
Outputs tab-separated coordinates and text tokens to stdout for structured document parsing.
Controlled Writes & Previews
pdftotext -enc UTF-8 -layout input.pdf extracted.txt
Saves extracted text to extracted.txt without altering the source PDF.
Strengths for Agents
- + Streams clean UTF-8 text directly to stdout (
-) with-layoutor-tsvstructure. - + Ships with
pdfinfoandpdftoppmfor metadata checks and page rasterization.
Caveats & Pitfalls
- ! Does not emit
--jsondirectly and cannot OCR scanned image-only PDFs withoutpdftoppmplustesseract. - ! Uses single-dash flags (
-layout,-nopgbrk) that differ from GNU double-dash conventions.