# btPrinterPrint

## Description

Sends data to a printer to print the required document.

## Input / Parameter

| Name | Description        | Input Type  | Default | Options | Required |
| ---- | ------------------ | ----------- | ------- | ------- | -------- |
| text | The data to print. | String/Text | -       | -       | Yes      |

## Output

N/A

## Callback

### callback

The function to be executed if the data to be printed is sent to the printer successfully.

### errorCallback

The function to be executed if the data to be printed is not sent to the printer successfully.

## Video

Coming Soon.

## Example

The user wants to print a document from the device.

### Steps

1. Call the function `btPrinterPrint`. Call the function `formatToCPCL` in the `text` parameter of the function to convert the text to CPCL format for printing.

   ![](/files/oLNv1rXj1Ev1PMhj9CEj)

   ![](/files/2iu6wJwZ5DXeFZUl4Z7W)

   ![](/files/de2DjGWh0uescIqytaCd)
2. Call the function `infoDialog` in the callbacks of the `btPrinterPrint` function to view the status.

   ![](/files/fMMlJ26jopEUfagCVUHn)

   ![](/files/FtHrnKkVGtDngUnqa7uj)

### Result

1. If the document is printed successfully, the success infoDialog will appear, otherwise the error infoDialog will appear.

   ![](/files/gFi3q6j7Ig4R5bZrSztv)

## Links


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.emobiq.com/emobiq-client/006-actions-and-visual-logic/action-reference/cordova/printer/btprinterprint.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
