OCRmyPDF: https://ocrmypdf.readthedocs.io/en/latest/
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'),
];
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();
Put PDF inside ./tests/storage and edit test script.
composer test
The MIT License (MIT). Please see License File for more information.