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 followed instructions in documentation written for my React-PDF version
I have checked if this bug is not already reported
I have checked if an issue is not listed in Known issues
If I have a problem with PDF rendering, I checked if my PDF renders properly in PDF.js demo
Description
I am trying to create a progress bar which displays while the pdf is loading. When fetching a large pdf from a url, the total attribute of the onLoadProgress callback is NaN until the very end, when the pdf is fully loaded (which defeats the purpose of a loading bar).
I suspect this is not really a bug, but I'm wondering how/whether it's possible to get the total by some other means. Otherwise, I can just use a spinning wheel, but the progress bar is obviously better.
Steps to reproduce
Try to load a large pdf by supplying its url to the file prop. Then log the onLoadProgress callback's total attribute.
Expected behavior
Ideally it should compute the total for the fetched document somehow (perhaps using the headers?)
Actual behavior
It set as NaN until the very end. loaded works just fine.
Additional information
No response
Environment
Browser (if applicable):
React-PDF version:
React version:
Webpack version (if applicable):
The text was updated successfully, but these errors were encountered:
Before you start - checklist
Description
I am trying to create a progress bar which displays while the pdf is loading. When fetching a large pdf from a url, the
total
attribute of theonLoadProgress
callback isNaN
until the very end, when the pdf is fully loaded (which defeats the purpose of a loading bar).I suspect this is not really a bug, but I'm wondering how/whether it's possible to get the
total
by some other means. Otherwise, I can just use a spinning wheel, but the progress bar is obviously better.Steps to reproduce
Try to load a large pdf by supplying its url to the
file
prop. Then log the onLoadProgress callback'stotal
attribute.Expected behavior
Ideally it should compute the
total
for the fetched document somehow (perhaps using the headers?)Actual behavior
It set as
NaN
until the very end.loaded
works just fine.Additional information
No response
Environment
The text was updated successfully, but these errors were encountered: