zarulizham/laravel-ocrmypdf

This is my package OCRmyPDF

Fund package maintenance!
zarulizham

Installs: 786

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 2

Open Issues: 0

pkg:composer/zarulizham/laravel-ocrmypdf

v1.0.3 2025-05-09 12:32 UTC

This package is auto-updated.

Last update: 2025-10-09 13:31:08 UTC


README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Pre-requisite

OCRmyPDF: https://ocrmypdf.readthedocs.io/en/latest/

Installation

You can install the package via composer:

composer require zarulizham/laravel-ocrmypdf

You can publish the config file with:

php artisan vendor:publish --provider="ZarulIzham\OCRmyPDF\OCRmyPDFServiceProvider" --tag="laravel-ocrmypdf-config"

This is the contents of the published config file:

return [
    'path' => env('OCRMYPDF_PATH', '/usr/local/bin/ocrmypdf'),
];

Usage

OCRmyPDF::input(storage_path('panic.pdf'))
    ->output(storage_path('converted/panic.pdf'))
    ->redoOcr()
    ->addOption('--redo-ocr')
    ->addOption('--title Panic Document')
    ->addOption('--author Zarul Izham')
    ->begin();

Testing

Put PDF inside ./tests/storage and edit test script.

composer test

License

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