im trying to load pdf using react-native-pdf it works for most of the pdfs, but for some it throws an error "load pdf failed" i am getting the pdf in base64 state and pass it to react-native-pdf.
ive looked everywhere and cant find a fix. any idea how to solve this ?
my code:
setSource({uri:`data:application/pdf;base64,${documentBinary}`, cache:true})
<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}`)
}}
/>
thnx