# Javascript: TXTextControl.getCanPrint Method

> Informs whether the document can be printed. The value depends on the DocumentPermissions.allowPrinting and the currently set edit mode.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: TXTextControl.getCanPrint Method
- **399 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/getcanprint-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/getcanprint-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/getcanprint-method/llms-full.txt

---

### Description

Informs whether the document can be printed. The value depends on the [DocumentPermissions.allowPrinting](https://docs.textcontrol.com/ds-server/reference/javascript/documentpermissions/allowprinting-property/llms-full.txt) and the currently set edit mode.

### Syntax

```javascript
<void> TXTextControl.getCanPrint(<RequestBooleanCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | The callback function that receives the requested value. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `TXTextControl.getCanPrint` in a practical document-editing workflow. Informs whether the document can be printed. The value depends on the DocumentPermissions.allowPrinting and the currently set edit mode.

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

TXTextControl.getCanPrint(
    function(result) {
        if (result) {
            console.log("get can print is available.");
        } else {
            console.warn("get can print is not available in the current document state.");
        }
    },
    onTxError
);
```

---

## Nearby

- **Previous:** [Javascript: TXTextControl.getCanPaste Method](https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/getcanpaste-method/llms-full.txt)
- **Next:** [Javascript: TXTextControl.getCanRedo Method](https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/getcanredo-method/llms-full.txt)
