Open SayaliEdulab opened 1 year ago
Exact same problem here...
I tried to do the same trick as this issue : https://github.com/react-native-webview/react-native-webview/issues/2920 But didn't work for me.
Create your own component name PdfReader
and copy the all code from rn-pdf-reader-js\lib\index.js
replace the line source: renderedOnce || !isAndroid ? source : undefined
with source: renderedOnce || !isAndroid ? source : { uri: undefined }
copy the bundleContainer.js to components directory
Its working well in IOS and Android
<PdfReader
style={{ flexGrow: 1 }}
source={{
uri: pdfUrl,
}}
/>
Happy Coding!
Create your own component name
PdfReader
and copy the all code fromrn-pdf-reader-js\lib\index.js
replace the linesource: renderedOnce || !isAndroid ? source : undefined
withsource: renderedOnce || !isAndroid ? source : { uri: undefined }
copy the bundleContainer.js to components directory
Its working well in IOS and Android
<PdfReader style={{ flexGrow: 1 }} source={{ uri: pdfUrl, }} />
Happy Coding!
Resolveu, muito obrigado!
Create your own component name
PdfReader
and copy the all code fromrn-pdf-reader-js\lib\index.js
replace the linesource: renderedOnce || !isAndroid ? source : undefined
withsource: renderedOnce || !isAndroid ? source : { uri: undefined }
copy the bundleContainer.js to components directory
Its working well in IOS and Android
<PdfReader style={{ flexGrow: 1 }} source={{ uri: pdfUrl, }} />
Happy Coding!
Thanks for the solution ! @xcarpentier hi, can you merge this fix on Master ?
Issue Description
while loading pdf in this package we getting error in android and white screen in the IOS
In android
Steps to Reproduce / Code Snippets
//import libraries import { NavigationContainer } from '@react-navigation/native'; import React, { Component } from 'react'; import { View, Text, StyleSheet } from 'react-native'; import PDFReader from 'rn-pdf-reader-js'
// create a component const PdfViewer = (props) => {
};
//make this component available to the app export default PdfViewer;
Expected Results
view pdf
Additional Information