# 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


---

# 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/conversion/generatebarcode.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.
