Skip to content

TextWriter: clarify precisely what warn=None/True/False do#4856

Merged
jamie-lemon merged 1 commit into
pymupdf:mainfrom
cbm755:clarify
Jan 8, 2026
Merged

TextWriter: clarify precisely what warn=None/True/False do#4856
jamie-lemon merged 1 commit into
pymupdf:mainfrom
cbm755:clarify

Conversation

@cbm755

@cbm755 cbm755 commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

It took me a while, and some testing, to figure out how to to use Shape.fill_textbox(warn=...) to NOT write the text when it doesn't fit. The secret sauce was warn=False, which means "raise an error". I didn't find this very clear until I read the source code.

Here's some edits; maybe they help!

@jamie-lemon jamie-lemon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks!

@jamie-lemon jamie-lemon merged commit 8cdc0e2 into pymupdf:main Jan 8, 2026
3 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jan 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants