@sensenet/document-viewer-react
TypeScript icon, indicating that this package has built-in type declarations

4.2.3 • Public • Published

@sensenet/document-viewer-react

Document viewer component for sensenet

NPM version NPM downloads License: GPL v2

Install

# Yarn
yarn add @sensenet/document-viewer-react

# NPM
npm install @sensenet/document-viewer-react

Usage

import {
  AddAnnotationWidget,
  AddHighlightWidget,
  AddRedactionWidget,
  DocumentTitlePager,
  LayoutAppBar,
  RotateActivePagesWidget,
  RotateDocumentWidget,
  ROTATION_MODE,
  SaveWidget,
  DocumentViewer as SnDocumentViewer,
  ToggleCommentsWidget,
  ToggleRedactionWidget,
  ToggleShapesWidget,
  ToggleThumbnailsWidget,
  ZoomInOutWidget,
} from '@sensenet/document-viewer-react'

<SnDocumentViewer
  documentIdOrPath={<id or path of the document>}
  renderAppBar={() => (
    <LayoutAppBar>
      <div style={{ flexShrink: 0 }}>
        <ToggleThumbnailsWidget />
        <ZoomInOutWidget />
        <RotateActivePagesWidget mode={ROTATION_MODE.clockwise} />
        <RotateDocumentWidget mode={ROTATION_MODE.clockwise} />
        <SaveWidget />
      </div>
      <DocumentTitlePager />
      <div style={{ flexShrink: 0 }}>
        <ToggleRedactionWidget />
        <ToggleShapesWidget />
        <AddRedactionWidget />
        <AddHighlightWidget />
        <AddAnnotationWidget />
        <ToggleCommentsWidget />
      </div>
    </LayoutAppBar>
  )}
/>

The main component is SnDocumentViewer, but you can extend functionality with any widgets from the example

/@sensenet/document-viewer-react/

    Package Sidebar

    Install

    npm i @sensenet/document-viewer-react

    Homepage

    sensenet.com

    Weekly Downloads

    41

    Version

    4.2.3

    License

    GPL-2.0

    Unpacked Size

    14.4 MB

    Total Files

    550

    Last publish

    Collaborators

    • hassanad
    • kubehu
    • herflis
    • tusmester
    • kavics
    • vargajoe