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

Getting KeyError: 'N' in extract_pages when pdf file contains Note. #1079

Open
suruchi-psi opened this issue Feb 7, 2025 · 0 comments
Open

Comments

@suruchi-psi
Copy link

suruchi-psi commented Feb 7, 2025

  • PDFMiner not working when pdf contains notes within it. Please find the logs below:
  File "/workspace/treeClassifier.py", line 56, in extract_features
    for page_number, page_layout in enumerate(extract_pages(pdf_file_obj)):
  File "/layers/google.python.pip/pip/lib/python3.9/site-packages/pdfminer/high_level.py", line 211, in extract_pages
    interpreter.process_page(page)
  File "/layers/google.python.pip/pip/lib/python3.9/site-packages/pdfminer/pdfinterp.py", line 997, in process_page
    self.render_contents(page.resources, page.contents, ctm=ctm)
  File "/layers/google.python.pip/pip/lib/python3.9/site-packages/pdfminer/pdfinterp.py", line 1014, in render_contents
    self.init_resources(resources)
  File "/layers/google.python.pip/pip/lib/python3.9/site-packages/pdfminer/pdfinterp.py", line 387, in init_resources
    colorspace = get_colorspace(resolve1(spec))
  File "/layers/google.python.pip/pip/lib/python3.9/site-packages/pdfminer/pdfinterp.py", line 370, in get_colorspace
    return PDFColorSpace(name, stream_value(spec[1])["N"])
  File "/layers/google.python.pip/pip/lib/python3.9/site-packages/pdfminer/pdftypes.py", line 285, in __getitem__
    return self.attrs[name]
KeyError: 'N' 

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

1 participant