TX Text Control .NET Server

Javascript: Selection.setCharacterScaling Method

Method|Introduced in 30.0

Description

Sets or sets the style's character scaling, in percent of the average character width.

Syntax

<void> Selection.setCharacterScaling(<number> characterScaling, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
characterScaling

The new value.

callback

Optional. Is called when the operation completed.

errorCallback

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

Examples

The following example demonstrates Selection.setCharacterScaling in a practical document-editing workflow. It sets or sets the style's character scaling, in percent of the average character width.

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

TXTextControl.selection.setCharacterScaling(
    80,
    function() {
        console.log("set character scaling completed.");
    },
    onTxError
);