Nutrient Web SDK
    Preparing search index...

    Interface Session

    This describes the content editor session returned by Instance#beginContentEditingSession.

    It is independent of the content editor UI session, which is used to display the content editor UI. At one time, only one content editing session can be active, either this session or a UI session. Starting the UI session will deactivate this session. Also, if the contents of an opened document are modified while this session is active, the session will be deactivated.

    Using this requires a license that includes the Content Editor component.

    interface Session {
        active: boolean;
        commit: () => Promise<void>;
        discard: () => Promise<void>;
        getTextBlocks: (pageIndex: number) => Promise<ContentEditing.TextBlock[]>;
        updateTextBlocks: (textBlocks: UpdatedTextBlock[]) => Promise<void>;
    }
    Index

    Properties

    active: boolean

    Indicates whether the session is currently active.

    commit: () => Promise<void>

    Completes the current editing session and saves all changes. Document will reload.

    Type Declaration

      • (): Promise<void>
      • Returns Promise<void>

        A promise that resolves when the changes have been successfully saved.

    discard: () => Promise<void>

    Completes the current editing session without persisting any changes.

    Type Declaration

      • (): Promise<void>
      • Returns Promise<void>

        A promise that resolves when the session is successfully discarded.

    getTextBlocks: (pageIndex: number) => Promise<ContentEditing.TextBlock[]>

    Retrieves all text blocks for a specific page.

    Type Declaration

    If the page index is out of bounds.

    updateTextBlocks: (textBlocks: UpdatedTextBlock[]) => Promise<void>

    Updates an array of text blocks with partial data.

    Type Declaration

    If the ID of any text block is missing or doesn't exist.