Replies: 2 comments
-
@araichev |
Beta Was this translation helpful? Give feedback.
-
First you have to know that PDF pages have several boxes:
You can get those like this: >>> from PyPDF2 import PdfReader
>>> reader = PdfReader("issue-856.pdf")
>>> reader.pages[0].mediabox
RectangleObject([0, 0, 595.276, 841.89]) The specs say:
Chapter 4:
You will be able to access a pages user_unit after the next release (see #1336 ) more conveniently. So the example page above has a media-box of a height of 841.89 * (1/72) inch and a width of 595.276 * (1/72) inch. You could compare against |
Beta Was this translation helpful? Give feedback.
-
Couldn't find this feature in the docs and wondering if it's possible, because sometimes i want to check if a PDF is size A4 or A3.
Beta Was this translation helpful? Give feedback.
All reactions