react-pdf-highlighter-extended
PdfHighlighterUtils: {
    getCurrentSelection(): null | PdfSelection;
    getGhostHighlight(): null | GhostHighlight;
    getTip(): null | Tip;
    getViewer(): null | PDFViewer;
    isEditInProgress(): boolean;
    isEditingOrHighlighting(): boolean;
    isSelectionInProgress(): boolean;
    removeGhostHighlight(): void;
    scrollToHighlight(highlight): void;
    setTip(tip): void;
    toggleEditInProgress(flag?): void;
    updateTipPosition(): void;
}

A set of utilities for to control the behaviour of PdfHighlighter.

Type declaration

  • getCurrentSelection:function
  • getGhostHighlight:function
  • getTip:function
  • getViewer:function
    • Get a reference to the currently used instance of a PDF Viewer.

      Returns null | PDFViewer

      • The currently active PDF Viewer.
  • isEditInProgress:function
    • Whether an AreaHighlight is being moved/resized, or a manual highlight edit has been toggled.

      Returns boolean

      • true if AreaHighlight is being edited or edit mode was set.
  • isEditingOrHighlighting:function
    • Checks whether a selection is progress, a ghost highlight, or an edit.

      Returns boolean

      • true if editing, ghost highlighting, or selecting.
  • isSelectionInProgress:function
    • Whether a mouse selection or text selection is currently being performed.

      Returns boolean

      • true if mouse selection or text selection is being performed.
  • removeGhostHighlight:function
    • Cancel any ghost highlight. The selected area will stay selected until the user clicks away.

      Returns void

  • scrollToHighlight:function
  • setTip:function
    • Set a tip to be displayed in the current PDF Viewer.

      Parameters

      • tip: null | Tip

        tip to be displayed, or null to hide any tip.

      Returns void

  • toggleEditInProgress:function
    • If enabled, automatic tips/popups inside of a PdfHighlighter will be disabled. Additional niceties will also be provided to prevent new highlights being made.

      Parameters

      • Optional flag: boolean

      Returns void

  • updateTipPosition:function
    • Callback to update any currently active tip's position. This will make sure the tip is visible above/below its highlight.

      Returns void