Skip to content

vladimirevstratov/react-files-viewer

Repository files navigation

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

About

Viewer for differents files (pdf, other)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published