DS Server

Javascript: TXTextControl.ImageInsertionMode Enumeration

Enumeration|Introduced in 25.0

Description

Determines how an image can be inserted in the text.

Members

MemberDescription
AboveTheTextThe image is inserted at a certain geometrical location above the text. This means that the image overwrites the text.
AsCharacterThe image is inserted in the text as a single character.
BelowTheTextThe image is inserted at a certain geometrical location below the text. This means that the text overwrites the image.
DisplaceCompleteLinesThe image is inserted at a certain geometrical location.
DisplaceTextThe image is inserted at a certain geometrical location.

Examples

The following example uses TXTextControl.ImageInsertionMode.AsCharacter (the image is inserted in the text as a single character.) in a document-editing workflow.

function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

TXTextControl.images.addAtFixedPosition(
    "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAFgAH/qbPzWQAAAABJRU5ErkJggg==",
    1,
    { x: 1440, y: 720 },
    TXTextControl.ImageInsertionMode.AsCharacter,
    onTxError
);