DS Server

Javascript: TXTextControl.HorizontalAlignment Enumeration

Enumeration

Description

Specifies the horizontal alignment of a text.

Members

MemberDescription
LeftText is aligned at the left.
RightText is aligned at the right.
CenterText is aligned at the center.
JustifyText is justified.

Examples

The following example uses TXTextControl.HorizontalAlignment.Center (text is aligned at the center.) in a document-editing workflow.

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

function applyHorizontalAlignment(frameBase) {
    frameBase.setAlignment(
        TXTextControl.HorizontalAlignment.Center,
        function() {
            console.log("set alignment completed.");
        },
        onTxError
    );
}

Further Reading

  • Grouping Undo Steps with TX Text Control –
  • Manipulating the Selection Object –