Layout Property

An accessor property which returns the results of optical character recognition (OCR) on the specified image. Read-only Layout.

expression.Layout

*expression   * Required. An expression that returns an Image object.

Remarks

The Layout object represents the results of OCR on the specified image. Use the Layout accessor property of the Image object to return a Layout object, and to gain access to the recognized text itself (Text and Words) and summary information about the OCR results (NumWords, NumChars, NumFonts and Language).

The Layout property returns Nothing when OCR has not been performed on the page.

Example

The following example returns OCR layout information for the first page in a document.

Dim modiDoc As MODI.Document
Dim modiLayout As MODI.Layout
Dim strLayoutInfo As String
Set modiDoc = New MODI.Document
modiDoc.Create "C:\document1.tif"
modiDoc.Images(0).OCR
Set modiLayout = modiDoc.Images(0).Layout
strLayoutInfo = _
    "Language: " & modiLayout.Language & vbCrLf & _
    "Number of characters: " & modiLayout.NumChars & vbCrLf & _
    "Number of fonts: " & modiLayout.NumFonts & vbCrLf & _
    "Number of words: " & modiLayout.NumWords & vbCrLf & _
    "Beginning of text: " & Left(modiLayout.Text, 50) & vbCrLf & _
    "First word of text: " & modiLayout.Words(0).Text
MsgBox strLayoutInfo, vbInformation + vbOKOnly, _
    "Layout Information"
Set modiLayout = Nothing
Set modiDoc = Nothing

Applies to | Image Object