> For the complete documentation index, see [llms.txt](https://docs.emobiq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.emobiq.com/emobiq-client/006-actions-and-visual-logic/action-reference/cordova/conversion/generatebarcode.md).

# generateBarcode

## Description

Creates a machine-readable code in the form of numbers and a pattern of parallel lines of varying widths.

## Input / Parameter

| Name        | Description                   | Input Type  | Default | Options | Required |
| ----------- | ----------------------------- | ----------- | ------- | ------- | -------- |
| type        | The type of barcode.          | String/Text | CODE128 | -       | No       |
| fontSize    | The font size of the barcode. | Number      | 20      | -       | No       |
| height      | The height of the barcode.    | Number      | 100     | -       | No       |
| width       | The width of the barcode.     | Number      | 2       | -       | No       |
| margin      | The margin of the barcode.    | Number      | 10      | -       | No       |
| value       | The value of the barcode.     | String/Text | -       | -       | Yes      |
| displayText | To display text or not.       | Boolean     | true    | -       | No       |
| text        | The text to display.          | String/Text | -       | -       | No       |
| bold        | Bolds the text.               | String/Text | -       | -       | No       |
| italic      | Italicizes the text.          | String/Text | -       | -       | No       |
| textAlign   | To align text or not.         | String/Text | center  | -       | No       |

## Output

| Description                               | Output Type |
| ----------------------------------------- | ----------- |
| Returns the base64 barcode image pattern. | String/Text |

## Callback

N/A

## Video

Coming Soon.

## Example

The user wants to generate a barcode.

### Step

1. Call the function "setComponentValue" and set the value for component.\
   component: imgQR<br>

   ![](/files/tFHOpNJezKZenMiG7Dnx)
2. Call the function "generateBarcode" and set the value for barcode.\
   height : 200\
   width : 200\
   value : aaa

   ![](/files/mblZldEkY0I6dWbnGUQw)

   ![](/files/KV8MXGQc2ItItjBybomu)
3. Add a console for display the response from console.

   ![](/files/ZjtH39aPkLoRQzq8pi96)

### Result

![](/files/PnKBTwgrzFSfjRf4PSwG)

![](/files/IAdbCKzTGfSWUxuIY2Eo)

## Links
