TX Text Control .NET Server

Javascript: FrameBase.getInsertionMode Method

Method|Introduced in 28.0

Description

Gets a value determining whether the frame is treated as a single character or the document's text either flows around or overwrites the frame. If the document's text flows around or overwrites the frame, this property also determines whether the image, text frame, chart, barcode or drawing is moved with the text or fixed positioned on a page.

Syntax

<void> FrameBase.getInsertionMode(<RequestFrameInsertionModeCallback> callback, [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
callback

Receives the current property value.

errorCallback

Optional. Is called when the operation failed with an error.

Examples

The following example demonstrates FrameBase.getInsertionMode in a practical document-editing workflow. It gets a value determining whether the frame is treated as a single character or the document's text either flows around or overwrites the frame. If the document's text flows around or overwrites the frame, this property also determines whether the image, text frame, chart, barcode or drawing is moved with the text or fixed positioned on a page.

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

function inspectInsertionMode(frameBase) {
    frameBase.getInsertionMode(
        function(insertionMode) {
            if (!insertionMode) {
                console.warn("No frame insertion mode was returned.");
                return;
            }
            
            console.log("get insertion mode result:", insertionMode);
        },
        onTxError
    );
}