Skip to content

Commit 4d25dd8

Browse files
committed
Update README.md for 1.6.0
Revised install instructions, added more parameters to onPageLoad
1 parent 7a89bb4 commit 4d25dd8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
Easily display PDF files in your React application.
33

44
## tl;dr
5-
* ~~Install by executing `npm install --save react-pdf`.~~ Coming soon! See [temporary instructions](https://github.com/wojtekmaj/react-pdf/issues/6).
6-
* Import by addding `import ReactPDF from 'react-pdf'`
5+
* Install by executing `npm install --save react-pdf`.
6+
* Import by addding `import ReactPDF from 'react-pdf'`.
77
* Use by adding `<ReactPDF file="..." />`. `file` can be an URL, base64 content, Uint8Array, and more.
88

99
## Demo
@@ -73,7 +73,7 @@ Check the sample directory of this repository for a full working example.
7373
|width|Defines the width of the page. If not defined, canvas will be rendered at the width defined in PDF. If you define `width` and `scale` at the same time, the width will be multiplied by a given factor.|`width={300}`|
7474
|onDocumentLoad|Function called when the document is successfully loaded to the memory.|`onDocumentLoad={({ total }) => alert('Loaded a file with ' + total + ' pages!')}`|
7575
|onDocumentError|Function called in case of an error while loading a document.|`onDocumentError={({ message }) => alert('Error while loading document! ' + message)}`|
76-
|onPageLoad|Function called when the page is successfully loaded to the memory.|`onPageLoad={({ pageIndex, pageNumber }) => alert('Now displaying a page number ' + pageNumber + '!')}`|
76+
|onPageLoad|Function called when the page is successfully loaded to the memory.|`onPageLoad={({ pageIndex, pageNumber, width, height, originalWidth, originalHeight, scale }) => alert('Now displaying a page number ' + pageNumber + '!')}`|
7777
|onPageRender|Function called when the page is successfully rendered on the screen.|`onPageLoad={() => alert('Rendered the page!')}`|
7878
|onPageError|Function called in case of an error while rendering a page.|`onPageError={({ message }) => alert('Error while loading page! ' + message)}`|
7979

0 commit comments

Comments
 (0)