Large and exciting release, full of improvements and new features, mainly thanks to our contributors, @kostassite, @iamandrewluca and @MattL75, and sponsors. Become a sponsor and help making React-PDF even better!
What's new?
- Added
Thumbnail
component which lets you render thumbnails (#898, #1519). - Forms rendered by annotation layer are now using AnnotationStorage. This allows you to hook into
pdf.annotationStorage
inpdf
provided inonDocumentLoadSuccess
callback and listen for form data changes (#1518). Thanks, @kostassite! - New hooks:
useDocumentContext
,useOutlineContext
andusePageContext
. These hooks allow you to build custom components that hook (pun not intended) into React-PDF API (#1505). Thanks, @iamandrewluca! - If
onItemClick
was not provided neither toDocument
norOutline
components, React-PDF will now attempt to navigate to the page of the clicked outline item on its own, just like it does for internal links.
What's changed?
- Improved accessibility by introducing structure tree. This also introduces new props in
Page
:onGetStructTreeSuccess
andonGetStructTreeError
(#1494, #1498). Thanks, @MattL75!
Bug fixes
- Fixed
onItemClick
types incorrectly markingdest
as required. - Fixed
onItemClick
not passed fromDocument
toOutline
. Previously, you had to manually passonItemClick
toOutline
component. Now, you only need to pass it toDocument
.