1. Go to this page and download the library: Download spatie/pdf-to-text 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/ */
spatie / pdf-to-text example snippets
use Spatie\PdfToText\Pdf;
echo Pdf::getText('book.pdf'); //returns the text from the pdf
$text = (new Pdf())
->setPdf('book.pdf')
->text();
echo Pdf::getText('book.pdf');
$text = (new Pdf('/custom/path/to/pdftotext'))
->setPdf('book.pdf')
->text();