Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

Barcode.Scan

Scans for barcodes in a picture.

Component Version macOS Windows Linux Server iOS SDK
Barcode 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "Barcode.Scan"; Image { ; AllowedTypes } )   More

Parameters

Parameter Description Example Flags
Image The image to scan for a barcode.
Can be container with image or an Image reference number from our GraphicsMagick image functions.
$image
AllowedTypes The list of types to allow.
Default is empty for all types.

Types allowed: All, EAN8, UPCE, ISBN10, UPCA, EAN13, ISBN13, I25, CODE39, PDF417, QRCode, CODE128, Symbol.
"all" Optional

Result

Returns JSON or error.

Description

Scans for barcodes in a picture.
Please use Barcode.LoadLibrary once in start script to load zbar library before using this function.
Works best with black & white picture, so you may enhance contrast.

ZBar is an open source software suite for reading bar codes from various sources, such as video streams, image files and raw intensity sensors. It supports many popular symbologies (types of bar codes) including EAN-13/UPC-A, UPC-E, EAN-8, Code 128, Code 39, Interleaved 2 of 5 and QR Code.

ZBar is licensed under the GNU LGPL 2.1 to enable development of both open source and commercial projects.

For FileMaker Go, please use PSoS and do the scan server side. Or build your own app based on the FileMaker iOS SDK with Xcode and embed the MBS Plugin and the zbar library for on device detection.

The JSON array includes objects with following keys:

KeyValue
typeThe number for the type of barcode.
nameThe name of the barcode type.
qualityThe quality level.
textThe content of the barcode.
xmlThe XML representation from zbar for this barcode.
boundsTopThe top of the bounding box.
boundsLeftThe left of the bounding box.
boundsRightThe right of the bounding box.
boundsBottomThe bottom of the bounding box.
componentsThe components of a composed barcodes.

We have a copy of zbar here:
https://www.monkeybreadsoftware.com/filemaker/files/Libs/

With MBS Plugin 13.2, if you didn't call Barcode.LoadLibrary, this function will try to automatically load zbar library.

Examples

Scan for barcodes in picture:

Set Variable [ $r ; Value: MBS("Barcode.Scan"; MyRecord::Picture) ]
Set Field [ MyRecord::QRCodeResult ; $r ]
Commit Records/Requests [ With dialog: Off ]

Example result:
[ { "type": 12, "name": "UPC-A", "quality": 99, "text": "725272702703", "xml": "<symbol type='UPC-A' quality='99'><data><![CDATA[725272702703]]></data></symbol>", "boundsTop": 0, "boundsLeft": 20, "boundsRight": 210, "boundsBottom": 49 } ]

See also

Release notes

Example Databases

Blog Entries

This function checks for a license.

Created 23th May 2021, last changed 19th April 2023


Barcode.Modulo10Checksum - Barcode.SetInputMode