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

onLoadComplete not Working on sdk 35

Open agilsagita opened this issue 1 year ago • 7 comments

When i try ti use

<Pdf trustAllCerts={false} source={PdfResource} style={[styles.pdf, { opacity: loadProgress < 1 ? 0 : 1 }]} onLoadComplete={(numberOfPages) => { console.log(Number of pages: ${numberOfPages}); setTotalPages(numberOfPages); setLoadProgress(1); }} onLoadProgress={(progress) => { setLoadProgress(progress); }} onPageChanged={(page, numberOfPages) => { setCurrentPage(page);

          if (numberOfPages < 10 && page === numberOfPages) {
            setReachedLastPage(true);
          } else if (numberOfPages >= 10 && page >= 10) {
            setReachedLastPage(true);
          }
        }}
        onError={(error) => {
          console.error("PDF Error:", error);
        }}
      />

agilsagita avatar Jul 03 '25 04:07 agilsagita

facing same issue when i upgraded my app to react native 0.79 (bridge mode)

SatyamBansal avatar Jul 06 '25 19:07 SatyamBansal

yes facing same issue with new RN 0.77 also

laxy7698 avatar Jul 08 '25 10:07 laxy7698

Seems to be related to https://github.com/wonday/react-native-pdf/issues/899

ChinKX avatar Jul 10 '25 02:07 ChinKX

Seems to be related to #899

I think it is. Downgrading to 6.7.5 works for me. 6.7.6 and 6.7.7 doesn't.

expo: 53.0.17 raect-native: 0.79.5

luisbarrientosf avatar Jul 23 '25 14:07 luisbarrientosf

this patch worked for me

SatyamBansal avatar Jul 23 '25 15:07 SatyamBansal

Same here on RN77. We downgrade from 6.7.7 to 6.7.5.

Stephane-Parent avatar Aug 01 '25 18:08 Stephane-Parent

We forked this package and version is 6.4.0. RN version is 0.66.5 and compileSdkVersion = 35 In the application compiled with compileSdkVersion = 35 onLoadComplete is working on android 13+ versions but not working android 10 devices.

hcrnln avatar Oct 08 '25 17:10 hcrnln