# QR-/Barcode

## CreateBarcode

Creates a QR or bar code and returns the Document with the image. The generated barcode image can be manipulated with parameter options.

#### Syntax <a href="#pragma-line-6496" id="pragma-line-6496"></a>

```
CreateBarcode ( CodeText [, EncodeType] [, XDimension] [, YDimension] [, BarcodeColor] [, RotationAngle] )
```

#### Parameters <a href="#pragma-line-6502" id="pragma-line-6502"></a>

***CodeText***\
&#x20;The coding text of the barcode.\
&#x20;Type: String

***EncodeType*** (optional)\
&#x20;The encode type of the barcode, e.g QR, ISBN, DataMatrix, Pdf417. Default is EAN13\
&#x20;Type: String

***XDimension*** (optional)\
&#x20;The X dimension determines a barcode's density. If the X dimension is large so the barcode can hold more information, in fact the barcode is getting bigger. Default dimension is 0,6.\
&#x20;Type: Double

***YDimension*** (optional)\
&#x20;The Y dimension is to 2D barcodes what the X dimension is for linear barcodes. Default dimension is 2,0.\
&#x20;Type: Double

***BarcodeColor*** (optional)\
&#x20;The barcode color in ARGB format, e.g. '255,0,0,0' for black\
&#x20;Type: String

***RotationAngle*** (optional)\
&#x20;The rotation angle in degrees. If angle NOT equal to 90, 180, 270 or 0, it may difficulty to read the image.\
&#x20;Type: Double

#### Return Type <a href="#pragma-line-6529" id="pragma-line-6529"></a>

Document

## ReadBarcode

Analyzes a QR or bar code and returns the stored information as a string. Input Document must contain an image (supported formats).

#### Syntax <a href="#pragma-line-6538" id="pragma-line-6538"></a>

```
ReadBarcode ( Document [, DecodeBarCodeType] )
```

#### Parameters <a href="#pragma-line-6544" id="pragma-line-6544"></a>

***Document***\
&#x20;Document object containing the barcode image\
&#x20;Type: Document

***DecodeBarCodeType*** (optional)\
&#x20;Specify the type of barcode to read, e.g QR, ISBN, DataMatrix, Pdf417, Code39Standard. Default is all types.\
&#x20;Type: String

#### Return Type <a href="#pragma-line-6555" id="pragma-line-6555"></a>

String

## &#x20;<a href="#pragma-line-6560" id="pragma-line-6560"></a>


---

# 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.tivity.one/building-an-application/execution/scripting/functions/qr-barcode.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.
