PDF is coming blank
I am getting file path from [react-native-document-picker] for example
file:///private/var/mobile/Containers/Data/Application/6B63EB72-A6DB-4413-87AE-DF2A4721FCC1/tmp/org.mstqb-rise.com-Inbox/2022-02-04%206-58%20PM%201.pdf
const source = { uri: item.filePath, cache: false }; <Pdf source={source} style={styles.pdf}/>
The error which I am getting is [Error: Load pdf failed. path=/private/var/mobile/Containers/Data/Application/6B63EB72-A6DB-4413-87AE-DF2A4721FCC1/tmp/org.mstqb-rise.com-Inbox/2022-02-04%206-58%20PM%201.pdf]
"react-native": "0.67.3", "react-native-pdf": "^6.5.0", "react-native-blob-util": "^0.16.2",
I think i'm facing the same problem.
First, it didn't open some PDF files, giving me this error, so i was investigating and got to fix it by encoding the URI with encodeURI js function.
Now, it works for some time, but after a minute or two, i start to get this Load pdf failed error to all files i have.
PS: It just happens on iOS and I am using react-native-document-picker to get PDF files from users phone.
I am using latest version = 6.7.5
EDIT:
It was a problem with document-picker mode, it didn't support long term access.
same issue here PDF Loaded: {"height": undefined, "numberOfPages": 1, "width": undefined} URI file:///var/mobile/Containers/Data/Application/2A435227-4285-45E3-A6C7-40742A487D34/Documents/CamScanner/Documents/CamScan001.pdf I create my on pdf file with images but blank pdf show Help
yeah experiencing this but it's inconsistent, i get it after a few tries..
I am also getting the same error. I tried to upload a public PDF from Mozilla and the following error appeared:
[Error: DownloadFailed:https://blog.mozilla.org/security/files/2015/05/HTTPS-FAQ.pdf] [Error: Load pdf failed. path=/var/mobile/Containers/Data/Application/1EFEE31E-F859-4587-A177-4226C41A7FB3/Library/Caches/cc68f43b9fa781e411f385972a3b5c37e56d4ff4.pdf]