ComPDFKit Web SDK
    Preparing search index...

    Class PageHistoryManager

    Undo and redo history of page operations (insert, delete, move, rotate, merge). Obtain it with document.getPageHistoryManager().

    Hierarchy (View Summary)

    Index
    • Adds a listener for an event. Adding the same function twice for one event has no effect.

      Type Parameters

      • K extends "undoRedoStatusChanged"

      Parameters

      • name: K

        Event name.

      • fn: (...args: PageHistoryManagerEvents[K]) => void

        Listener, called with the event arguments.

      • Optionaloptions: { once?: boolean }

        Listener options.

        • Optionalonce?: boolean

          When true, the listener is removed after it runs once.

      Returns void

    • Checks whether there is a step to redo.

      Returns boolean

      true when redo is available.

    • Checks whether there is a step to undo.

      Returns boolean

      true when undo is available.

    • Removes all steps. Fires undoRedoStatusChanged when availability changes.

      Returns void

    • Redoes the latest undone step; does nothing when there is none. On error the history is cleared and the error is thrown.

      Returns Promise<void>

    • Removes a listener, or every listener of the event when fn is omitted.

      Type Parameters

      • K extends "undoRedoStatusChanged"

      Parameters

      • name: K

        Event name.

      • Optionalfn: (...args: PageHistoryManagerEvents[K]) => void

        The function that was passed to addEventListener.

      Returns void

    • A listener that throws does not affect the others; the error is reported through logger.error.

      Type Parameters

      • K extends "undoRedoStatusChanged"

      Parameters

      • name: K
      • Optionalargs: PageHistoryManagerEvents[K]

      Returns void

    • Like trigger, but awaits the Promise returned by each listener in turn; a failing listener does not affect the others.

      Type Parameters

      • K extends "undoRedoStatusChanged"

      Parameters

      • name: K
      • Optionalargs: PageHistoryManagerEvents[K]

      Returns Promise<void>

    • Undoes the latest step; does nothing when there is nothing to undo. On error the page state is uncertain, so history is cleared and the error thrown

      Returns Promise<void>