CNS Barcode

Scan and Generate Barcodes

<- Back to CNS Barcode function list

CNSBC_ScanImage

Description

This function will scan an image for barcodes and process them according to the specified profile. The image can be a stored or by reference container, or it can be a path to an image file on the hard drive. If you specify a path to an image on the hard drive, it must be in the PNG or JPEG format. For other formats, insert the image into a container field first and specify the container. If the ProfileName parameter is not specified, the function will return the data from the barcode in the image, otherwise, it will use the action defined in the profile. When running under FileMaker Server, the ProfileName parameter is ignored and the function will always return the data from the barcode in the image.

Return Type
Text
Format
CNSBC_ScanImage ( Image ; ProfileName )
Required Parameters
  • Image

    This is the image to scan. You can specify a stored or by reference container object, or you can specify the path to an image file.

Optional Parameters
  • ProfileName

    If specified, the function will look to the profile to see what action to take after scanning the barcode. If this parameter is not specified, the function will return the data found in the barcode. This parameter is ignored when running under FileMaker Server.

Related Items
CNSBC_GetLastProfileName, CNSBC_ScanWindow
Examples

Example 1

Code:

CNSBC_ScanImage( MyDB::MyImage )

Result:

This will scan an image in the MyImage field and if it finds a barcode in the image, it will return the data from that barcode.

Example 2

Code:

CNSBC_ScanImage("/somefolder/someimage.jpg")

Result:

This will scan the image on the hard drive and if it finds a barcode in the image, it will return the data from that barcode.

Example 3

Code:

CNSBC_ScanImage( MyDB::MyImage ;"MyProfile")

Result:

This will scan the image from the container field and if it finds a barcode, it will use the action defined in the MyProfile profile for processing the data from the barcode.