Loading

Reading Scans with OCR

A scan is a picture of text. Without OCR it is stored, served and permanently unfindable — and a scanned PDF is the worst case, because it parses perfectly and yields nothing.

Where to find it

OCR is configured in the installation’s configuration file rather than in Site Settings, beside the storage settings. It ships switched off. The document search status report names the provider and says whether it reads files here or elsewhere.

Three providers, and one is not like the others

  • Tesseract — a program on your own server. Nothing leaves.
  • AWS Textract — the file leaves this system.
  • The AI gateway — a vision model, under its own provider role. The file leaves this system.

A classified document is not posted to a third party

The rule worth knowing before you choose. A classification that forbids export means “may be looked at, must not leave” — and sending the content to somebody else to be read is the most complete way of leaving there is.

So an off-site provider is refused those documents, and they are recorded as a failure naming the classification rather than skipped quietly. A scan that is unsearchable because of a rule is a decision somebody may want to revisit, and they can only revisit it if they can see it.

The same document goes through a local provider unimpeded. The rule is about where the file goes, not about OCR.

An unrecognised provider counts as off-site

A typo in one configuration line must not become the way classified scans reach a third party.

Scanned PDFs are retried

A PDF goes to the PDF reader first, which is right for every other PDF. Where that comes back with no words at all, and the provider can be handed a PDF, it is retried through OCR.

Not every provider can: Textract reads a PDF itself, a vision model is sent an image and cannot be handed one, and Tesseract needs the pages rendered first — which needs a second program installed.

It asks for a transcription and nothing else

A model told to “describe this document” writes prose about it, which then goes into the search index and is searched as though it were the document’s own words. Somebody searching for a phrase would find a paraphrase of it, or not find the phrase that is plainly on the page.

Empty is a failure, not a success

Consistent with the rest of indexing. Storing an empty extraction as done leaves a document that is permanently unfindable and looks indexed, which is worse than a visible failure.

Worked example

An organisation with twenty years of scanned correspondence installs Tesseract on its own server rather than using a hosted service, because a third of the archive is classified. The whole archive becomes searchable, nothing leaves the building, and the few documents that fail do so with a reason attached.

Recommendations

  • Choose local if anything you hold forbids export. It is the only provider that can read everything.
  • Install the PDF rendering program as well, or scanned PDFs stay unreadable.
  • Check the character counts after a bulk run, exactly as for any other extraction.
  • Read the status report to confirm which provider is live and whether it is off-site.