Skip to content

Unable to get_text() - layer/clip nesting too deep #4403

@C-Saunders

Description

@C-Saunders

Description of the bug

When page.get_text() is called on the first (and only) page of the attached PDF, this error is raised: RuntimeError: code=5: layer/clip nesting too deep

How to reproduce the bug

subset.pdf

import pymupdf

doc = pymupdf.open("./subset.pdf")
doc[0].get_text()

I was able to view and copy/paste text from this page using a couple of different PDF viewers, so it seems like it's not totally malformed?

I saw the same issue on v1.25.3, but did not test other versions. I got the same result on Mac and Linux.

PyMuPDF version

1.25.4

Operating system

MacOS

Python version

3.11

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions