DS Server

Javascript: TextFrame.setSize Method

Method|Introduced in 28.0

Description

Sets the frame's size in twips. For images this property is read only.

Syntax

<void> TextFrame.setSize(<Size> value, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
value

The new property 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 TextFrame.setSize in a practical document-editing workflow. It sets the frame's size in twips. For images this property is read only.

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

function configureSize(textFrame) {
    textFrame.setSize(
        { width: 2880, height: 1440 },
        function() {
            console.log("set size completed.");
        },
        onTxError
    );
}