Learn how to recognize text from document in VB.NET with this source code sample. ByteScout Text Recognition SDK is the software development kit for automatic text recognition and OCR from pdf documents and images. Can recognize English and non-English languages. It can recognize text from document in VB.NET.
Fast application programming interfaces of ByteScout Text Recognition SDK for VB.NET plus the instruction and the code below will help you quickly learn how to recognize text from document. This VB.NET sample code is all you need for your app. Just copy and paste the code, add references (if needs to) and you are all set! You can use these VB.NET sample examples in one or many applications.
ByteScout free trial version is available for download from our website. It includes all these programming tutorials along with source code samples.
Imports System Imports System.Diagnostics Imports Bytescout.TextRecognition Module Module1 Sub Main() Dim inputDocument As String = ".\invoice-sample.png" Dim outputDocument As String = ".\result.txt" ' Create and activate TextRecognizer instance Using textRecognizer As TextRecognizer = New TextRecognizer("demo", "demo") Try ' Load document (image or PDF) textRecognizer.LoadDocument(inputDocument) ' Set the location of OCR language data files textRecognizer.OCRLanguageDataFolder = "c:\Program Files\ByteScout Text Recognition SDK\ocrdata_best\" ' Set OCR language. ' "eng" for english, "deu" for German, "fra" for French, "spa" for Spanish, etc. - according to files in "ocrdata" folder ' Find more language files at https://github.com/bytescout/ocrdata textRecognizer.OCRLanguage = "eng" ' Recognize text from all pages and save it to file textRecognizer.SaveText(outputDocument) ' Open the result file in default associated application (for demo purposes) Process.Start(outputDocument) Catch exception As Exception Console.WriteLine(exception) End Try End Using End Sub End Module