CNS Barcode

Scan and Generate Barcodes

<- Back to CNS Barcode function list

CNSBC_Generate

Description

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

Return Type
Container
Format
CNSBC_Generate ( Type ; Data ; Format )
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".

Examples

Example 1

Code:

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

Result:

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

Example 2

Code:

CNSBC_Generate("UPCA";"03506152005")

Result:

This generates a UPC A barcode.

Example 3

Code:

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

Result:

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