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