When I try to get width and height of the page, I encounter a problem: width and height are misplaced in SOME (but not all!) of the PDFs. The page looks like completely normal A4 portrait document, but using reader.pages[0].mediabox returns wrong dimensions [0, 0, 841.68, 595.2] instead of [0, 0, 595.2, 841.68]
Environment
Which environment were you using when you encountered the problem?
$ python -m platform
# macOS-12.5.1-arm64-arm-64bit
# and also on every system on docker (Ubuntu, CentOS)
$ python -c "import PyPDF2;print(PyPDF2.__version__)"
# 2.10.3
Code + PDF
This is a minimal, complete example that shows the issue:
from PyPDF2 import PdfReader
reader = PdfReader(path)
dimensions = reader.pages[0].mediabox
width = dimensions.width
height = dimensions.height
dim.pdf
I removed sensitive data.
Output

When I try to get width and height of the page, I encounter a problem: width and height are misplaced in SOME (but not all!) of the PDFs. The page looks like completely normal A4 portrait document, but using
reader.pages[0].mediaboxreturns wrong dimensions[0, 0, 841.68, 595.2]instead of[0, 0, 595.2, 841.68]Environment
Which environment were you using when you encountered the problem?
Code + PDF
This is a minimal, complete example that shows the issue:
dim.pdf
I removed sensitive data.
Output