react-pdf-viewer v3.4.0 Release Notes
-
๐ New feature
- It's possible to set the initial tab
import { defaultLayoutPlugin } from '@react-pdf-viewer/default-layout'; const defaultLayoutPluginInstance = defaultLayoutPlugin({ // The `Bookmark` tab is active initially setInitialTab: () => Promise.resolve(1), });
According to the PDF specifications, the initial tab can be determined based on the document's page mode. If you want to follow that behaviour, then you can use the
setInitialTabFromPageMode
function:import { defaultLayoutPlugin, setInitialTabFromPageMode } from '@react-pdf-viewer/default-layout'; const defaultLayoutPluginInstance = defaultLayoutPlugin({ setInitialTab: setInitialTabFromPageMode, });
๐ Improvement
- Smooth scroll when jumping to a given page or destination (clicking a bookmark, for example)
๐ Bug fixes
- Can't add highlight to selected text
- Keep current position after zooming