# Javascript: TextFrame.setTransparency Method

> Sets the text frame's transparency. It must be a value between 0.0 and 1.0. Zero means opaque and 1.0 means completely transparent.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: TextFrame.setTransparency Method
- **388 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/textframe/settransparency-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/textframe/settransparency-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/textframe/settransparency-method/llms-full.txt

---

### Description

Sets the text frame's transparency. It must be a value between 0.0 and 1.0. Zero means opaque and 1.0 means completely transparent.

### Syntax

```javascript
<void> TextFrame.setTransparency(<number> 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 `TextFrame.setTransparency` in a practical document-editing workflow. It sets the text frame's transparency. It must be a value between 0.0 and 1.0. Zero means opaque and 1.0 means completely transparent.

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

function configureTransparency(textFrame) {
    textFrame.setTransparency(
        1,
        function() {
            console.log("set transparency completed.");
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [Javascript: TextFrame.setTextDistances Method](https://docs.textcontrol.com/ds-server/reference/javascript/textframe/settextdistances-method/llms-full.txt)
- **Next:** [TextFrameCallback Function](https://docs.textcontrol.com/ds-server/reference/javascript/textframecallback/llms-full.txt)
