1

im trying to show a file using react-native-pdf i pass the base 64 to to the component . and it works for most pdfs. but for 1 of them it doesnt . for the pdf that doesnt work on ios, it works on android.

i tried with and without caching. tried separating the react native pdf and the react-native-blob-util , but nothing worked. any help plz ?

setSource({uri:`data:application/pdf;base64,${documentBinary}`, cache:false})

<Pdf
                              style={styles.pdf}
                              source={source}
                              onLoadComplete={(numberOfPages, filePath)=>{
                                   console.log(`number of pages: ${numberOfPages}`);
                                   console.log(`cache path: ${filePath}`)
                                   
                                   if(currentDocument != null){
                                        cachedFilesMap.setItem(currentDocument.docNum, filePath)
                                   }
                              }}
                              onPageChanged={(page,numberOfPages)=>{
                                   console.log(`current page: ${page}`);
                              }}
                              onError={(error)=>{
                                   console.log(error);
                              }}
                              onPressLink={(uri)=>{
                                   console.log(`Link presse: ${uri}`)
                              }}
                         />

0 Answers0