React PDF viewer v3.7.0 Release Notes

  • ๐Ÿ†• New feature

    • You can customize the bookmarks by using the renderBookmarkItem properly:
    <Bookmark renderBookmarkItem={renderBookmarkItem} />
    
    • 0๏ธโƒฃ The default layout plugin provides new toggleTab function to toggle a given tab in the sidebar:
    const defaultLayoutPluginInstance = defaultLayoutPlugin();
    const { toggleTab } = defaultLayoutPluginInstance;
    
    // Toggle the second tab
    toggleTab(1);
    

    ๐Ÿ‘Œ Improvement

    • ๐ŸŽ Clicking Command + ArrowUp (on macOS) or Ctrl + ArrowUp (on Windows) will bring users to the previous clicked link annotation. You can disable that shortcuts via the enableShortcuts option:
    // Use the standalone page navigation plugin
    const pageNavigationPluginInstance = pageNavigationPlugin({
        enableShortcuts: false,
    });
    
    // Use the default layout plugin
    const defaultLayoutPluginInstance = defaultLayoutPlugin({
        toolbarPlugin: {
            pageNavigationPlugin: {
                enableShortcuts: false,
            },
        },
    });
    

    ๐Ÿ› Bug fixes

    • Clicking a particular bookmark might not go to the destination
    • Link annotations with unsafe URLs won't be rendered to avoid secutiry issues
    • The CharacterMap type isn't available
    • The onPageChange callback does not trigger if the current page equals to the initial page
    • ๐Ÿ”Œ The page navigation options are missing when creating a toolbar plugin
    • The search popover always shows up after pressing shortcuts
    • The viewer always navigates to previous, next pages after users press shortcuts even the document isn't focused