I have a script that uses pdf-reader among other gems to parse and split up a large pdf file into multiple pdfs. I have been setting it up to run on a new machine, and am now getting this error when I try to run tests:
Failure/Error: SrnProcessor.process_main_pdf(main_pdf_path)
ArgumentError:
Unknown glyph width for 9 Helvetica
I saw that a couple other people are having this issue over here: https://github.com/yob/pdf-reader/issues/102 But no workarounds yet. It seems to me that this must be an issue with my setup and not the gem or the pdf, since on other machines I don't have any problems. I'm running ruby 1.9.3 on linux (Mageia 3 64bit), and have tried switching to multiple versions of the gem with no luck. Any suggestions on what I'm missing? Thanks!
I am having the same problem with ruby 1.9.3. I have narrowed it down for me at least to having the trademark R in the pdf. I got it down to this code in the pdf gem:
and i changed it to this which will just ignore characters that it cant recognize. I'm not sure if ruby 2.0 has fixed this issue or not.
A better solution might be to catch the code_point which in this case is 9 in the char_metrics_by_code