# formatToCPCL

## Description

Formats a text to CPCL printer language.

## Input / Parameter

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

## Output

N/A

## Callback

N/A

## Video

Coming Soon.

## Example

The user wants to format the text to print to CPCL printer language.

### Steps

1. Set a variable `vPrint` using `setVar` function.

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-dcf39f5a4c4ac72776a31323ffbd5165ce604fc7%2FformatToCPCL-step-1.png?alt=media)

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-d30a137723d56748447b478f6dc2daceb0fb683d%2FformatToCPCL-step-2.png?alt=media)
2. Call the function `btPrinterPrint`. Call the function `formatToCPCL` in the `text` parameter of the function to convert the text to CPCL format for printing.

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-435409a56d67e4bf434ccf435fe1fac1b1fb1c62%2FformatToCPCL-step-3.png?alt=media)

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-9341fa91f403943371c970202ff9a72c0dbe7c70%2FformatToCPCL-step-4.png?alt=media)

### Result

1. The text formatted to CPCL will be printed.

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-2d44f6678a555269ae91a4dd572988aa52117bb9%2FformatToCPCL-result-1.jpg?alt=media)

## Links
