# Javascript: SignatureField.setImage Method

> Sets the signature field's image.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 31.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > Javascript: SignatureField.setImage Method
- **370 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/signaturefield/setimage-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/signaturefield/setimage-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/signaturefield/setimage-method/llms-full.txt

---

### Description

Sets the signature field's image.

### Syntax

```javascript
<void> SignatureField.setImage(<string> imageData, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| imageData | The base64 encoded image data. |
| callback | Optional. Is called when the operation completed. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `SignatureField.setImage` in a practical document-editing workflow. It sets the signature field's image.

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

function configureImage(signatureField) {
    signatureField.setImage(
        "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAFgAH/qbPzWQAAAABJRU5ErkJggg==",
        function() {
            console.log("set image completed.");
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [Javascript: SignatureField.image Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/signaturefield/image-property/llms-full.txt)
- **Next:** [Javascript: SignatureField.setSignerData Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/signaturefield/setsignerdata-method/llms-full.txt)
