I wan't to parse a file with : https://github.com/smalot/pdfparser
The problem
When i use $parser->parseFile($pathToPdf)
I got this :
Argument 1 passed to Smalot\PdfParser\Parser::parseHeader() must be of the type array, string given, called in /path/to/project/vendor/smalot/pdfparser/src/Smalot/PdfParser/Parser.php on line 266
this only happens with some files but not all.
if you need more details please let me know
Complete code
$parser = new PdfParser();
$pdf = $parser->parseFile($path);
Details
- PHP version : 7.4
- used library : https://github.com/smalot/pdfparser