PDF reader for Expo
npm install @pstyczynski/react-native-expo-pdfjsAndroid support 🚀
``javascript
import React from 'react';
import { StyleSheet, View } from 'react-native';
import PDFReader from 'rn-pdf-reader-js';
import { Constants } from 'expo';
export default class App extends React.Component {
render() {
return (
/>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
paddingTop: Constants.statusBarHeight,
backgroundColor: '#ecf0f1',
},
});
`
* uri?: string - can be local or served on the web (ie. start withs https:// or file://)
* base64?: string - should start with data:application/pdf;base64,. A base64 encoded pdf file tends to start with JVBERi0xL so your complete string should look soemthing like this: data:application/pdf;base64,JVBERi0xL...
* style: object - style props to override default container style
* webviewStyle: object - style props to override default WebView style
* onLoad: func - callback that runs after WebView is loaded
* noLoader: boolean - show/hide the ActivityIndicator. Default is falseRequirements
* Use it into Expo app (from expo client, Standalone app or ExpoKit app).
* Because we need to have access to Expo.FileSystem`* react-pdf (pdf.js)
* WebView
* Expo FileSystem API
* Base64