Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.1   6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4    Statistic  

Barcode.Detect

Detects a barcode.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
Barcode 3.5 Yes Yes Yes Yes Yes

MBS( "Barcode.Detect"; Image; type { ; ReturnType; TryRotation; Encoding } )

Parameters

Parameter Description Example value
Image The image to scan for a barcode. Can be container with image or an Image reference number from our GraphicsMagick image functions. $image
type Which scanner to use. Supported types: Aztec, Codabar, Code39, Code93, Code128, DataMatrix, EAN8, EAN13, ITF, PDF417, QRCode, UPCA and UPCE. Pass All to scan for all types. "QRCode"
ReturnType Optional
A boolean to return the type as prefix. Pass 1 if you need prefix. Default is 0 for no prefix.
1
TryRotation Optional
A boolean value. If 1, the plugin will rotate the image 90° to find vertical barcode. Default is 0.
0
Encoding Optional
The text encoding for text parameter.
Default is native.
Possible encoding names: ANSI, Arabic-Mac, Arabic-Win, Baltic-Win, CentralEurope-Mac, ChineseSimp-Mac, ChineseSimp-Win, ChineseTrad-Mac, ChineseTrad-Win, Cyrillic-Mac, Cyrillic-Win, EasternEurope-Win, Greek-Mac, Greek-Win, Hebrew-Mac, Hebrew-Win, ISO-8859-1, ISO-8859-2, ISO-8859-3, ISO-8859-4, ISO-8859-5, ISO-8859-6, ISO-8859-7, ISO-8859-8, ISO-8859-9, ISO-8859-15, Korean-Johab, Korean-Mac, Korean-Win, Latin1, Mac, Native, ShiftJIS-Mac, ShiftJIS-Win, Turkish-Mac, Turkish-Win, UTF-8, DOS or Windows. Pass native to use the native encoding of the current platform.
UTF8

Result

Returns barcode content text or error.

Description

Detects a barcode.
We use zxing library internally and can only detect what this library handles.
Internally all images are converted to grayscale. For you getting image, it's very important to get a sharp image.
You may need to rotate or crop the image before sending into this method.

Leave some white space around as some decoders don't want to start with black frame on the edge. The barcodes generated with Barcode.Generate often don't read as they have too little resolution (e.g. scale up by 3x) and no white border around (e.g. add 5 pixels).

If special characters or umlauts are not recognized correct, you may have a wrong encoding. Most modern apps use UTF8 for encoding.

Examples

Query a QRCode:

MBS( "Barcode.Detect"; Images::Image; "QRCode" )

See also

Example Databases


Backdrop.Install   -   Barcode.DrawBarcode

Feedback: Report problem or ask question.




Links
MBS FileMaker Plugins