jsvine / pdfplumber

Plumb a PDF for detailed information about each char, rectangle, line, et cetera — and easily extract text and tables.
MIT License
6.31k stars 647 forks source link

AttributeError: 'LTChar' object has no attribute 'graphicstate' trying to use the table function #692

Closed Da-vid21 closed 2 years ago

Da-vid21 commented 2 years ago

So I was running this code bool(double_column.pages[2].extract_table(dict(vertical_strategy='text', text_tolerance=12))) it worked fine last week, but now it's giving me this error, image Can someone help me out? Thanks

My code

jsvine commented 2 years ago

Hi @Da-vid21, my hunch is that you might have a different version of pdfminer.six (this library's main dependency) installed — or possibly pdfminer installed instead of pdfminer.six. The latest/pinned version is 20220524. Which do you get when you run pip freeze?

Da-vid21 commented 2 years ago

Yes, I had other scripts that depended on pdfminer, so I removed pdfminer, pdfminer.six, and pdflumber and installed pdfplumber again that fixed it. Thanks