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

PDF preview issue in Android & iOS

Open Aditya402 opened this issue 1 year ago • 7 comments

What react-native version are you using? 0.69.1

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

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

Describe your issue as precisely as possible :

  1. Steps to reproduce the issue or to explain in which case you get the issue I am getting blank page when clicking preview button .

<View style={styles.container}> <Pdf source={source} onLoadComplete={(numberOfPages,filePath) => { console.log(Number of pages: ${numberOfPages}); }} onPageChanged={(page,numberOfPages) => { console.log(Current page: ${page}); }} onError={(error) => { console.log(error); }} onPressLink={(uri) => { console.log(Link pressed: ${uri}); }} style={styles.pdf}/> </View>

  1. Interesting logs

No logs are coming

Join a screenshot or video of the problem on the simulator or device?

Show us the code you are using?

`const readContent = async (uri: string) => { try { const content = await RNFS.readFile(uri, 'base64'); console.log('Content of the file:', content); contentUri = content; // Handle the content as needed } catch (error) { console.error('Error reading content:', error); } };

const renderPdf = useCallback(() => { console.log('docInfo', docInfo),

  readContent(docInfo?.uri),
  console.log('docInfo', `data:${docInfo?.type};base64,${contentUri}`),

  docInfo?.name === "" ?
    <View style={styles.mainPDFcontainer}>
      <Pdf source={{ uri: docInfo?.uri }} style={styles.pdfContainer} />
    </View> :
    <View style={styles.mainPDFcontainer}>
      <Pdf source={{ uri: `data:${docInfo?.type};base64,${contentUri}` }} style={styles.pdfContainer} />
    </View>

}, [contentUri]); ` Screenshot_1700573677 Simulator Screenshot - iPhone 13 - 2023-11-21 at 19 10 56

Aditya402 avatar Nov 21 '23 13:11 Aditya402

I am experiencing the same issue on Android and iOS

henderson2350 avatar Nov 21 '23 21:11 henderson2350

I am experiencing the same issue on Android and iOS

MUSHTHAK2899 avatar Nov 23 '23 11:11 MUSHTHAK2899

Hi guys , I have the same problem, but it only happens to me on iOS when but only when I publish the app

React native 0.66.5 react-native-pdf 6.7.3

IMG_9456

ljosorio avatar Nov 24 '23 21:11 ljosorio

Experiencing same issue

cgtorniado avatar Nov 28 '23 03:11 cgtorniado

Same issue here, except no problems on iOS side. Android only

abanobmikaeel avatar Jan 19 '24 02:01 abanobmikaeel

same issue on Android, the percentage loader seems to indicate the file is downloading, but then i see no preview of the pdf just a blank screen

rieg-ec avatar Mar 31 '24 17:03 rieg-ec