VintaSoft Imaging .NET SDK 15.1: Документация для .NET разработчика
В этом разделе
OCR: Как импортировать OCR-результат из hOCR-файла?
В этом разделе
Результаты распознавания текста можно импортировать из hOCR-файла.

Вот C#/VB.NET код, который демонстрирует, как импортировать результат распознавания текста из hOCR-файла и сохранить импортированный результат в текстовый файл в виде форматированного текста:
// OCR result
Vintasoft.Imaging.Ocr.Results.OcrDocument ocrResult = null;

// path to hOCR file
string hOcrFilePath = @"..\..\Resources\ocrResult.hocr";
// open hOCR file
using (System.IO.Stream stream = System.IO.File.Open(hOcrFilePath, System.IO.FileMode.Open))
{
    // create the HOcr codec
    Vintasoft.Imaging.Ocr.Results.HOcrCodec hOcrCodec = new Vintasoft.Imaging.Ocr.Results.HOcrCodec();
    // import the OCR result from hOCR file
    ocrResult = hOcrCodec.Import(stream);
}

// if OCR result is imported successfully
if (ocrResult != null)
{
    // get text of the first page
    string firstPageText = ocrResult.Pages[0].GetFormattedText();
    // save text to a text file
    System.IO.File.WriteAllText("ocrResult.txt", firstPageText, System.Text.Encoding.UTF8);
}
' OCR result
Dim ocrResult As Vintasoft.Imaging.Ocr.Results.OcrDocument = Nothing

' path to hOCR file
Dim hOcrFilePath As String = "..\..\Resources\ocrResult.hocr"
' open hOCR file
Using stream As System.IO.Stream = System.IO.File.Open(hOcrFilePath, System.IO.FileMode.Open)
    ' create the HOcr codec
    Dim hOcrCodec As New Vintasoft.Imaging.Ocr.Results.HOcrCodec()
    ' import the OCR result from hOCR file
    ocrResult = hOcrCodec.Import(stream)
End Using

' if OCR result is imported successfully
If ocrResult IsNot Nothing Then
    ' get text of the first page
    Dim firstPageText As String = ocrResult.Pages(0).GetFormattedText()
    ' save text to a text file
    System.IO.File.WriteAllText("ocrResult.txt", firstPageText, System.Text.Encoding.UTF8)
End If