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:
Key | Value |
type | The number for the type of barcode. |
name | The name of the barcode type. |
quality | The quality level. |
text | The content of the barcode. |
xml | The XML representation from zbar for this barcode. |
boundsTop | The top of the bounding box. |
boundsLeft | The left of the bounding box. |
boundsRight | The right of the bounding box. |
boundsBottom | The bottom of the bounding box. |
components | The 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
- Version 12.2
- Deprecated Barcode.Detect in favor of Barcode.Scan function.
- Version 11.3
- Added zbar library support to better detect barcodes with Barcode.LoadLibrary and Barcode.Scan functions.
Example Databases
- Barcode/Barcode Detection
- Barcode/Barcodes from Invoices
- Barcode/Swiss QR-Code for invoices/Swiss QR-Code for invoices ISO 20022
Blog Entries
- Claris FileMaker 19.5 available
- Upcoming changes for MBS Plugins
- MBS FileMaker Plugin, version 12.2pr4
- New in MBS FileMaker Plugin 11.3
- Neues MBS FileMaker Plugin 11.3
- MBS FileMaker Plugin 11.3 - More than 6500 Functions In One Plugin
- MBS FileMaker Plugin, version 11.3pr5
- Using zbar library with FileMaker
- MBS FileMaker Plugin, version 11.3pr2
- MBS FileMaker Plugin, version 11.3pr1
This function checks for a license.
Created 23th May 2021, last changed 19th April 2023