1. Go to this page and download the library: Download agussaputrapro/ocrmypdf library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
agussaputrapro / ocrmypdf example snippets
use mishagp\OCRmyPDF\OCRmyPDF;
//Return file path of outputted, OCRed PDF
echo (new OCRmyPDF('document.pdf'))->run();
//Return file contents of outputted, OCRed PDF
echo (new OCRmyPDF('scannedImage.png'))->setOutputPDFPath(null)->run();