React PDF Reader
A React component to read PDF Document.
Installation
npm
npm install react-pdf-reader --save
yarn
yarn add react-pdf-reader
Usage
Import the component in your React app :
;
<PDFReader ="pdf/sample.pdf" ="canvas"/>
Import TextLayer stylesheet :
;//OR ;
Or copy /node_modules/react-pdf-reader/dist/TextLayerBuilder.css
in your static files folder and import :
Import default reader stylesheet ( Optional but recommended :) ) :
;//OR ;
Or copy /node_modules/react-pdf-reader/dist/PdfReader.css
in your static files folder and import :
Prop types
Prop | Description | Sample |
---|---|---|
file | Define the url of the PDF Document. | file="pdf/sample.pdf" |
renderType | Define the type of the PDF display render. You have the choice between "canvas" and "svg". Default : svg |
|