react-native-pdf icon indicating copy to clipboard operation
react-native-pdf copied to clipboard

Negative progress on downloading PDF

Open Zygro opened this issue 3 years ago • 6 comments

What react-native version are you using? 0.64.2

What react-native-pdf version are you using? 6.4.0

What platform does your issue occur on? (android/ios/both) mostly iOS, Android has some other weirdness

Describe your issue as precisely as possible : on iOS: I download PDF from a URL, for some reason the progress starts at 0 and then jumps to a large negative number (I got -29491 or -6590) and then finishes. on Android: Progress only puts -0 value twice and then stops.

the component looks like:

    <Pdf
      source={{uri: url, cache: false, headers: headers || {}}}
      fitPolicy={0}
      maxScale={100}
      onError={(error) => {
        // handle Error
      }}
      onLoadProgress={(progress) => console.log(progress)}
      renderActivityIndicator={() => <ActivityIndicator />}
    />

I'd prefer activity indicator to be a progress bar or percentage number, so I'd like to figure out where is the problem.

Zygro avatar Jan 03 '22 15:01 Zygro

for percentage, it has been fixed, just not deployed yet. edit it on the library's index.js here some reference #612 & #613

gwijaya94 avatar Jan 04 '22 09:01 gwijaya94

for percentage, it has been fixed, just not deployed yet. edit it on the library's index.js here some reference #612 & #613

Maybe not exactly related but even with that commit added, progress is always 0 for me.

sadikyalcin avatar Jan 10 '22 12:01 sadikyalcin

I am getting the same issue. Is it fixed yet?

nithinjc avatar Jan 19 '22 16:01 nithinjc

just open my project again, and it happens again, And I checked there's problem with the Blob usage with the progress return its total always -1. I tried using the same Blob method as this library, but the result not -1, but the exact value that we need as total.

using react-native-blob-util : 0.13.18

maybe there's config that make it return -1? @wonday

gwijaya94 avatar Jan 30 '22 17:01 gwijaya94

Same issue on latest 6.5.0 version, I have a loading progress like -3674900,00%

Turtleted21 avatar May 03 '22 09:05 Turtleted21

how to fix it?

hatyaiapp avatar Jul 12 '22 09:07 hatyaiapp