wonday / react-native-pdf

A <Pdf /> component for react-native
MIT License
1.58k stars 540 forks source link

onPageChanged bug #720

Open luicfrr opened 1 year ago

luicfrr commented 1 year ago

What react-native version are you using? 0.70.5

What react-native-pdf version are you using? ^6.6.2

What platform does your issue occur on? (android/ios/both) both

Describe your issue as precisely as possible :

I had notice this issue opening a horizontal pdf with only 2 pages but this hapens with any pdf. I've tryed setting enablePaging but doesn't fix too With onPageChange event I've created a function to log current page and total pages, what I noticed is:

Join a screenshot or video of the problem on the simulator or device?

Mar-08-2023 14-38-27

Show us the code you are using?

<Pdf
   trustAllCerts={ false }
   source={ {
      uri: documentUrl,
         cache: true
       } }
   style={ S.Pdf }
   enablePaging
   onPageChanged={ (
      page,
      numberOfPages
   ) => {
      console.log( 'current', page, 'total', numberOfPages )
      if ( documentReaded ) return
      setDocumentReaded( () => page === numberOfPages )
   } }
   onError={ () => console.log('error .....')}
/>
luicfrr commented 1 year ago

I think this project is abandoned....