# Draw Bar Code

> Kalipso Studio 6.1 documentation · https://doc.sysdevmobile.com/kalipso/6.1/documentation/actions/group-controls/draw-bar-code
>
> Draws a barcode (Code 128, Code 39, PDF417, Data Matrix, QR Code and more) on a Draw control or to a file, or returns its width.

Draw a bar code on a file or on a draw control. This action also allows user to know the width of a specified bar code.

Action available for the following operating systems:

![OS Supported: Android, iOS, Win, Win32](https://doc.sysdevmobile.com/kalipso/assets/images/01_Supported_OS-5c02a51fd5080a410a07ee3ef72b6872.png)

### Parameters

* **Data** _\<string> -_ Data to be associated to the bar code.
* **Bar Code Type** _\<unquoted string> -_ The type of the bar code. There are several bar code types possible: _COD128_, _CODE39_, _CODE93_, _I2OF5_, _RATIONALCODABAR_, _PDF417_, _Data Matrix_, _QR Code_, _EAN13, Data Matrix Rectangular, EAN128_ or dynamic.
* **Narrow Bar width** _\<numeric> -_ The width of the narrow bar of the bar code specified.
* **Ratio** _\<numeric> -_ The ratio of the bar code specified.
* **Mode** _\<unquoted string> -_ The mode to draw the bar code. There are three possible options for this parameter: _Get Width_, _Draw to 'Draw' Control_ or _Draw to File_.
  * **Get Width** - _Target Width_: control or variable to save the width of specified control.
  * **Draw to 'Draw' Control**
    * _Target Width:_ control or variable to save the width of specified control.
    * _Draw Control_: the control where the draw is done.
    * _X:_ the X coordinate where the draw of bar code begins.
    * _Y:_ the Y coordinate where the draw of bar code begins.
    * _Height_: the Height of the bar code to be drawed.
  * **Draw to File**
    * _Target Width:_ control or variable to save the width of specified control.
    * _X:_ the X coordinate where the draw of bar code begins.
    * _Y:_ the Y coordinate where the draw of bar code begins.
    * _Height_: the Height of the bar code to be drawed.
    * _File_: the complete path and name to the file.
    * _Format_: the type of format of the saved file.
    * _Width_: the width of the file.
    * _Height_: the height of the file.

:::info
The parameter _ratio_ are unavailable to modify in certain bar code types.
:::

:::info
Set _**Width**_ and _**Height**_ in Draw to File to _0_, for automatic management.
:::

:::info
There are several formats available (to parameter Format): Auto, JPG (.jpeg), BMP (.bmp), GIF (.gif) or PCX (.pcx).
:::
