ByteScout PDF Suite - VB.NET - Ocr analyser in pdf with pdf extractor sdk - ByteScout

ByteScout PDF Suite – VB.NET – Ocr analyser in pdf with pdf extractor sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF Suite – VB.NET – Ocr analyser in pdf with pdf extractor sdk

ocr analyser in pdf with pdf extractor sdk in VB.NET and ByteScout PDF Suite

Learn to code in VB.NET to make ocr analyser in pdf with pdf extractor sdk with this simple How-To tutorial

Every ByteScout tool includes sampleVB.NET source codes that you can find here or in the folder with installed ByteScout product. ByteScout PDF Suite helps with ocr analyser in pdf with pdf extractor sdk in VB.NET. ByteScout PDF Suite is the bundle that provides six different SDK libraries to work with PDF from generating rich PDF reports to extracting data from PDF documents and converting them to HTML. This bundle includes PDF (Generator) SDK, PDF Renderer SDK, PDF Extractor SDK, PDF to HTML SDK, PDF Viewer SDK and PDF Generator SDK for Javascript.

VB.NET code snippet like this for ByteScout PDF Suite works best when you need to quickly implement ocr analyser in pdf with pdf extractor sdk in your VB.NET application. To use ocr analyser in pdf with pdf extractor sdk in your VB.NET project or application just copy & paste the code and then run your app! VB.NET application implementation mostly involves various stages of the software development so even if the functionality works please check it with your data and the production environment.

Trial version can be downloaded from our website for free. It contains this and other source code samples for VB.NET.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

Program.vb
      
Imports System.Drawing Imports Bytescout.PDFExtractor ' This example demonstrates the use of OCR Analyser - a tooling class for analysis of scanned documents ' in PDF or raster image formats to find best parameters for Optical Character Recognition (OCR) that ' provide highest recognition quality. ' To make OCR work you should add the following references to your project: ' 'Bytescout.PDFExtractor.dll', 'Bytescout.PDFExtractor.OCRExtension.dll'. Class Program Friend Shared Sub Main(args As String()) ' Input document Dim inputDocument As String = ".\sample_ocr.pdf" ' Document page index Dim pageIndex As Integer = 0 ' Area of the document page to perform the analysis (optional). ' RectangleF.Empty means the full page. Dim rectangle As RectangleF = RectangleF.Empty ' New RectangleF(100, 50, 350, 250) ' Location of OCR language data files Dim ocrLanguageDataFolder As String = "c:\Program Files\Bytescout PDF Extractor SDK\ocrdata_best\" ' OCR language Dim ocrLanguage As String = "eng" ' "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/tree/master/ocrdata_best ' Create OCRAnalyzer instance and activate it with your registration information Using ocrAnalyzer As New OCRAnalyzer("demo", "demo") ' Display analysis progress AddHandler ocrAnalyzer.ProgressChanged, Sub(sender, message, progress, ByRef cancel) Console.WriteLine(message) End Sub ' Load document to OCRAnalyzer ocrAnalyzer.LoadDocumentFromFile(inputDocument) ' Setup OCRAnalyzer ocrAnalyzer.OCRLanguage = ocrLanguage ocrAnalyzer.OCRLanguageDataFolder = ocrLanguageDataFolder ' Set page area for analysis (optional) ocrAnalyzer.SetExtractionArea(rectangle) ' Perform analysis and get results Dim analysisResults As OCRAnalysisResults = ocrAnalyzer.AnalyzeByOCRConfidence(pageIndex) ' Now extract page text using detected OCR parameters Dim outputDocument As String = ".\result.txt" ' Create TextExtractor instance Using textExtractor As TextExtractor = New TextExtractor("demo", "demo") ' Load document to TextExtractor textExtractor.LoadDocumentFromFile(inputDocument) ' Setup TextExtractor textExtractor.OCRMode = OCRMode.Auto textExtractor.OCRLanguageDataFolder = ocrLanguageDataFolder textExtractor.OCRLanguage = ocrLanguage ' Apply analysys results to TextExtractor instance ocrAnalyzer.ApplyResults(analysisResults, textExtractor) ' Set extraction area (optional) textExtractor.SetExtractionArea(rectangle) ' Save extracted text to file textExtractor.SaveTextToFile(outputDocument) ' Open output file in default associated application (for demonstration purposes) System.Diagnostics.Process.Start(outputDocument) End Using End Using End Sub End Class

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout PDF Suite Home Page

Explore ByteScout PDF Suite Documentation

Explore Samples

Sign Up for ByteScout PDF Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout PDF Suite Home Page

Explore ByteScout PDF Suite Documentation

Explore Samples

Sign Up for ByteScout PDF Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next