ComPDF React Native - v3.0.0
    Preparing search index...

    Class CPDFEditorHistoryManager

    Manages the history of editing actions within a PDF document, allowing for undo and redo operations. This class extends the CPDFHistoryManagerBase and provides methods to interact with the native PDF view.

    const manager = pdfReaderRef.current._editManager;
    const historyManager = manager.historyManager;

    Hierarchy

    • CPDFHistoryManagerBase
      • CPDFEditorHistoryManager
    Index

    Constructors

    Methods

    • Parameters

      • event: any

      Returns void

    • Sets a listener that is invoked when the history state changes.

      Parameters

      • listener: (pageIndex: number, canUndo: boolean, canRedo: boolean) => void

        A callback function that is invoked when the history state changes. The function receives three parameters: pageIndex (the current page index), canUndo (a boolean indicating if an undo operation is possible), and canRedo (a boolean indicating if a redo operation is possible).

      Returns void

    • Checks if an undo operation is possible.

      Returns Promise<boolean>

      A promise that resolves to true if an undo operation is possible, otherwise false.

      const manager = pdfReader._editorHistoryManager
      await manager.canUndo();
    • Checks if an undo operation is possible.

      Returns Promise<boolean>

      A promise that resolves to true if a redo operation is possible, otherwise false.

      const manager = pdfReader._editorHistoryManager
      await manager.canRedo();
    • Checks if a redo operation is possible.

      Returns Promise<void>

      A promise that resolves when the undo operation is complete.

      const manager = pdfReader._editorHistoryManager
      await manager.redo();
    • Performs a redo operation on the editor history.

      Returns Promise<void>

      A promise that resolves when the redo operation is complete.

      const manager = pdfReader._editorHistoryManager
      await manager.redo();