Thank you – perhaps this is indeed the issue. However, for some reason, when I load an external PDF file (one hosted on a remote server) it works. It’s just the local files that don’t work.
Do you have a solution that I could use, or any suggestions for things to try?
Yes, the problem is specifically with loading local files.
If you are hosting the PDF on a remote server, the server will return the Content-Type in the HTTP headers.
One thing you could try is include a simple web server within your app. I have not tried this myself:
Install it with npm or yarn. Skip the react-native link step. Make sure you build with EAS Build and run a custom dev client instead of Expo Go.
I think you could use expo-file-system instead of react-native-fs.