ocr — The words in an image or a PDF — openbash
Optical character recognition over a file on a drive or a url. The whole document, or each line with where it sits.
ocr
ocr is a command on the openbash shell, reachable over HTTP, SSH and MCP with one key. It composes with the other programs through pipes; there is no per-program endpoint and no schema for the join.
ocr lines /dropbox/ap/pod-4471.pdf
help
ocr: read an image or PDF, as JSON.
WHICH ONE
`text` returns the document. `lines` returns each line WITH its position on
the page, which is what you want when position carries meaning: a form, a
table, a stamped invoice.
A PATH OR A URL
An absolute path is read from this session — `/dropbox/ap/pod-4471.pdf` is
sent as the bytes it is. Anything with a scheme is fetched by the endpoint.
This is what reads a SCANNED document: `pdftext` on one reports that the
pages are images and extracts nothing, and that is the point to come here.
Studies:
text <url>
the text of an image or PDF, from a drive or a url
lines <url>
the text as lines with their positions on the page
JSON to stdout, so it composes: pipe to `jq` to pick a field, or `> /tmp/…` to keep it.
Run a study with no arguments — `ocr text` — to see what it takes.
What it answers
ocr text — the text of an image or PDF, from a drive or a url ocr lines — the text as lines with their positions on the page