Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 10.0   10.1   10.2   10.3   10.4   10.5   11.0   11.1   11.2   11.3    Statistic    FMM    Blog  


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


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.
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


Returns JSON or error.


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.


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 ]

See also

Release notes

  • Version 11.3
    • Added AllowedTypes parameter to Barcode.Scan function.
    • Added zbar library support to better detect barcodes with Barcode.LoadLibrary and Barcode.Scan functions.

Blog Entries

Created 23th May 2021, last changed 7th June 2021

Barcode.Modulo10Checksum - Barcode.SetInputMode

Feedback: Report problem or ask question.

MBS Xojo tutorial videos

Start Chat