DS Server

Javascript: Selection.getCharacterSpacing Method

Method|Introduced in 30.0

Description

Gets the style's character spacing value, in twips. This value is added to each character. When it is negative, character spacing is reduced, otherwise it is extended.

Syntax

<void> Selection.getCharacterSpacing([<RequestNumberCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
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.getCharacterSpacing in a practical document-editing workflow. It gets the style's character spacing value, in twips. This value is added to each character. When it is negative, character spacing is reduced, otherwise it is extended.

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

TXTextControl.selection.getCharacterSpacing(
    function(result) {
        console.log("get character spacing result:", result);
    },
    onTxError
);