WindowsOCR.Recognize
--------------------

Scans the specified image for text.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [WindowsOCR](component_WindowsOCR.md) | [13.1](newinversion131.md) | ❌ No | ✅ Yes | ❌ No | ✅ Yes, on Windows | ❌ No |

MBS( "WindowsOCR.Recognize"; OCR; Image ) 

**MBS**( **"WindowsOCR.Recognize";** /\* Scans the specified image for text. \*/  
**$OCR**; /\* The reference number of the ocr engine. \*/   
**$Image**) /\* The image container to use.  
Can be JPEG, PNG, BMP, PDF and other data types.e.g. MyTable::Image \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| OCR | The reference number of the ocr engine. | $ocr |
| Image | The image container to use.   Can be JPEG, PNG, BMP, PDF and other data types. | MyTable::Image |

### Result

Returns OK or error.

### Description

Scans the specified image for text.  
We will ask Windows to load the image from the image container and then run OCR.  
  
Seems to work fine for JPEG and PNG files, but other formats may be supported by Windows, too.  
We built-in support for PDF files to recognize text from first page.  
  
See also [Vision.RecognizeText](VisionRecognizeText.md) function.  
### Examples

Recognize some text from image:

 Set Variable \[ $ocr ; Value: MBS ( "[WindowsOCR.New](WindowsOCRNew.md)"; Windows OCR::Language ) \]   
If \[ MBS ("IsError") \]   
 Show Custom Dialog \[ "Windows OCR" ; "Failed to intiialize: " &amp; $ocr \]   
Else  
 Set Variable \[ $r ; Value: MBS ( "WindowsOCR.Recognize"; $ocr ; Windows OCR::InputImage ) \]   
 If \[ MBS ("IsError") \]   
 Show Custom Dialog \[ "Windows OCR" ; "Failed to recognize: " &amp; $r \]   
 Else  
 Set Field \[ Windows OCR::Text ; MBS ( "[WindowsOCR.Text](WindowsOCRText.md)"; $ocr ) \]   
 End If  
 #   
 Set Variable \[ $r ; Value: MBS ( "[WindowsOCR.Release](WindowsOCRRelease.md)"; $ocr ) \]   
End If  
### See also

- [IsError](IsError.md)
- [OCR.Recognize](OCRRecognize.md)
- [Vision.RecognizeText](VisionRecognizeText.md)
- [WindowsOCR.New](WindowsOCRNew.md)
- [WindowsOCR.RecognizeFile](WindowsOCRRecognizeFile.md)
- [WindowsOCR.Release](WindowsOCRRelease.md)
- [WindowsOCR.Text](WindowsOCRText.md)

### Example Databases

- [Win Only/Windows OCR](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Win%20Only/Windows%20OCR.shtml#2ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Advent calendar - Door 20 - Scan and Recognize](https://www.mbsplugins.de/archive/2024-12-20/MBS_FileMaker_Advent_calendar_/monkeybreadsoftware_blog_filemaker)
- [MBS Plugin Advent calendar: 5 - WindowsOCR](https://www.mbsplugins.de/archive/2023-12-05/MBS_Plugin_Advent_calendar_5_-/monkeybreadsoftware_blog_filemaker)
- [OCR on Windows in FileMaker](https://www.mbsplugins.de/archive/2023-02-07/OCR_on_Windows_in_FileMaker/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 2/2023, Seite 28](https://filemaker-magazin.de/neuigkeit/4223-Appetithappen-FMM_202302)

This function checks for a license.

Created 22nd January 2023 , last changed 31st January 2023

  
[WindowsOCR.New](WindowsOCRNew.md) - [WindowsOCR.RecognizeFile](WindowsOCRRecognizeFile.md)

[HTML Version](WindowsOCRRecognize.shtml)