generateBarcode

Description

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

Input / Parameter

Output

Example

In this example, we will generate a barcode and display it in an image component.

Steps

  1. Drag a button component and an image component to a page in the editor to display the generated barcode.

  2. Call the function Device.generateBarcode in the press event of the button component and set the required parameters to generate the barcode.

    height : 200
    value : aaa
  3. Call the function App.setComponentValue if the function Device.generateBarcode runs successfully and set the value to display the barcode in the image component.

  4. Call the function Log.write if the function Device.generateBarcode does not run successfully and set the value to print the response in the console. Drag a Log.write function below the function App.setComponentValue as well to print the result in the console.

Result

  1. The image component will display the barcode generated if the function is executed successfuly and the console will print the base64 string of the image if the function is not executed successfully.

Last updated