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

Setting pageNumber in setNativeProps crashes app (Android Only)

Open bhumit1709 opened this issue 9 years ago • 1 comments

I am setting pageNumber in setNativeProps so that pdf directly opens to that particular page using following code, This works for zoom . iOS works fine and pdf is loaded with 2nd page but crashes the app on Android.

  <PDFView ref={(pdf)=>{this.pdfView = pdf;}}
                     key="sop"
                     path={this.pdfPath}
                     onLoadComplete = {(pageCount)=>{
                        console.log(`total page count: ${pageCount}`);
                        this.pdfView.setNativeProps({
                            pageNumber: 2
                        });

                     }}
                     style={styles.pdf}/>

bhumit1709 avatar Aug 01 '16 11:08 bhumit1709

<PDFView ref={(pdf)=>{this.pdfView = pdf;}}
                         path={this.state.pdfLocation}
                         onLoadComplete = {(pageCount)=>{
                            this.pdfView.setNativeProps({
                                zoom: 1.5
                            });
                         }}
                         pageNumber= {1}
                         style={styles.pdf}/>

Phenek avatar Mar 28 '17 09:03 Phenek