TX Text Control .NET Server

Javascript: FrameBase.setSize Method

Method|Introduced in 28.0

Description

Sets the frame's size in twips. For images this property is read only. To change the size of an image in a document, use the setHorizontalScaling and setVerticalScaling methods.

Syntax

<void> FrameBase.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 FrameBase.setSize in a practical document-editing workflow. It sets the frame's size in twips. For images this property is read only. To change the size of an image in a document, use the setHorizontalScaling and setVerticalScaling methods.

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

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