Skip to content

Intercept bad widgets when inserting to another PDF #4614

@JorjMcKie

Description

@JorjMcKie

Description of the bug

Bad widgets in source pages lead to exceptions when using insert_pdf(source, widgets=True).
Should be handled gracefully with a warning.

sample.pdf

How to reproduce the bug

Execute this script:

import pymupdf

src = pymupdf.open("sample.pdf")
doc = pymupdf.open()
doc.insert_pdf(doc, widgets=True, progress=1)

PyMuPDF version

1.26.3

Operating system

Other

Python version

3.13

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions