# Javascript: FrameBase.setSize Method

> 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.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > Javascript: FrameBase.setSize Method
- **459 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/framebase/setsize-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/framebase/setsize-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/framebase/setsize-method/llms-full.txt

---

### 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](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/image/sethorizontalscaling-method/llms-full.txt) and [setVerticalScaling](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/image/setverticalscaling-method/llms-full.txt) methods.

### Syntax

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

### Parameters

| Parameter | Description |
|---|---|
| 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.

```javascript
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
    );
}
```

---

## Nearby

- **Previous:** [Javascript: FrameBase.setName Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/framebase/setname-method/llms-full.txt)
- **Next:** [Javascript: FrameBase.setSizeable Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/framebase/setsizeable-method/llms-full.txt)
