DS Server

Javascript: ParagraphFormat.setLineSpacing Method

Method|Introduced in 26.0

Description

Sets the line spacing of a paragraph as a percentage of the font size.

Syntax

<void> ParagraphFormat.setLineSpacing(<number> lineSpacing, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
lineSpacing

The line spacing of a paragraph as a percentage of the font size.

callback

Optional. Is called when the operation completed.

errorCallback

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

Examples

The following example demonstrates ParagraphFormat.setLineSpacing in a practical document-editing workflow. It sets the line spacing of a paragraph as a percentage of the font size.

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

TXTextControl.paragraphFormat.setLineSpacing(
    1,
    function() {
        console.log("set line spacing completed.");
    },
    onTxError
);