Altova MobileTogether Designer

Scan/Generate Barcode

Home Prev Top Next

You can set this action to do one of the following:

 

scan a barcode with the camera of the client device and store the barcode data in a page source node, or

generate a barcode and store the barcode image in a page source node.

 

Each of these actions is described separately below.

 

Let User Scan Barcode

To enable the end user to scan a barcode and store the data contained in the barcode, select the option Let User Scan Barcode (see screenshot below).

 

When the action is triggered, the camera application of the client device is launched and the end user can scan a barcode. On completing the scan, MobileTogether enters the information contained in the barcode and the corresponding barcode format into two separate page source nodes. For example, if an ISBN barcode is scanned, then the ISBN number and the ISBN barcode format (which is EAN-13) are saved, respectively, to the two nodes specified in the definition of the action (Result Node and Result Format Node, respectively). This barcode information is then available to the design as XML data.

MTActionLetUserScanBarcode

The Let User Scan Barcode action (see screenshot above) has the following options:

 

Result Node: The page source node where the barcode data obtained from the scan is saved.

Result Format Node: The page source node where the format of the scanned barcode is saved. The format of the scanned barcode is detected automatically and saved to this node. The format names that are entered in this node are entered exactly as given in the list of supported formats below.

Barcode formats for which to scan: Specifies what formats may be scanned. Barcodes of a format that is not in the list will not be scanned. You can select: (i) All barcodes, (ii) barcodes that you list by adding entries and then selecting a format in each entry's combo box, or (iii) a list of barcodes that is returned as an XPath sequence in which each item is a string that is a single barcode format (for example: "Aztec", "Codabar", "Code 39"). If you set this filter with an XPath expression, then make sure to use the name of the format exactly as it is given in the list of supported formats below.

 

Generate Barcode

To generate a barcode image from barcode data and store the image in a page source node, select the option Generate Barcode (see screenshot below). For example, a barcode image can be generated from an ISBN number and stored (in Base64 format) in a page source node.

MTActionGenerateBarcode

The Generate Barcode action (see screenshot above) has the following options:

 

Result Node: The page source node where the generated barcode-image data is saved. The image data is saved in Base64 format.

Barcode Type: The format of the barcode to generate. You can select the format from the combo box or enter it as an XPath expression. If you use an XPath expression, then make sure to specify the format exactly as given in the list of supported formats below.

Generate for String: The string that is to be used as the source data for the barcode generation. For example, if you want to generate an ISBN barcode, then this string will be an ISBN number.

Width, Height: The desired dimensions. Note, however, that the generated image may be larger if the dimension/s you specify are too small.

Image Format: Choose either PNG or JPG as the format of the barcode image.

Padding: The empty (white) space to be added on all sides of the barcode image.

Error Correction: Applies to the Aztec, PDF 417, and QR Code barcode formats only. Enter a value of 0 to 8 to add additional error correction to the generated barcode. A higher value specifies greater error correction..

Encoding: Applies to the Aztec, PDF 417, and QR Code barcode formats only. The encoding codepage to which the input data string is converted before barcode generation..

 

Supported barcode formats

The currently supported barcode formats are listed below, together with limitations where these apply.

 

Format name

Notes

Aztec


Codabar

Not on iOS

Code 39


Code 93


Code 128


Data Matrix

iOS: versions >= 8

EAN-8


EAN-13


EAN-128

Detected as Code 128

ITF

iOS: versions >= 8

PDF 417


QR Code


RSS-14

Not on iOS. Available only for scanning, not for generation.

RSS-Expanded

Not on iOS. Available only for scanning, not for generation.

UPC-A

iOS: Detected as EAN 13

UPC-E


 

Note: No barcode support is available in web clients.

 

MobileTogether extension functions

MobileTogether provides a range of XPath extension functions that have been specifically created for use in MobileTogether designs. Some functions can be particularly useful with specific actions. For example, mt-available-languages() returns the languages in which the solution is available and could, for example, be used with the Message Box action. If a function is especially relevant to this action, it is listed below. For a full list of extension functions and their descriptions, see the topic MobileTogether Extension Functions.

 

© 2018-2024 Altova GmbH