react-native-pure-doc-browser

react native doc browser

Usage no npm install needed!

<script type="module">
  import reactNativePureDocBrowser from 'https://cdn.skypack.dev/react-native-pure-doc-browser';
</script>

README

react-native-pure-doc-browser

This is a module which help you preview a document file, such as word, excel, ppt and pdf.

Installation

npm i react-native-pure-doc-browser

// link below 0.60 version
react-native link react-native-pure-doc-browser

Usage

import {
  CODE,
  open,
} from 'react-native-pure-doc-browser'

open({
  path: 'local file path',
  // mimeType is android only
  mimeType: 'application/pdf'
})
.then(() => {
  // success
})
.catch(error => {
  if (error.code === CODE.FILE_NOT_FOUND) {

  }
  else if (error.code === CODE.APP_NOT_FOUND) {

  }
})