You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am displaying a PDF file, they are single-page files, but I would like to be able to access the file's dimensions so I can calculate the zoom level. I didn't see anything in the documentation about reading a file's data once loaded.
Additional information
I would like to read the data from the file anytime before it's rendered.
Environment
React-PDF version 4.1.0
React version 16.8
Webpack version (CRA 3.2.0)
The text was updated successfully, but these errors were encountered:
SandMoshi
changed the title
Is there a way to access a file's dimensions?
Is there a way to access a page's dimensions?
Jan 15, 2020
Yes, absolutely. <Page />'s onLoadSuccess callback gets page object as an argument, and said object contains everything you need: width, height (scaled - as rendered), originalWidth, originalHeight (original).
What are you trying to achieve? Please describe.
I am displaying a PDF file, they are single-page files, but I would like to be able to access the file's dimensions so I can calculate the zoom level. I didn't see anything in the documentation about reading a file's data once loaded.
Additional information
I would like to read the data from the file anytime before it's rendered.
Environment
The text was updated successfully, but these errors were encountered: