react-pdf-viewer v3.5.0 Release Notes
-
๐ New feature
- Be able to customize the highlight elements when searching for a keyword:
const searchPluginInstance = searchPlugin({ renderHighlights: (highlightPositions: HighlightPosition[]) => ( // Your custom highlight elements ), });
๐ Improvements
๐ The highlight plugin supports double click. Users can double click to select the entire text of a given element
๐ The page navigation plugin allows to jump to the previous and next pages with shortcuts.
Shortcut Action PageUp
orAlt
+ArrowUp
Go to the previous page PageDown
orAlt
+ArrowDown
Go to the next page 0๏ธโฃ The shortcuts are enabled by default. It's possible to disable them, for example:
// 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
- Don't highlight the entire page when selecting multiple lines
- 0๏ธโฃ The default layout plugin throws an exception if the
setInitialTabFromPageMode
function returns aPromise
which resolves an invalid tab index - ๐ The highlight plugin throws an exception when double click a page without selecting any text
- ๐ The search plugin can't set the initial keyword when using with the highlight plugins