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

onPageChanged bug

Open luicfrr opened this issue 2 years ago • 1 comments

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:

  • When the pdf opens it logs current 1, total X, if you change to page 2 the log repeats current 1, total X and if you go to page 3 it logs current 3, total X. I also noticed the logs are beeing duplicated after the second log of page 1. Changing pages back gives an error, the page count goes to a very high number before reach page 1 again

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 avatar Mar 08 '23 17:03 luicfrr

I think this project is abandoned....

luicfrr avatar Apr 06 '23 11:04 luicfrr