-
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
Missing encoding data for: "MacExpertEncoding" #85
Comments
I'm getting this same message. A couple resources I found, but I'm no PDF dev so it's foreign to me: https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/PDF32000_2008.pdf This would be a great addition. Thanks! Love the project! |
Just on a whim, I created a MacExpertEncoding class (using the MacRomanEncoding.php file as a template) and copied the $encoding data from MacRomanEncoding into my new MacExpertEncoding class...and it worked! Granted, I might have just gotten lucky. |
Could you create a merge request to contribute ? |
Sorry if I should open a new issue, but I am actually getting this error:
I have worked around it for now by hardcoding
The problem is that Any thoughts on how to fix this properly? Thanks. |
Can you provide us the PDF which is causing this problem? It must be free of charge and without any obligations. |
Hi @k00ni - thanks for responding so quickly. The issue can be seen with this file. |
Is |
Yes - it's from here: https://ian.umces.edu/press/newsletters/publication/1/healthy_chesapeake_waterways_2002-05-01/ Filename is different, but that's just because I am rebuilding this site and the new version is automatically renaming PDFs to match the publication title. |
Currently, in the Encoding.php, there is a "magic" function __toString() implementation, which calls a getEncodingClass() function, which, in its turn, may throw an exception (line 150). From php.net:
I think, if there is a need to keep a PHP 7.4 support, better change the line 150 somehow (for example, simply return an empty string). Note that __toString() method must return a string. |
I am getting the same error, is there a dirty fix for it? |
Prior PHP 7.4 we expect an empty string to be returned (based on PHP specification) when class is invalid. PHP 7.4+ we expect an exception to be thrown when class is invalid. Hint came from @igor-krein in #85 (comment)
@igor-krein and @suuuunto does #407 fix it? |
The code looks like it should fix the problem, thanks. I'll try to check it in action asap. UPD: Let's say, it is highly likely that the problem was fixed. Actually, I don't have a sample PDF, I just see there was a problem in the logs (obviously, some clients' PDF files invoked the fatal error; but no client has complained yet, so there are no samples). This log data had appeared since the latest upgrade of the system (looks like composer downloaded the latest PdfParser version, too). So, there were new logs, and now they don't seem to appear anymore. Thanks for the changes! Can't wait for them to be merged. |
* Encoding::__toString complies with PHP spec from now on Prior PHP 7.4 we expect an empty string to be returned (based on PHP specification) when class is invalid. PHP 7.4+ we expect an exception to be thrown when class is invalid. Hint came from @igor-krein in #85 (comment) * fixed cs issue * refined Encoding::__toString description * Update src/Smalot/PdfParser/Encoding.php Co-authored-by: Igor Peisakhovich <igor.krein@gmail.com>
Hello,
I´m trying to parse the metadata from different files, the library works great but in some documents give me this error:
Missing encoding data for: "MacExpertEncoding"
You can access one of the document in:
http://www.statistik.rlp.de/fileadmin/dokumente/berichte/C1013_201500_1j_L.pdf
I get this error in the demo too.
Do you know a solution?
Thank you
The text was updated successfully, but these errors were encountered: