See Upgrade guide from version 3.x to 4.x.
Note: React <16.3 is not supported. If you're still using React older than 16.3, please use react-pdf@^3.0.0
instead.
What's new?
- React-PDF now uses new Context API giving it much improved reliability and stability.
- React-PDF now uses PDF.js 2.0, bringing in a lot of fixes and improvements.
- Webpack 4.x and Create-React-App 2 are now supported (#179).
- React-PDF is now fully compatible with React 17 (sic!).
- Interactive forms can now be rendered by toggling
renderInteractiveForms
flag. - You can now use
height
prop onPage
component to scale the page.height
will be ignored if you providewidth
as well. More details in README.md (#236). - You can now attach keyboard events to
<Page />
component. - Added support for password encrypted PDFs. You can use
onPassword
prop to overwrite default password prompt (#241). - You can now pass
onLoadProgress
callback toDocument
component to be updated on document loading progress. This may come in handy if you load PDF to be displayed from a web server (#238) - You can now pass
renderMode
prop to allPage
components by adding it to wrappingDocument
component instead. - Added
externalLinkTarget
prop which allows to configuretarget
for external links rendered in annotations (#262). - Added
renderMode
none
which does not render the main layer at all (#283).
What's changed?
- You can no longer use React-PDF without Web Worker.
setOptions
function has been replaced with much more powerfuloptions
prop in Document component.- TextLayer is now rendered over SVG to match Canvas rendering mode behavior.
- Removed
max-width
from rendered SVG to match Canvas rendering mode behavior (#251). renderAnnotations
was renamed torenderAnnotationLayer
for consistency. You don't need to change anything in your code just yet.- Clarified documentation for
onItemClick
. - React-PDF now uses Babel 7 for compilation (#270).