Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 7.1   7.2   7.3   7.4   7.5   8.0   8.1   8.2   8.3   8.4    Statistic  

OCR.Initialize

Initializes tesseract.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
OCR 2.9 Yes Yes Yes Yes Yes

MBS( "OCR.Initialize"; Path; Lang )

Parameters

Parameter Description Example value
Path The path to the folder where to find tessdata folder. $path
Lang The language to use. "eng"

Result

Returns OK on success.

Description

Initializes tesseract.
Pass path to parent folder of tessdata folder and language you need.
The language is (usually) an ISO 639-3 string.
To use multiple languages, please concat them with plus sign: e.g. "eng+deu"

You find our language files archive here:
http://www.monkeybreadsoftware.de/xojo/download/plugin/Libs/Tesseract/

This function requires a native path. Use Path.FileMakerPathToNativePath to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use FileDialog functions.
For Server be aware that server has limited permissions and may not be able to access all files on a computer.

Examples

Initialize with tessdata folder in same folder as database for english:

set variable $databasePath to Get(FilePath)
set variable $databasePath to MBS("Path.FileMakerPathToNativePath"; $databasePath)
set variable $databasePath to Substitute ( $databasePath ; ".fp7" ; ".fmp12")
set variable $databaseName to Get(FileName) & ".fmp12"
set variable $path to Substitute ( $databasePath ; $databaseName ; "" )
set variable $r to MBS( "OCR.Initialize"; $path; "eng")

Initialize on Server with tessdata in Server folder:

MBS( "OCR.Initialize"; "/Library/FileMaker Server/"; "eng")

Initialize on demand:

If [MBS("OCR.IsInitialized") ≠ 1]
    Set Variable [$r; Value:MBS( "OCR.Initialize"; "/Library/FileMaker Server/"; "eng")]
End If

See also

Example Databases

Created 18th August 2014, last changed 10th May 2018


OCR.GetVariable   -   OCR.IsInitialized

Feedback: Report problem or ask question.




Links
MBS FileMaker tutorial videos