This is just a very basic example of how to use the Tesseract OCR engine within a PHP application. This code uses thiagoalessio/tesseract_ocr as an API bridge to the locally installed Tesseract OCR engine.
Recently I required a quick & simple way to feed arbitrary images or other visual files to the Tesseract OCR engine from a PHP runtime environment. So I created this PHP sample project for myself and for anybody else who might find this somehow useful.
Happy Coding!
- PHP 7.4+
- Composer
- Tesseract OCR, with
eng
language support andscript-latn
(Latin) installed.
- Clone the repository
- Run
composer install
in a terminal session within the root folder. - Execute the OCR engine by running
php src/main.php
also from the root folder.
Feel free to add or remove files as you may see fit.
The MIT License (MIT). Please see the License File for more information.
NOTE: This software depends on other packages that may be licensed under different open source licenses.