CrossRef / pdfextract

MOVED TO https://gitlab.com/crossref/pdfextract
https://gitlab.com/crossref/pdfextract
MIT License
508 stars 89 forks source link

error: undefined method `ascent' #34

Open amitpatelx opened 8 years ago

amitpatelx commented 8 years ago

Getting this error for all PDFs I have

amit@amit:~/projects/testapps/pdf/Untitled Folder/pdfs$ pdf-extract extract --references --titles --trace AUSTIN.pdf
/home/amit/.rvm/gems/ruby-2.2.2@magnificent/gems/pdf-extract-0.1.1/lib/font_metrics.rb:42:in `initialize': undefined method `ascent' for #<PDF::Reader::Font:0x000000030d97d0> (NoMethodError)
    from /home/amit/.rvm/gems/ruby-2.2.2@magnificent/gems/pdf-extract-0.1.1/lib/model/characters.rb:134:in `new'
    from /home/amit/.rvm/gems/ruby-2.2.2@magnificent/gems/pdf-extract-0.1.1/lib/model/characters.rb:134:in `block in build_fonts'
    from /home/amit/.rvm/gems/ruby-2.2.2@magnificent/gems/pdf-extract-0.1.1/lib/model/characters.rb:131:in `each'
    from /home/amit/.rvm/gems/ruby-2.2.2@magnificent/gems/pdf-extract-0.1.1/lib/model/characters.rb:131:in `build_fonts'
    from /home/amit/.rvm/gems/ruby-2.2.2@magnificent/gems/pdf-extract-0.1.1/lib/model/characters.rb:163:in `block (2 levels) in include_in'
    from /home/amit/.rvm/gems/ruby-2.2.2@magnificent/gems/pdf-extract-0.1.1/lib/pdf.rb:81:in `call'
    from /home/amit/.rvm/gems/ruby-2.2.2@magnificent/gems/pdf-extract-0.1.1/lib/pdf.rb:81:in `block (2 levels) in expand_listeners_to_callback_methods'
    from /home/amit/.rvm/gems/ruby-2.2.2@magnificent/gems/pdf-extract-0.1.1/lib/pdf.rb:170:in `block in invoke_calls'
    from /home/amit/.rvm/gems/ruby-2.2.2@magnificent/gems/pdf-extract-0.1.1/lib/pdf.rb:169:in `each'
    from /home/amit/.rvm/gems/ruby-2.2.2@magnificent/gems/pdf-extract-0.1.1/lib/pdf.rb:169:in `invoke_calls'
    from /home/amit/.rvm/gems/ruby-2.2.2@magnificent/gems/pdf-extract-0.1.1/lib/pdf-extract.rb:42:in `block in parse'
    from /home/amit/.rvm/gems/ruby-2.2.2@magnificent/gems/pdf-extract-0.1.1/lib/pdf-extract.rb:38:in `each'
    from /home/amit/.rvm/gems/ruby-2.2.2@magnificent/gems/pdf-extract-0.1.1/lib/pdf-extract.rb:38:in `parse'
    from /home/amit/.rvm/gems/ruby-2.2.2@magnificent/gems/pdf-extract-0.1.1/lib/pdf-extract.rb:53:in `view'
    from /home/amit/.rvm/gems/ruby-2.2.2@magnificent/gems/pdf-extract-0.1.1/bin/pdf-extract:115:in `block (4 levels) in <top (required)>'
    from /home/amit/.rvm/gems/ruby-2.2.2@magnificent/gems/pdf-extract-0.1.1/bin/pdf-extract:112:in `each'
    from /home/amit/.rvm/gems/ruby-2.2.2@magnificent/gems/pdf-extract-0.1.1/bin/pdf-extract:112:in `block (3 levels) in <top (required)>'
    from /home/amit/.rvm/gems/ruby-2.2.2@magnificent/gems/commander-4.4.0/lib/commander/command.rb:178:in `call'
    from /home/amit/.rvm/gems/ruby-2.2.2@magnificent/gems/commander-4.4.0/lib/commander/command.rb:178:in `call'
    from /home/amit/.rvm/gems/ruby-2.2.2@magnificent/gems/commander-4.4.0/lib/commander/command.rb:153:in `run'
    from /home/amit/.rvm/gems/ruby-2.2.2@magnificent/gems/commander-4.4.0/lib/commander/runner.rb:444:in `run_active_command'
    from /home/amit/.rvm/gems/ruby-2.2.2@magnificent/gems/commander-4.4.0/lib/commander/runner.rb:68:in `run!'
    from /home/amit/.rvm/gems/ruby-2.2.2@magnificent/gems/commander-4.4.0/lib/commander/delegates.rb:15:in `run!'
    from /home/amit/.rvm/gems/ruby-2.2.2@magnificent/gems/commander-4.4.0/lib/commander/import.rb:5:in `block in <top (required)>'
jlegewie commented 8 years ago

Duplicate of #23, I think. #23 also discusses a temporary solution.

johncant commented 6 years ago

Looks like this is fixed in master