Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork167
📄 PDF reader in JavaScript only for Expo - Android & iOS capable
License
NotificationsYou must be signed in to change notification settings
xcarpentier/rn-pdf-reader-js
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Android support 🚀
- 👉Install react-native-webview on your own!
- 👉Install expo-file-system on your own!
- 👉Install expo-constants on your own!
- Use it into Expo app (from expo client, Standalone app or ExpoKit app).
- Only React-Native 0.59-0.60+ support,Expo SDK 33-36+
import*asReactfrom'react'import{View}from'react-native'importPDFReaderfrom'rn-pdf-reader-js'exportdefaultclassAppextendsReact.Component{render(){return(<PDFReadersource={{uri:'http://gahp.net/wp-content/uploads/2017/09/sample.pdf',}}/>)}}
See more detailed example intoApp.tsx file.
interfaceSource{uri?:string// can be local or served on the web (ie. start with `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 something like this: `data:application/pdf;base64,JVBERi0xL...`headers?:{[key:string]:string}}interfaceProps{source:Sourcestyle?:View['props']['style']// style props to override default container stylewebviewStyle?:WebView['props']['style']// style props to override default WebView stylewebviewProps?:WebView['props']noLoader?:booleanuseGoogleReader?:boolean// If you are not worried about confidentialitywithScroll?:boolean// Can cause performance issuewithPinchZoom?:booleancustomStyle?:{readerContainer?:CSS.PropertiesreaderContainerDocument?:CSS.PropertiesreaderContainerNumbers?:CSS.PropertiesreaderContainerNumbersContent?:CSS.PropertiesreaderContainerZoomContainer?:CSS.PropertiesreaderContainerZoomContainerButton?:CSS.PropertiesreaderContainerNavigate?:CSS.PropertiesreaderContainerNavigateArrow?:CSS.Properties}onLoad?():void// callback that runs after WebView is loadedonLoadEnd?():void// callback that runs after WebView is loadedonError?():void// callback that runs when WebView is on error}
| Render type | Platform | Source prop |
|---|---|---|
| Custom PDF reader | Android | uri or base64 |
| Direct from WebView | iOS | uri or base64 |
| Google PDF Reader | Android, iOS | uri |
- react-pdf (pdf.js)
- WebView
- Base64
Looking for a ReactNative freelance expert with more than 12 years experience? Contact me from my website!
About
📄 PDF reader in JavaScript only for Expo - Android & iOS capable
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
No packages published