scanlayer
Docs / Guides

Bundling Tesseract

An application that embeds scanlayer and wants to avoid depending on a system Tesseract install: a portable Windows build packaged with a desktop app, for example, can ship the binary itself.

Directory layout

Place it under bin/tesseract/, next to the scanlayer package:

text
bin/
  tesseract/
    tesseract(.exe)
    tessdata/
      eng.traineddata
      fra.traineddata
      osd.traineddata

scanlayer detects and uses this automatically if present, no configuration needed.

Resolution order

  1. the TESSERACT_CMD environment variable
  2. a bundled binary at bin/tesseract/, as above
  3. the system PATH, then a short list of common per-OS install locations

Full detail in Installation.

Do not forget osd.traineddata

Required for automatic orientation detection This file is required for orientation and script detection (OSD). Do not leave it out of a bundled tessdata/ directory if you rely on the default automatic orientation correction described in CLI Reference → --orientation. Without it, OSD silently fails and only EXIF-tag-based and manual-angle orientation continue to work.