ArcGIS Pro 3.8 API Reference Guide
ArcGIS.Core.OCR Namespace / OCROptions Class / Model Property
Example

In This Topic
    Model Property (OCROptions)
    In This Topic
    Gets and sets the language model used in the OCR operation. The default value is "eng" meaning that the default training data file used is "eng.traineddata".

    If no language model is specified, then the default "eng" model is used.

    Syntax
    public string Model {get; set;}
    Public Property Model As String
    Remarks
    Language model files should be located at [ArcGIS_Installation_folder]\Resources\OCR.
    Example
    Extract text from a document using a different model
    {
      string docFileName = "c:\\MyData\\MyDocument.jpg";
    
      var ocrOptions = new OCROptions(docFileName);
      ocrOptions.OutputType = OCROutputType.Text;
    
      // set a specific page if necessary
      // (if not set, then all pages are scanned)
      // ocrOptions.Page = pageIdx;
    
      // set the resolution if necessary
      // ocrOptions.Resolution = 400;
    
      // set the language
      // (de.traineddata should be installed at (arcgis_install_folder)\Resources\OCR)
      // if file cannot be found an exception is thrown
      ocrOptions.Model = "de";
    
      try
      {
        var output = await OCRManager.Instance.ExtractFromDocumentAsync(ocrOptions);
        var textOutput = output as OCRTextOutput;
    
        var text = textOutput.Text;
      }
      catch (ArcGIS.Core.OCR.Exceptions.OCRException ex)
      {
      }
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.8 or higher.
    See Also