react-native-pdf-view
Advanced tools
Comparing version 0.1.1 to 0.1.2
{ | ||
"name": "react-native-pdf-view", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "view pdf file using react-native", | ||
@@ -5,0 +5,0 @@ "main": "PDFView.js", |
# react-native-pdf-view | ||
React Native PDF View | ||
### Installation | ||
```bash | ||
npm i react-native-pdf-view --save | ||
``` | ||
### Usage | ||
First, require it from your app's JavaScript files with: | ||
```bash | ||
import PDFView from 'react-native-pdf-view'; | ||
``` | ||
### Example | ||
```js | ||
'use strict'; | ||
import React,{ | ||
Component, | ||
StyleSheet, | ||
View | ||
} from 'react-native'; | ||
import PDFView from 'react-native-pdf-view'; | ||
export default class PDF extends Component { | ||
constructor(props) { | ||
super(props); | ||
} | ||
render(){ | ||
<PDFView ref={(pdf)=>{this.pdfView = pdf;}} | ||
src={"sdcard/pdffile.pdf"} | ||
onLoadComplete = {()=>{ | ||
this.pdfView.setNativeProps({ | ||
zoom: 1.5 | ||
}); | ||
}} | ||
style={styles.pdf}/> | ||
} | ||
} | ||
var styles = StyleSheet.create({ | ||
pdf: { | ||
flex:1 | ||
} | ||
}); | ||
``` | ||
### Configuration | ||
| Property | Type | Default | Description | | ||
| ------------- |:-------------:|:------------: | ----------- | | ||
| src | string | null | pdf absolute path | ||
| pageNumber | number | 1 | page index | ||
| zoom | number | 1.0 | zoom scale | ||
| onLoadComplete | function | null | page load complete |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
79480989
62