OCR.SetPageSegMode
------------------

Sets page segmentation mode.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [OCR](component_OCR.md) | [2.9](newinversion29.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "OCR.SetPageSegMode"; Mode ) 

**MBS**( **"OCR.SetPageSegMode";** /\* Sets page segmentation mode. \*/  
**$Mode**) /\* The new page segmentation mode.e.g. "auto" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Mode | The new page segmentation mode. | "auto" |

### Result

Returns OK on success.

### Description

Sets page segmentation mode.  
  
Possible values:  
| OSDOnly | Orientation and script detection only. |
|---|---|
| AutoOSD | Automatic page segmentation with orientation and script detection. (OSD) |
| AutoOnly | Automatic page segmentation, but no OSD, or OCR. |
| Auto | Fully automatic page segmentation, but no OSD. |
| SingleColumn | Assume a single column of text of variable sizes. |
| SingleBlockVertText | Assume a single uniform block of vertically. |
| SingleBlock | Assume a single uniform block of text. (Default) |
| SingleLine | Treat the image as a single text line. |
| SingleWord | Treat the image as a single word. |
| CircleWord | Treat the image as a single word in a circle. |
| SingleChar | Treat the image as a single character. |

### Examples

Set auto detection mode:

 MBS ( "OCR.SetPageSegMode"; "AutoOSD" )  
Set single block mode:

 MBS ( "OCR.SetPageSegMode"; "SingleBlock" )  
### See also

- [OCR.GetPageSegMode](OCRGetPageSegMode.md)
- [OCR.GetText](OCRGetText.md)
- [OCR.GetTextWithCoordinates](OCRGetTextWithCoordinates.md)

### Example Databases

- [OCR/OCR with DynaPDF](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/OCR/OCR%20with%20DynaPDF.shtml#1ScriptAnchor_)
- [OCR/OCR](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/OCR/OCR.shtml#1ScriptAnchor_)

This function is free to use.

Created 18th August 2014 , last changed 18th August 2014

  
[OCR.SetImageFile](OCRSetImageFile.md) - [OCR.SetRectangle](OCRSetRectangle.md)

[HTML Version](OCRSetPageSegMode.shtml)