Skip to content

page format: raise a clear error for a width or height that is not po… - #2077

Merged
andersonhc merged 1 commit into
py-pdf:masterfrom
RavSinghChandan:page-format-non-positive
Oct 28, 2026
Merged

andersonhc merged 1 commit into
py-pdf:masterfrom
RavSinghChandan:page-format-non-positive

Conversation

@RavSinghChandan

Copy link
Copy Markdown

add_page(format=(0, 0)) wrote /MediaBox [0 0 0 0], and a negative size an inverted box. get_page_format() now raises FPDFPageFormatException: Width and height must be positive numbers, next to its existing "Arguments must be numbers" check.

  • 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 daf78c5 into py-pdf:master Oct 28, 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