# Javascript: Barcode.saveImage Method

> Saves the barcode image.

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

---

### Description

Saves the barcode image.

### Syntax

```javascript
<void> Barcode.saveImage(<ImageFormat> imageFormat, <RequestStringCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| imageFormat | Specifies the format used to save the image. |
| callback | Receives the image data as a base64 string. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `Barcode.saveImage` in a practical document-editing workflow. It saves the barcode image.

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

function saveImage(barcode) {
    barcode.saveImage(
        TXTextControl.ImageFormat.Bmp,
        function(result) {
            console.log("save image result:", result);
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [Javascript: Barcode.getUpperTextLength Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/barcode/getuppertextlength-method/llms-full.txt)
- **Next:** [Javascript: Barcode.setAdditionalText Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/barcode/setadditionaltext-method/llms-full.txt)
