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

IndexError: list index out of range #1193

Open
doncat99 opened this issue Mar 19, 2025 · 0 comments
Open

IndexError: list index out of range #1193

doncat99 opened this issue Mar 19, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@doncat99
Copy link

doncat99 commented Mar 19, 2025

Bug

...

Steps to reproduce

...

Docling version

...

Python version

...

when i convert a pdf document what page_range parameter:
conv_result = doc_converter.convert(input_doc_path, page_range=page_range)

it raised error as below:

Image

the supposed correction would be:
from:

page_ix = element.prov[0].page_no - 1
page = conv_res.pages[page_ix]
assert page.size is not None
assert page.image is not None

to:

page_ix = element.prov[0].page_no - 1
page = next((item for item in conv_res.pages if item.page_no == page_ix), None)
assert page is not None
assert page.size is not None
assert page.image is not None

in standard_pdf_pipeline.py file.

@doncat99 doncat99 added the bug Something isn't working label Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant