0

I want to load my local PDF in PDF view so i am using this plugin for that https://www.npmjs.com/package/react-native-pdf

So below is my code

let finalURL = require('../../html/html/pdf/VIVJOA-Full-Prescribing-Information.pdf')
const source = {
 uri: finalURL,
 cache: true,
};


<Pdf
    trustAllCerts={false}
    source={source}
    style={styles.pdf}  
  />

When i run above code in iOS it give me error like Warning: Failed prop type: Invalid prop source supplied to Pdf, expected one of type [string, number]..

Any idea how can i solve this?

Harshal Kalavadiya
  • 2,412
  • 4
  • 38
  • 71

1 Answers1

1

add only url in the source:

let finalURL = require('../../html/html/pdf/VIVJOA-Full-Prescribing-Information.pdf')


<Pdf
    trustAllCerts={false}
    source={finalURL}
    style={styles.pdf}  
  />
Jatin Bhuva
  • 1,301
  • 1
  • 4
  • 22