ArcGIS Pro 3.8 API Reference Guide
ArcGIS.Core.OCR Namespace / OCRTSVOutput Class
Members Example

In This Topic
    OCRTSVOutput Class
    In This Topic
    Output from an OCR operation requesting TSV output; that is with OCROptions.OutputType equal to OCROutputType.TSV. See OCRManager.ExtractFromDocumentAsync or OCRManager.ExtractFromDocumentAsync.
    Syntax
    public sealed class OCRTSVOutput : OCROutput 
    Public NotInheritable Class OCRTSVOutput 
       Inherits OCROutput
    Remarks
    The TSV output hierarchy is as follows: - OCRPage -> OCRBlock -> OCRParagraph -> OCRLine -> OCRWord.

    That is, the OCRTSVOutput contains a set of OCRPages. Each OCRPage contains a set of OCRBlocks. Each OCRBlock contains a set of OCRParagraphs. Each OCRParagraph contains a set of OCRLines. Each OCRLine contains a set of OCRWords.

    Example
    Extract TSV output from a document
    {
      string docFileName = "c:\\MyData\\MyDocument.bmp";
    
      var ocrOptions = new OCROptions(docFileName);
      ocrOptions.OutputType = OCROutputType.TSV;
    
      // 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;
    
      var output = await OCRManager.Instance.ExtractFromDocumentAsync(ocrOptions);
      if (output is OCRTSVOutput ocr_tsvOutput)
      {
        // process the tsv output
        foreach (var page in ocr_tsvOutput.Pages)
        {
          foreach (var block in page.Blocks)
          {
            foreach (var para in block.Paragraphs)
            {
              foreach (var line in para.Lines)
              {
                foreach (var word in line.Words)
                {
                  var content = word.Content;
                  var confidence = word.Confidence;
    
                  // process content according to confidence
                }
              }
            }
          }
        }
      }
    }
    Inheritance Hierarchy

    System.Object
       ArcGIS.Core.OCR.OCROutput
          ArcGIS.Core.OCR.OCRTSVOutput

    Requirements

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

    ArcGIS Pro version: 3.8 or higher.
    See Also