pdfreact-native

Open PDF files from storage on React-Native


I need to open PDF files from storage. Using Expo 31.

I found rn-pdf-reader-js , but seesm it's dont work after last Expo update(31 version), I have error when I try to open pdf using <PDFReader />.

I tried react-native-pdf, but cant link react-native link rn-fetch-blob. I have error:

"rnpm-install ERR! Something went wrong while linking. Error: Cannot read property 'pbxprojPath' of null".

Then I used react-native-view-pdf, doesn't work too. Who can tell me how to open PDF files? Which exactly works now, and will work on all versions of Android (5+) and IOS?


Solution

  • react-native-pdf works fine for me on both iOS and Android. To fix the issue with it you mentioned,

    rnpm-install ERR! Something went wrong while linking. Error: Cannot read property 'pbxprojPath' of null

    It seems upgrading your react-native will resolve it.

    Running react-native upgrade and then react-native link should do the trick.