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