-
Notifications
You must be signed in to change notification settings - Fork 536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Call to undefined method Smalot\PdfParser\Encoding::__toString() #364
Comments
Thank you for your detailed bug report. |
the function __toString is missing on class Encoding |
Can you paste your fix here? |
I've insert this function to class 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. |
Hi, I have the same issue. But sadly the fix removes the error not the problem.
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 |
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:
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. |
* Implement undefined method in Encoding class. The __toString method was missing/not implemented, even though it is called in some cases. Fixes #364 * Add PHPDoc and fix type error * Fix style issues * added test in FontTest to proof fix is working; coding style nice up in Font.php * added EncodingTest with 2 tests for new method "getEncodingClass" Co-authored-by: Konrad Abicht <hi@inspirito.de>
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
The text was updated successfully, but these errors were encountered: