This is maybe more of a PHP question than pdfparser one but here it goes anyway:
Important part of my code:
$parser = new \Smalot\PdfParser\Parser();
$pdf = $parser->parseFile($file_path);
$pages = $pdf->getPages();
foreach ($pages as $page) {
$text = $page->getText();
$stringWithoutNewLine = str_replace("\n"," ",escapeshellarg($text));
//some more code
}
And this returns the error in the title. Sure enoguh, I think some of the pages in my .pdf have only images, no text.
I would like to get an empty string if there is no text on the page.
This is maybe more of a PHP question than pdfparser one but here it goes anyway: Important part of my code:
And this returns the error in the title. Sure enoguh, I think some of the pages in my .pdf have only images, no text. I would like to get an empty string if there is no text on the page.