tecnickcom / TCPDF

Official clone of PHP library to generate PDF documents and barcodes
https://tcpdf.org
Other
4.13k stars 1.51k forks source link

"TCPDF_PARSER ERROR: Unable to find startxref" #193

Open Javilop opened 4 years ago

Javilop commented 4 years ago

The problem

I'm using https://pdfparser.org/ that is based in TCPDF. It works fine with several PDFs but when I try some PDFs it gives me this error. For example with this PDF: https://www.dropbox.com/s/953syp2n16m6gir/p6.pdf?dl=0

Error:

Fatal error: Uncaught Exception: TCPDF_PARSER ERROR: Unable to find startxref in /Applications/MAMP/htdocs/msci/pdfparser-master/vendor/tecnickcom/tcpdf/tcpdf_parser.php:807 Stack trace: #0 /Applications/MAMP/htdocs/msci/pdfparser-master/vendor/tecnickcom/tcpdf/tcpdf_parser.php(173): TCPDF_PARSER->Error('Unable to find ...') #1 /Applications/MAMP/htdocs/msci/pdfparser-master/vendor/tecnickcom/tcpdf/tcpdf_parser.php(117): TCPDF_PARSER->getXrefData() #2 /Applications/MAMP/htdocs/msci/pdfparser-master/src/Smalot/PdfParser/Parser.php(93): TCPDF_PARSER->__construct('%PDF-1.4\n%\xAA\xAB\xAC\xAD\n...') #3 /Applications/MAMP/htdocs/msci/pdfparser-master/src/Smalot/PdfParser/Parser.php(81): Smalot\PdfParser\Parser->parseContent('%PDF-1.4\n%\xAA\xAB\xAC\xAD\n...') #4 /Applications/MAMP/htdocs/msci/pdfparser-master/prueba.php(8): Smalot\PdfParser\Parser->parseFile('p6.pdf') #5 {main} thrown in /Applications/MAMP/htdocs/msci/pdfparser-master/vendor/tecnickcom/tcpdf/tcpdf_parser.php on line 807

trolikua commented 3 years ago

Hi @Javilop,

I caught the same error. Could you explain how did you fix it?

Thx.