Skip to content
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

PDFReader - MalformedPDFError - Error occured while inflating a compressed stream #131

Open
ramyakp opened this issue May 22, 2014 · 2 comments

Comments

@ramyakp
Copy link

ramyakp commented May 22, 2014

Hello,
Thanks for the wonderful gem.

I am encountering an issue on few PDFs - I get PDF::Reader::MalformedPDFError: Error occured while inflating a compressed stream when i try to read the Page text 'reader.pages[1].text'.
Here is the complete error details. Can someone please help here?

Details:

<PDF::Reader::MalformedPDFError: Error occured while inflating a compressed stream (Zlib::DataError: invalid code lengths set)> Additional Details: C:/Ruby193/lib/ruby/gems/1.9.1/gems/pdf-reader-1.3.3/lib/pdf/reader/filter/flate.rb:34:in rescue in filter' C:/Ruby193/lib/ruby/gems/1.9.1/gems/pdf-reader-1.3.3/lib/pdf/reader/filter/flate.rb:17:infilter' C:/Ruby193/lib/ruby/gems/1.9.1/gems/pdf-reader-1.3.3/lib/pdf/reader/stream.rb:63:in block in unfiltered_data' C:/Ruby193/lib/ruby/gems/1.9.1/gems/pdf-reader-1.3.3/lib/pdf/reader/stream.rb:62:ineach' C:/Ruby193/lib/ruby/gems/1.9.1/gems/pdf-reader-1.3.3/lib/pdf/reader/stream.rb:62:in each_with_index' C:/Ruby193/lib/ruby/gems/1.9.1/gems/pdf-reader-1.3.3/lib/pdf/reader/stream.rb:62:inunfiltered_data' C:/Ruby193/lib/ruby/gems/1.9.1/gems/pdf-reader-1.3.3/lib/pdf/reader/font.rb:136:in extract_base_info' C:/Ruby193/lib/ruby/gems/1.9.1/gems/pdf-reader-1.3.3/lib/pdf/reader/font.rb:47:ininitialize' C:/Ruby193/lib/ruby/gems/1.9.1/gems/pdf-reader-1.3.3/lib/pdf/reader/page_state.rb:384:in new' C:/Ruby193/lib/ruby/gems/1.9.1/gems/pdf-reader-1.3.3/lib/pdf/reader/page_state.rb:384:inblock in build_fonts' C:/Ruby193/lib/ruby/gems/1.9.1/gems/pdf-reader-1.3.3/lib/pdf/reader/page_state.rb:383:in each' C:/Ruby193/lib/ruby/gems/1.9.1/gems/pdf-reader-1.3.3/lib/pdf/reader/page_state.rb:383:inmap' C:/Ruby193/lib/ruby/gems/1.9.1/gems/pdf-reader-1.3.3/lib/pdf/reader/page_state.rb:383:in build_fonts' C:/Ruby193/lib/ruby/gems/1.9.1/gems/pdf-reader-1.3.3/lib/pdf/reader/page_state.rb:28:ininitialize' C:/Ruby193/lib/ruby/gems/1.9.1/gems/pdf-reader-1.3.3/lib/pdf/reader/page_text_receiver.rb:42:in new' C:/Ruby193/lib/ruby/gems/1.9.1/gems/pdf-reader-1.3.3/lib/pdf/reader/page_text_receiver.rb:42:inpage=' C:/Ruby193/lib/ruby/gems/1.9.1/gems/pdf-reader-1.3.3/lib/pdf/reader/page.rb:154:in block in callback' C:/Ruby193/lib/ruby/gems/1.9.1/gems/pdf-reader-1.3.3/lib/pdf/reader/page.rb:153:ineach' C:/Ruby193/lib/ruby/gems/1.9.1/gems/pdf-reader-1.3.3/lib/pdf/reader/page.rb:153:in callback' C:/Ruby193/lib/ruby/gems/1.9.1/gems/pdf-reader-1.3.3/lib/pdf/reader/page.rb:104:inwalk' C:/Ruby193/lib/ruby/gems/1.9.1/gems/pdf-reader-1.3.3/lib/pdf/reader/page.rb:75:in text' C:/Tellus/Utils/UtilsBB.rb:32:inVerifyPDFDownloaded'

Regards,
Ramya

@wyefei
Copy link

wyefei commented Mar 30, 2015

Hey @yob I have a sample PDF having this problem. Can you take a look? I can email you the PDF and hopefully you can reproduce it on your end?

@jamescgibson
Copy link

I too have run into this problem. Have yet to find a solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants