react-native-pdf icon indicating copy to clipboard operation
react-native-pdf copied to clipboard

PDF is coming blank

Open taatiq882 opened this issue 3 years ago • 4 comments

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",

taatiq882 avatar Jul 09 '22 23:07 taatiq882

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.

lucas-backes avatar Nov 21 '24 22:11 lucas-backes

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

zoobibackups avatar Dec 18 '24 07:12 zoobibackups

yeah experiencing this but it's inconsistent, i get it after a few tries..

harrisrobin avatar Mar 07 '25 13:03 harrisrobin

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]

lucianojsjr avatar Apr 25 '25 17:04 lucianojsjr