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:
9.3
9.4
9.5
10.0
10.1
10.2
10.3
10.4
10.5
10.6
Statistic
FMM
Blog
OCR.GetTextWithCoordinates
Queries text with coordinates.
| Component | Version | macOS | Windows | Linux | Server | FileMaker iOS SDK |
| OCR | 6.5 | Yes | Yes | Yes | Yes | Yes |
Parameters
none
Result
Returns list or error.
Description
Queries text with coordinates.Please call OCR.Recognize or OCR.GetText or another function first to trigger recognition.
Returns a list with tab separated values. First 4 values define the pixel coordinates. Than followed by style and font size. Finally the word.
Columns: left, top, right, bottom, isBold, isItalic, isUnderlined, isMonospace, isSerif, isSmallCaps, Pointsize, Text.
e.g.
| left | top | right | bottom | isBold | isItalic | isUnderlined | isMonospace | isSerif | isSmallCaps | Pointsize | Text |
| 36 | 194 | 91 | 218 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | The |
| 102 | 194 | 177 | 224 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | quick |
| 189 | 194 | 274 | 218 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | brown |
| 287 | 194 | 339 | 225 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | dog |
| 348 | 194 | 456 | 225 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | jumped |
| 468 | 200 | 531 | 218 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | over |
| 540 | 194 | 585 | 218 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | the |
| 37 | 228 | 92 | 259 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | lazy |
| 103 | 228 | 153 | 252 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | fox. |
Examples
Recognize:
#Init OCR
Set Variable [$r; Value:MBS( "OCR.Initialize"; "/Users/cs/Documents"; "eng")]
Set Variable [$rr; Value:MBS( "OCR.SetPageSegMode"; "Auto")]
#Process Image
Set Variable [$img; Value:MBS("GMImage.NewFromContainer"; OCR::Image)]
Set Variable [$r; Value:MBS( "OCR.SetImage"; $img)]
Set Variable [$rr; Value:MBS( "OCR.Recognize")]
Set Field [OCR::Text; MBS("OCR.GetTextWithCoordinates")]
#Cleanup
Set Variable [$r; Value:MBS( "OCR.Cleanup")]
Set Variable [$r; Value:MBS( "GMImage.Release"; $img)]
See also
- GMImage.New
- GMImage.NewFromContainer
- GMImage.Release
- OCR.Cleanup
- OCR.GetText
- OCR.Initialize
- OCR.Recognize
- OCR.SetImage
- OCR.SetPageSegMode
Created 30th September 2016, last changed 21st December 2018
Feedback: Report problem or ask question.
Links
MBS Xojo tutorial videos