How to map the size of a page to real-life dimensions? #2163
-
Hii. Using For example, let us assume So Here I knew that the page is A4 and was able to perform the calculations manually. But what about arbitrary lengths, where the size is unknown or is not a standard paper size? How do PDF viewers like GNOME's Evince or KDE's Okular do it? Any kind of suggestions are highly appreciated. Thanks for reading! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
That's an easy answer:
Example for format "Letter": (612, 792). |
Beta Was this translation helpful? Give feedback.
That's an easy answer:
fitz.paper_sizes
a dictionary with key of paper format, like a4 or letter, and values of width and height - in portrait version.Example for format "Letter": (612, 792).
612 / 72 = 8.5 inches = 21.59 cm
width,792 / 72 = 11 inches = 27,94 cm
height.