Open giovanijfc opened 1 year ago
same problem
iOS 16.4
"react": "18.2.0",
"react-native": "0.71.8",
"react-native-blob-util": "^0.18.3",
"react-native-pdf": "^6.7.1",
Anyone got this working already?
Got it working with: https://github.com/RonRadtke/react-native-blob-util/issues/267#issuecomment-1831006781
Removing newlines from the base64 string did the trick:
pdfString.replace(/\r?\n|\r/g, '');
What
react-native
version are you using? 0.68.7What
react-native-pdf
version are you using? 6.6.2What platform does your issue occur on? (android/ios/both) ios
Describe your issue as precisely as possible : I am adapting my app to work on iOS, currently I only use React Native for Android.
In my PDFViewer component, I have the use of PDFs in base64 and also URLs. However, when I use base64 on iOS, I receive the following error:
[Error: File '/Users/admin/Library/Developer/CoreSimulator/Devices/396FECD1-3C30-4CB4-A364-B40349C0B842/data/Containers/Data/Application/E7B94EF8-20BB-4DAB-BF80-DEE85EB1D4AA/Library/Caches/17ae4692b07f2175cab6ba4b1fbf3bb8cee1a096.pdf' could not be written.]
When using a PDF URL, I have no problems. To reproduce, you can try using a PDF in base64 on iOS. I am testing it on the simulator as I don't have a physical device.
Join a screenshot or video of the problem on the simulator or device? ...
Show us the code you are using?