1

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
LocDog
  • 36
  • 4
  • 2
    Because this problem is related to a very specific library, and also doesn't happen for all files, you might be better off creating an issue and posting a problematic PDF here: https://github.com/smalot/pdfparser/issues – Chris Haas Oct 25 '22 at 14:23
  • This bug seems to have been fixed by dev can you tell if you’re Using the latest version of this package? Reference: https://github.com/smalot/pdfparser/pull/518 – Sumit kumar Oct 25 '22 at 18:48
  • no that pull request was closed and not merged – LocDog Oct 26 '22 at 07:44
  • https://github.com/smalot/pdfparser/issues/557 that my issue – LocDog Oct 26 '22 at 07:45

0 Answers0