Viewer for differents files (pdf, other)
npm install --save react-files-viewer
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
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)}
/>
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={}
/>
MIT © vladimirevstratov