react-pdf-viewer v1.6.0 Release Notes
-
๐ New features
๐ The annotation layer is rewritten. Support the following type of annotations:
- Caret
- Circle
- File attachment
- Free text
- Highlight
- Ink
- Line
- Link
- Polygon
- Polyline
- Popup
- Square
- Squiggly
- Stamp
- StrikeOut
- Text
- Underline
๐ The link annotation supports named actions which allow to jump to the first, last, next or previous pages
Customize error renderer.
const renderError = (error: LoadError) => { let message = ''; switch (error.name) { case 'InvalidPDFException': message = 'The document is invalid or corrupted'; break; case 'MissingPDFException': message = 'The document is missing'; break; case 'UnexpectedResponseException': message = 'Unexpected server response'; break; default: message = 'Cannot load the document'; break; } return <div>{message}</div>; }; <Viewer fileUrl={fileUrl} renderError={renderError} />;
๐ Improvements
- Allow to control the
fileUrl
option - ๐ Bookmarks support external links
- ๐ Support external links
๐ Bug fixes
- The canvas layer is blurry
- The tooltip, popover positions are not correct in some cases
- The drag zone isn't visible if the main area is scrolled
- The document rotated initially isn't displayed properly