-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFilledPDF.js
More file actions
87 lines (77 loc) · 2.62 KB
/
FilledPDF.js
File metadata and controls
87 lines (77 loc) · 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import React from 'react';
import { TouchableOpacity, TouchableHighlight, FlatList, ScrollView, Alert, StyleSheet, Text, View, Button, Image } from 'react-native';
import { createStackNavigator, createAppContainer } from 'react-navigation';
//import PDFView from 'react-native-view-pdf'
import PDFReader from 'rn-pdf-reader-js'
const resources = {
url: 'https://www.ets.org/Media/Tests/TOEFL/pdf/SampleQuestions.pdf',
base64: 'JVBERi0xLjMKJcfs...',
};
class FilledPDF extends React.Component {
render() {
const resourceType = 'base64';
return (
<View style={styles.container}>
<PDFReader source={{ uri: "https://s3-us-west-2.amazonaws.com/fhirblocksdocs/sample.pdf" }}/>
<TouchableOpacity
style={styles.button}
onPress={() => {
Alert.alert(
'FHIRBlocks asks...',
"Are you sure you want to sign the consent?",
[
{text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'},
{text: 'OK', onPress: () => {
console.log('OK Pressed');
Alert.alert(
'FHIRBlocks says...',
"Your consent has been signed and submitted. Thanks for using FHIRBlocks",
[{text: 'Continue', onPress: () =>{this.props.navigation.popToTop()}}]
);
},
}
],
{ cancelable: false }
);
}}>
<Text style={{fontSize: 32, color: 'white'}}>Sign the Form</Text>
</TouchableOpacity>
</View>
);
}
_showAlert = () => {
Alert.alert(
'Alert Title',
'My Alert Msg',
[
{text: 'Ask me later', onPress: () => console.log('Ask me later pressed')},
{text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'},
{text: 'OK', onPress: () => console.log('OK Pressed')},
],
{ cancelable: false }
)
}
}
const styles = StyleSheet.create({
titleText: {
fontSize: 32,
textAlign: 'left'
},
button: {
margin: 24,
padding: 40,
borderRadius: 15,
borderWidth: 1,
borderColor: "transparent",
fontWeight: 'bold',
textAlign: 'center',
color: '#34495e',
backgroundColor: '#ff6666'
},
container: {
flex: 1,
paddingTop: 30,
backgroundColor: '#ecf0f1',
}
});
export default FilledPDF;