Closed rubas closed 3 years ago
Thank you for your detailed bug report.
the function __toString is missing on class Encoding I've created it to return an implode of the object for test and the error stoped
Can you paste your fix here?
I've insert this function to class Encoding:
public function __toString()
{
return implode(',',$this->encoding);
}
Just to be clear that i didn't check for what this class is used. I just created a function that works and was not founded before. I belive that most times this class is not returned as a object of HEADER class but when HEADER has one object of this class the error occurs Maybe the error is deeper of contest. Why sometimes this class is part of HEADER class?
Hi, I have the same issue. But sadly the fix removes the error not the problem. If you have one rouge character in a file no big deal but some of the files, I need to parse, are almost entirely unreadable.
TISKOVÁ ZPRÁVA Centrum pro výzkum veejného mínní Sociologický ústav AV R, v.v.i. !"# $%&'%()&&&*
etc.
Despite this, the majority of files are parsed nicely so great work.
@johnyboom: Is the PDF you posted free to use and without obligations? We may add it to our test environment to test potential fixes.
Well, it is a public document but to be sure I'll ask for consent.
https://cvvm.soc.cas.cz/media/com_form2content/documents/c2/a47/f9/pd120320.pdf
@johnyboom: Is the PDF you posted free to use and without obligations? We may add it to our test environment to test potential fixes.
Ok, we have consent to use it for tests. I've forwarded the details to your email.
The following consent was given for the mentioned PDF file:
We are giving consent to https://www.pdfparser.org to freely use pdf file https://cvvm.soc.cas.cz/media/com_form2content/documents/c2/a47/f9/pd120320.pdf for testing purposes. Content of the file is still intellectual property of "CENTRUM PRO VÝZKUM VEŘEJNÉHO MÍNĚNÍ Sociologický ústav AV ČR, v.v.i." and should be handled according to https://cvvm.soc.cas.cz/cz/cvvm/dokumenty/13-pravni-ujednani.
If someone wants to provide a fix and using this file to check, please include my quoted consent as it is and add it to the code part (with test code) which uses the PDF.
We are seeing a lot of uncatched errors, when we try to extract the content of some pdfs.
Encoding::__toString()
Call to undefined method Smalot\PdfParser\Encoding::__toString()
You find the complete stack trace here. The char is
\
.https://github.com/smalot/pdfparser/blob/master/src/Smalot/PdfParser/Font.php#L104
Header::__toString()
Call to undefined method Smalot\PdfParser\Header::__toString()
You find the complete stack trace here. The char is!
.Code
Our code is simple.
Testfiles
10-12.pdf 12-14.pdf 28-32-2.pdf