react-native-pdf
react-native-pdf copied to clipboard
PDF preview not working on Android (but working on iOS)
Hello everyone!
-
Using
Expo SDK 51 -
react-nativeversion:"0.74.5" -
react-native-pdfversion:"6.7.5"
Code:
<View className="flex-1 items-center justify-center">
<Pdf
source={{
uri: file.uri,
cache: true,
}}
trustAllCerts={false}
onLoadComplete={(numberOfPages) => {
setPdfPages(numberOfPages)
}}
onPageChanged={(page) => {
setCurrentIndex(page - 1)
}}
style={{
width: PAGE_WIDTH,
height: PAGE_HEIGHT,
}}
horizontal
enablePaging
/>
</View>
On iOS, the onLoadComplete fires so I can set the number of pages 11 and swipe from page to another (swiped to page 2 below):
On android, the onLoadComplete doesn't fire and I can't swipe to other pages:
Thanks for the help!