Download the PHP package abduns/laravel-ocr without Composer

On this page you can find all versions of the php package abduns/laravel-ocr. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-ocr

laravel-ocr

Laravel-first wrapper around Tesseract 5 OCR for images and PDFs.

Tests Version Downloads


Features


Requirements

Install system dependencies first:


Installation

Publish the config file when you need to customize paths, defaults, queues, or PDF rasterization:

The package is auto-discovered by Laravel. The facade alias is Ocr.

The Composer package and GitHub repository are abduns/laravel-ocr. The PHP namespace intentionally remains Dunn\LaravelOcr.


Quick Start

PDF output is keyed by page number:


Why This Package?

This package focuses on a small, headless Laravel surface around the local Tesseract CLI. It ships no routes, views, frontend assets, cloud OCR SDKs, or language-pack downloaders.


Usage

Image OCR

Multiple languages are supported and passed to Tesseract in order:

PDF OCR

If pages() is omitted, every page is OCRed in ascending order. Temporary rasterized page images are deleted after success or failure.

Storage Disks

Use disk() when the source lives on a configured Laravel filesystem disk:

Non-local source disks are streamed to the configured local temp disk before OCR.

Queues

Dispatch a queued OCR job with onQueue():

The queue connection comes from ocr.queue.connection. The queue name comes from the explicit onQueue('name') value, then ocr.queue.name, then Laravel's default queue.

Events

Each OCR invocation dispatches lifecycle events:

PDF OCR emits one event sequence per page.

Artisan

Use ocr:check before wiring OCR into production or queue workers. It verifies the configured Tesseract binary, Tesseract 5 version, requested language data, local temp disk, and PDF backend. Use --skip-pdf when the app only needs image OCR.

For PDFs, page output is separated by a form-feed character.


Advanced Usage

Configuration

Published config lives at config/ocr.php.

temp_disk must be a local filesystem disk because Tesseract and the PDF rasterizers need real local file paths.

Tesseract Options

Method Description
language('eng') Use one Tesseract language
languages(['eng', 'ind']) Use multiple Tesseract languages in order
psm(6) Set page segmentation mode, 0..13
oem(3) Set OCR engine mode, 0..3
timeout(30) Override process timeout in seconds
tessdataPath('/path/to/tessdata') Override traineddata lookup path
dpi(300) Set PDF rasterization DPI
pages([1, 2, 3]) Limit PDF OCR to selected pages

Error Handling

The package exposes typed runtime exceptions:

Configuration validation is lazy. The service provider can boot even if Tesseract is missing; failures surface when OCR is executed.

AI Agent Instructions

This package includes AI coding-agent instructions for common tools:

Use these when an AI agent needs to add OCR to a Laravel app, configure local Tesseract, wire image or PDF OCR, dispatch queued OCR jobs, listen for lifecycle events, or debug system dependency failures.

In apps using Laravel Boost, the package guidelines and laravel-ocr-development skill can be installed by running:

If the package was added after Boost resources were already installed, run:


Standards / Specifications

References:


Supported Features

Feature Support
Image OCR Yes
PDF OCR Yes
Multiple Languages Yes
Laravel Filesystem Disks Yes
Queued Jobs Yes
Lifecycle Events Yes
Artisan Scans Yes
Setup Diagnostics Yes

Compatibility

Platform Supported
PHP 8.2+ Yes
Laravel 10.0+ Yes
Tesseract 5.0+ Yes
Symfony Process 6.0+ Yes

Design Goals


Architecture


Performance

Operation Constraint
Image OCR Bound by Tesseract and source image size
PDF OCR Bound by page count, rasterization DPI, and Tesseract
Remote disk source Streamed once to a local temp file
Cleanup Temporary files removed after success or failure

Testing

Real Tesseract integration tests are opt-in:

PDF integration also needs Ghostscript or a working Imagick PDF policy.


Roadmap


Contributing

Contributions, issues, and discussions are welcome.


Security

If you discover security issues, please report them responsibly.


License

The MIT License (MIT). Please see LICENSE for more information.


All versions of laravel-ocr with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^10.0 || ^11.0 || ^12.0 || ^13.0
illuminate/bus Version ^10.0 || ^11.0 || ^12.0 || ^13.0
illuminate/queue Version ^10.0 || ^11.0 || ^12.0 || ^13.0
illuminate/console Version ^10.0 || ^11.0 || ^12.0 || ^13.0
illuminate/filesystem Version ^10.0 || ^11.0 || ^12.0 || ^13.0
symfony/process Version ^6.0 || ^7.0 || ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package abduns/laravel-ocr contains the following files

Loading the files please wait ...