From 9f6745407ec9c3620951e2594760357864e77cc4 Mon Sep 17 00:00:00 2001 From: hek3 Date: Wed, 20 Mar 2024 04:58:25 -0400 Subject: [PATCH 1/2] kaiwen --- HackRPIEventApp2023/App.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/HackRPIEventApp2023/App.js b/HackRPIEventApp2023/App.js index a6e9844..d1f70a8 100644 --- a/HackRPIEventApp2023/App.js +++ b/HackRPIEventApp2023/App.js @@ -12,6 +12,35 @@ import { globalStyles } from "./styles"; const Tab = createBottomTabNavigator(); + +import { SafeAreaView, Dimensions } from 'react-native'; +import Pdf from 'react-native-pdf'; +/* +Import this new component into the appropriate screen where you want the +PDF to be displayed. You would add a Tab.Screen for the PDF viewer in your +Tab.Navigator if you want it to be accessible from the tab bar, or you might +integrate it into one of your existing screen. + */ +const PDFViewer = ({ uri }) => { + const source = { uri, cache: true }; + return ( + + { + console.log(`Number of pages: ${numberOfPages}`); + }} + onPageChanged={(page, numberOfPages) => { + console.log(`Current page: ${page}`); + }} + onError={(error) => { + console.log(error); + }} + style={{ flex: 1, width: Dimensions.get('window').width }} + /> + + ); +} function InfoScreen() { return ( From 29c55affdb55e62149513b6b07138231b688bc77 Mon Sep 17 00:00:00 2001 From: hek3 Date: Wed, 20 Mar 2024 16:15:34 -0400 Subject: [PATCH 2/2] kaiwen --- HackRPIEventApp2023/App.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HackRPIEventApp2023/App.js b/HackRPIEventApp2023/App.js index d1f70a8..2b5f00c 100644 --- a/HackRPIEventApp2023/App.js +++ b/HackRPIEventApp2023/App.js @@ -19,7 +19,7 @@ import Pdf from 'react-native-pdf'; Import this new component into the appropriate screen where you want the PDF to be displayed. You would add a Tab.Screen for the PDF viewer in your Tab.Navigator if you want it to be accessible from the tab bar, or you might -integrate it into one of your existing screen. +integrate it into one of your existing screen */ const PDFViewer = ({ uri }) => { const source = { uri, cache: true };