react-files-viewer
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

react-files-viewer

Viewer for differents files (pdf, other)

NPM JavaScript Style Guide

📦 Install

npm install --save react-files-viewer

🔨 General Usage

import React from 'react'
import { PdfContainer } from 'react-files-viewer'

const App = () => {
  return (
    <PdfContainer
      // your pdf url
      url="http://www.africau.edu/images/default/sample.pdf"
      // your page number
      pageNumber={1}
    />
  )
}

export default App

PdfContainer

This component provides access to a PDF viewer with control over it (zoom, print, etc.).

<PdfContainer
      // your pdf url
      url="http://www.africau.edu/images/default/sample.pdf"
      // your page number
      pageNumber={1}
      // get number of pages
      getNumPages={(numPages) => console.log("numPages", numPages)}
/>

PdfViewer

This component provides access ti a Mozilla PDF viewer with custom setting

<PdfViewer
      // your pdf url
      url="http://www.africau.edu/images/default/sample.pdf"
      // your page number
      pageNumber={1}
      // get number of pages
      getNumPages={(numPages) => console.log("numPages", numPages)}
      // container style
      containerStyle={}
      // viewer style
      viewerStyle={}
/>

License

MIT © vladimirevstratov

Readme

Keywords

Package Sidebar

Install

npm i react-files-viewer

Weekly Downloads

36

Version

1.0.1

License

MIT

Unpacked Size

296 kB

Total Files

16

Last publish

Collaborators

  • vladimirevstratov
  • apollon_seven