Skip to content

get_text_from_layout_json throws 'NoneType' object is not subscriptable for a specific PDF #411

@neil-sola

Description

@neil-sola

get_text_from_layout_json throws 'NoneType' object is not subscriptable for a specific PDF.

Unfortunately, I can't share the specific PDF for privacy reasons — but this line seems to be the cause:

children = [(x, depth + 1) for x in relationships[0]['Ids']]

Might also be an issue with Textract's output itself, rather than this library's parsing. This issue seems isolated to a specific PDF, and other pdfs work fine. Notes: seems to be something related to the metadata / structure of the file itself, multiple runs + changing orientiation + deleting pages does not seem to fix the issue.

Is this an error than anyone else has encountered / figured out a resolution for?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions