Skip to content

set_display_mode: raise a clear error for a negative or non-numeric zoom - #2079

Merged
andersonhc merged 1 commit into
py-pdf:masterfrom
RavSinghChandan:display-mode-invalid-zoom
Oct 29, 2026
Merged

andersonhc merged 1 commit into
py-pdf:masterfrom
RavSinghChandan:display-mode-invalid-zoom

Conversation

@RavSinghChandan

Copy link
Copy Markdown

set_display_mode(-50) wrote /OpenAction [... /XYZ null null -0.5], and set_display_mode(None) failed later in output() with a TypeError. Both now raise FPDFException: Incorrect zoom display mode, like an unknown zoom name. Zero is still accepted (the specification treats it as "keep the current zoom").

  • A unit test is covering the code added / modified by this PR
  • A mention of the change is present in CHANGELOG.md
  • This PR is ready to be merged

@andersonhc
andersonhc merged commit 69c8742 into py-pdf:master Oct 29, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants