-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add test cases for AGL. #101
Comments
I have updated this issue, since I think I have found the crux of the problem which is that PDFIO is missing part of the AGL specification which states that you first match to AGL, and if no match then you test whether it is a unicode character of the form uniXXXX or uXXXX (see specification for general case and restrictions) |
6367aa6 Fixes it but no test cases are added as the file is no longer accessible. |
Add test cases for AGL. |
isle-of-man-inflation-report-november-2021.pdf |
I tried to run pdPageExtractText on the pdf located:
https://www.gov.im/media/1360682/isle-of-man-inflation-report-november-2021.pdf
However, every character of the text was being interpreted as "\0"
After much pain and effort trailing through the PDFIO code, I have identified the problem as being what is returned by the fum function in PDFont. In particular when the cn"Encoding" object contains a /Differences object with values such as /uni0047 which just represent the unicode character U+47 ('p'). Since the AGL_Glyph_To_Unicode dictionary (not sure where this comes from) doesn't contain the simple unicode mappings then the zero(Char) is returned instead.
One solution might be to just compare the /uni0047 to the base encoding dictionary and if the 0x0047 part exists then add a dictionary entry. Another solution would be to add all of the standard unicode characters that already exist in your base encoding such as /uni0047 to the AGL_Glyph_To_Unicode dictionary.
I have made the assumption, when suggesting this solution, that the cn"Encoding" object is taken directly from the pdf file and not further processed.
If you'd like me to try to create a pull request, I'd be happy to, but I thought I'd ask first in case your more holistic view of the project leads to a more effective solution.
The text was updated successfully, but these errors were encountered: