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

Issue with spaces in file names

Open barun1997 opened this issue 4 years ago • 3 comments

What react-native version are you using? 0.68.0

What react-native-pdf version are you using? 6.5.0

What platform does your issue occur on? (android/ios/both) iOS

Describe your issue as precisely as possible :

  1. Try previewing a PDF file with a space in the name

It returns load error

barun1997 avatar Apr 12 '22 06:04 barun1997

I am not familiar with Native code, but this is my diagnosis so far (with help from parasharrajat)

It seems that on Android, we parse the file path, however, on iOs returns a further encoded URI string which throws an error.

I checked what this line returns if it's given an encoded URI string of: ...Sample%20file.pdf and it is: ...Sample%2520file.pdf

This is the reason why for any file with a space in its name, the pdf ref is null.

barun1997 avatar Apr 12 '22 06:04 barun1997

I have the same problem on iOS, even if I get uri the file isn't displayed, just without spaces.

dragoshuniq avatar Apr 24 '22 07:04 dragoshuniq

Is this duplicated? https://github.com/wonday/react-native-pdf/issues/488

Drzaln avatar Apr 26 '22 05:04 Drzaln