wonday / react-native-pdf

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

PDF Viewer is blank using base64 source #759

Closed allandallopez closed 1 year ago

allandallopez commented 1 year ago

What react-native version are you using? 0.71.8

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

What platform does your issue occur on? (android)

Describe your issue as precisely as possible : 1) Steps to reproduce the issue or to explain in which case you get the issue: I just following the example code for this github

     <View style={styles.container}>
                <Pdf
                    source={source}
                    onLoadComplete={(numberOfPages,filePath) => {
                        console.log(`Number of pages: ${numberOfPages}`);
                    }}
                    onPageChanged={(page,numberOfPages) => {
                        console.log(`Current page: ${page}`);
                    }}
                    onError={(error) => {
                        console.log(error);
                    }}
                    onPressLink={(uri) => {
                        console.log(`Link pressed: ${uri}`);
                    }}
                    style={styles.pdf}/>
         </View>

for the source Im using this PDF file that already converted to base64 string samplepdf and its blank nothing happend. I got no result from it, even there is no error on the log

2) Interesting logs : No logs occure when it happen

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

Show us the code you are using?

   import Pdf from 'react-native-pdf';

    const source = {
         uri: base64Source,
     };
     <View style={styles.container}>
                <Pdf
                    source={source}
                    onLoadComplete={(numberOfPages,filePath) => {
                        console.log(`Number of pages: ${numberOfPages}`);
                    }}
                    onPageChanged={(page,numberOfPages) => {
                        console.log(`Current page: ${page}`);
                    }}
                    onError={(error) => {
                        console.log(error);
                    }}
                    onPressLink={(uri) => {
                        console.log(`Link pressed: ${uri}`);
                    }}
                    style={styles.pdf}/>
         </View>
vipulparmarmt commented 1 year ago

How you solved this issue on Andriod ????