Product Logo

CNS Barcode

Scan and Generate Barcodes

Functions

CNSBC_Generate

NameCNSBC_Generate
Description

This function will take the data you provide it and generate a barcode image in PNG, EPS, or SVG format.

Return TypeContainer
FormatCNSBC_Generate ( Type ; Data ; Format ; DataMode )
Required Parameters
Type

This specifies the type of barcode to generate. Valid values are “Code39”, “Code39+”, “Code93”, “Code128”, “Databar14”, “Databar14Stacked”, “EAN”, “EAN14”, “EAN128”, “Interleaved2of5”, “ISBN”, “QRCode”, “UPCA”, or “UPCE”.

Data

This is the data to encode into the barcode. If you specify a Number field, the plug-in will auto-format it with four decimal places. However, if the fractional part is zero, it will be removed leaving only the whole number. If you need any other formatting for Numbers, you will need to convert it to text within FileMaker before sending to this function.

Optional Parameters
Format

The output Format of the Barcode Image. Valid values are “PNG” (the default), “EPS”, or “SVG”.

DataMode

The format the data is interpretted as when generating the barcode. Valid values are “Unicode” [the default], “Binary”, or “GS1”.

Examples
Example 1

This generates a QR Code with an embedded URL to the CNS Plug-ins website.

CNSBC_Generate( "QRCode" ; "http://www.cnsplug-ins.com/" )
Example 2

This generates a UPC A barcode.

CNSBC_Generate( "UPCA" ; "03506152005" )
Example 3

This generates an ISBN barcode in the EPS format (a vector format that can be cleanly resized).

CNSBC_Generate( "ISBN" ; "9781595544346" ; "EPS" )