yarn @react-pdf-viewer/core 2.3.0
v2.3.0

latest releases: 3.12.0, 3.11.0, 3.10.0...
3 years ago

New features

  • New highlight plugin provides the ability of selecting and adding notes for text in the document
  • The default-layout plugin allows to customize the tabs:
// `defaultTabs` is the list of default tabs which lists thumbnails, bookmarks and attachments respetively
const defaultLayoutPluginInstance = defaultLayoutPlugin({
    sidebarTabs: defaultTabs => { ... }
});

We also can activate a given tab:

const { activateTab } = defaultLayoutPluginInstance;

// Activate a tab
// activateTab(index);

Breaking changes

  • The getPagesRef method in plugins are changed to getPagesContainer:
// Before
interface PluginFunctions {
    getPagesRef(): React.RefObject<HTMLDivElement>;
}

// After
interface PluginFunctions {
    getPagesContainer(): HTMLElement;
}
  • The authorization option is removed. You can use new withCredentials option:
// Before v2.3.0
<Viewer
    fileUrl={...}
    authorization='Bearer ...'
/>

// From v2.3.0
<Viewer
    fileUrl={...}
    withCredentials={true}
    httpHeaders={{
        'Authorization': 'Bearer ...',
    }}
/>

Don't miss a new core release

NewReleases is sending notifications on new releases.