TX Text Control .NET Server

Javascript: ParagraphFormat.getAlignment Method

Method|Introduced in 26.0

Description

Gets the horizontal text alignment.

Syntax

<void> ParagraphFormat.getAlignment(<RequestHorizontalAlignmentCallback> callback, [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
callback

Receives the horizontal text alignment.

errorCallback

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

Examples

The following example demonstrates ParagraphFormat.getAlignment in a practical document-editing workflow. It gets the horizontal text alignment.

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

TXTextControl.paragraphFormat.getAlignment(
    function(alignment) {
        if (!alignment) {
            console.warn("No horizontal alignment was returned.");
            return;
        }
        
        console.log("get alignment result:", alignment);
    },
    onTxError
);