zarulizham / laravel-ocrmypdf
This is my package OCRmyPDF
Fund package maintenance!
zarulizham
Requires
- php: ^8.0
- illuminate/contracts: ^8.37
- spatie/laravel-package-tools: ^1.4.3
- symfony/process: ^5.3
Requires (Dev)
- brianium/paratest: ^6.2
- nunomaduro/collision: ^5.3
- orchestra/testbench: ^6.15
- phpunit/phpunit: ^9.3
- spatie/laravel-ray: ^1.23
- vimeo/psalm: ^4.8
README
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.