0

I am trying to open a open a pdf in my application through react-native-pdf. I am able to see current page number and total page number in debug console. But my pdf is not opening in my application. If you have any solution, please answer.

Here I have attached my code

 <View>
    {selectedDoc?.contentType === 'application/pdf' && (
      <Pdf
        trustAllCerts={false}
        source={source}
        onLoadComplete={(numberOfPages) => {
          console.log(`Number of pages: ${numberOfPages}`);
        }}
        onPageChanged={(page) => {
          console.log(`Current page: ${page}`);
        }}
        onError={(error) => console.log(error, 'error')}
        style={{
          flex: 1,
          width: Dimensions.get('window').width,
        }}
      />
    )}
  </View>

My debug console is looking like this

Number of pages: 1

Current page: 1

my react and react native version

"react-native": "0.69.5",
 "react": "18.0.0",

I am not getting any error in console, but my pdf is not opening.

0 Answers0