PdfParser issue in PHP

419 views Asked by At

Thank you in advance

I am using the PdfParser library to extract text from PDF

My current code for that is as below

$parser = new \Smalot\PdfParser\Parser();
$pdfsource = $parser->parseFile($dest_path);
$pages  = $pdfsource->getPages();
foreach ($pages as $page) {
    $final_text.=strtolower(str_replace(' ', '', $page->getText()));
}

It is working well but for some PDF getting below Exception

Fatal error: Uncaught Exception: Object list not found. Possible secured file. in /var/www/html/pdfparser-master/vendor/smalot/pdfparser/src/Smalot/PdfParser/Parser.php:102 Stack trace: #0
0

There are 0 answers