Skip to main content
Write the text of a PDF file on any mount to standard output or to a text file. Mirage implements poppler’s pdftotext command line, layout, messages and exit codes with its own PDF reader.

Setup

pdftotext has no account config. It reads PDF files and writes text files through existing mounts.
For YAML registration, see the CLI overview.

SKILL.md

The SKILL.md an agent reads with pdftotext installed.
Available commandsThese commands are registered with this shell; --help after a command or subcommand shows its usage.pdftotext

Supported commands

Run pdftotext --help for the supported flags and operands. This list is generated from Mirage’s registered command tree.

Usage

- as the text file writes to standard output; with no text file, the text goes beside the PDF with .pdf replaced by .txt. A PDF file of - is read from standard input and then needs a text file. Each page ends in a form feed unless -nopgbrk is given. By default text comes in reading order, one blank line after each block; -layout keeps each page’s rows and columns and -raw keeps the order the page draws its text. Encrypted files are read as poppler reads them; one that needs a password opens with -upw or -opw. Pages without a text layer, such as scans, give empty text: there is no OCR.

Behavior

Differences from poppler

  • Text comes from Mirage’s PDF reader, not poppler’s. Where poppler prints raw glyph codes for a font with no usable encoding, the text may come out readable here.
  • -layout keeps poppler’s rows, but column widths can differ.
  • Reading order can differ for cells set side by side in rows.
  • -r, -x, -y, -W, -H, -fixed, -htmlmeta, -tsv, -bbox, -bbox-layout, -cropbox, -colspacing, -listenc and -v are not supported, and -enc takes only UTF-8. An option Mirage does not know is refused rather than read as a file name.
  • Help is Mirage’s own, and poppler’s Syntax Warning lines about damaged content it reads anyway are not printed.

License

See compatibility and licenses.