lzw.rb / decode : can't convert nil into String #90

Closed
pinpudding opened this Issue Mar 7, 2013 · 2 comments

Comments

Projects
None yet
2 participants

When trying to extract text of document https://dl.dropbox.com/u/39311630/JFE-June%2B79.pdf I get
vendor/bundle/ruby/1.9.1/bundler/gems/pdf-reader-65b417aea904/lib/pdf/reader/lzw.rb:91:in decode' vendor/bundle/ruby/1.9.1/bundler/gems/pdf-reader-65b417aea904/lib/pdf/reader/filter/lzw.rb:14:infilter'
vendor/bundle/ruby/1.9.1/bundler/gems/pdf-reader-65b417aea904/lib/pdf/reader/stream.rb:63:in block in unfiltered_data' vendor/bundle/ruby/1.9.1/bundler/gems/pdf-reader-65b417aea904/lib/pdf/reader/stream.rb:62:ineach'
vendor/bundle/ruby/1.9.1/bundler/gems/pdf-reader-65b417aea904/lib/pdf/reader/stream.rb:62:in each_with_index' vendor/bundle/ruby/1.9.1/bundler/gems/pdf-reader-65b417aea904/lib/pdf/reader/stream.rb:62:inunfiltered_data'
vendor/bundle/ruby/1.9.1/bundler/gems/pdf-reader-65b417aea904/lib/pdf/reader/page.rb:116:in block in raw_content' vendor/bundle/ruby/1.9.1/bundler/gems/pdf-reader-65b417aea904/lib/pdf/reader/page.rb:113:inmap'
vendor/bundle/ruby/1.9.1/bundler/gems/pdf-reader-65b417aea904/lib/pdf/reader/page.rb:113:in raw_content' vendor/bundle/ruby/1.9.1/bundler/gems/pdf-reader-65b417aea904/lib/pdf/reader/page.rb:105:inwalk'
vendor/bundle/ruby/1.9.1/bundler/gems/pdf-reader-65b417aea904/lib/pdf/reader/page.rb:75:in `text'

Owner

yob commented Mar 7, 2013

Thanks for the report, I can reproduce the error on my system.

I'm unfamiliar with the finer details of the LZW compression spec and I'm pressed for time at the moment, so I doubt I can look into this for a while.

Do you have any time to investigate it? We probably need some extra specs for PDF::Reader::LZW

Owner

yob commented Jan 2, 2017

Shortly after this issue was reported, a fix for the lzw filter was merged in c5866da. Unfortunately I can't download the PDF that was having issues any more, so I can't confirm if that fix would help in this case.

Given the passage of time, I'll close this for now but feel free to open it if the issue is still happening.

@yob yob closed this Jan 2, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment