Skip to content

Instantly share code, notes, and snippets.

@matin
Created April 25, 2010 01:47
Show Gist options
  • Save matin/378096 to your computer and use it in GitHub Desktop.
Save matin/378096 to your computer and use it in GitHub Desktop.
>> require 'pdf/reader'
=> true
>> receiver = PDF::Reader::RegisterReceiver.new
=> #<PDF::Reader::RegisterReceiver:0x00000100a5b5a0 @callbacks=[]>
>> pdf = PDF::Reader.file("somefile.pdf", receiver)
TypeError: can't convert nil into String
from /opt/local/lib/ruby/gems/1.9.1/gems/pdf-reader-0.8.5/lib/pdf/reader/parser.rb:140:in `block in hex_string'
from /opt/local/lib/ruby/gems/1.9.1/gems/pdf-reader-0.8.5/lib/pdf/reader/parser.rb:137:in `loop'
from /opt/local/lib/ruby/gems/1.9.1/gems/pdf-reader-0.8.5/lib/pdf/reader/parser.rb:137:in `hex_string'
from /opt/local/lib/ruby/gems/1.9.1/gems/pdf-reader-0.8.5/lib/pdf/reader/parser.rb:55:in `parse_token'
from /opt/local/lib/ruby/gems/1.9.1/gems/pdf-reader-0.8.5/lib/pdf/reader/content.rb:362:in `content_stream'
from /opt/local/lib/ruby/gems/1.9.1/gems/pdf-reader-0.8.5/lib/pdf/reader/content.rb:316:in `block in walk_pages'
from /opt/local/lib/ruby/gems/1.9.1/gems/pdf-reader-0.8.5/lib/pdf/reader/content.rb:314:in `each'
from /opt/local/lib/ruby/gems/1.9.1/gems/pdf-reader-0.8.5/lib/pdf/reader/content.rb:314:in `walk_pages'
from /opt/local/lib/ruby/gems/1.9.1/gems/pdf-reader-0.8.5/lib/pdf/reader/content.rb:296:in `block in walk_pages'
from /opt/local/lib/ruby/gems/1.9.1/gems/pdf-reader-0.8.5/lib/pdf/reader/content.rb:296:in `each'
from /opt/local/lib/ruby/gems/1.9.1/gems/pdf-reader-0.8.5/lib/pdf/reader/content.rb:296:in `walk_pages'
from /opt/local/lib/ruby/gems/1.9.1/gems/pdf-reader-0.8.5/lib/pdf/reader/content.rb:283:in `document'
from /opt/local/lib/ruby/gems/1.9.1/gems/pdf-reader-0.8.5/lib/pdf/reader.rb:134:in `parse'
from /opt/local/lib/ruby/gems/1.9.1/gems/pdf-reader-0.8.5/lib/pdf/reader.rb:76:in `block in file'
from /opt/local/lib/ruby/gems/1.9.1/gems/pdf-reader-0.8.5/lib/pdf/reader.rb:75:in `open'
from /opt/local/lib/ruby/gems/1.9.1/gems/pdf-reader-0.8.5/lib/pdf/reader.rb:75:in `file'
from (irb):3
from /opt/local/bin/irb:12:in `<main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment