Original width and height issue #901
-
F-8879.pdf So, I would like to know how we can get the exact dimensions (originalHeight & originalWidth) of our pdf. For Instance, When I open my PDF file in Adobe Acrobat Reader then it shows the size as 8.50 x 11.00 inches (i.e 816 x 1056 px). When I load the same pdf in my application using react-pdf then it renders by 612 x 792.008 px. I have also tried the following onRenderSuccess function in Page component, but no luck.
Results: width 612 The above results are not returning values as per my expectation. So, could anyone please help me out to find out the exact size of the PDF file using react-pdf library? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Huh, that's interesting. I opened this file in Mozilla Firefox and it rendered correctly at 816 x 1056px, despite dimensions being reported as 612 x 792.008px in |
Beta Was this translation helpful? Give feedback.
-
Is there a way to get 816 x 1056px using react-pdf? |
Beta Was this translation helpful? Give feedback.
-
For anyone looking for the answer to this issue. The numbers posted above are correct but they aren't in pixels (px), they are in points (pt). There is 72pt per inch. So if you do a quick bit of math 612 / 72 = 8.50 and 792 / 72 = 11. |
Beta Was this translation helpful? Give feedback.
For anyone looking for the answer to this issue. The numbers posted above are correct but they aren't in pixels (px), they are in points (pt). There is 72pt per inch. So if you do a quick bit of math 612 / 72 = 8.50 and 792 / 72 = 11.