This page explains the steps and algorithm of implementing check if ocr is required for pdf with pdf extractor sdk and how to make it work in your application. Check if ocr is required for pdf with pdf extractor sdk in VB.NET can be applied with ByteScout PDF Suite. ByteScout PDF Suite is the set that includes 6 SDK products 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.
This rich and prolific sample source code in VB.NET for ByteScout PDF Suite contains various functions and options you should do calling the API to implement check if ocr is required for pdf with pdf extractor sdk. To use check if ocr is required for pdf with pdf extractor sdk in your VB.NET project or application just copy & paste the code and then run your app! These VB.NET sample examples can be used in one or many applications.
Trial version along with the source code samples for VB.NET can be downloaded from our website
On-demand (REST Web API) version:
Web API (on-demand version)
On-premise offline SDK for Windows:
60 Day Free Trial (on-premise)
Imports Bytescout.PDFExtractor
Module Program
Sub Main()
Try
' Loop through all files in directory and check whether OCR operation is required
For Each filePath As String In System.IO.Directory.GetFiles("InputFiles")
_CheckOCRRequired(filePath)
Next
Catch ex As Exception
Console.WriteLine("Error: " + ex.Message)
End Try
Console.WriteLine("Press enter key to exit...")
Console.ReadLine()
End Sub
''' <summary>
''' Check whether OCR Operation is required
''' </summary>
''' <param name="filePath"></param>
Private Sub _CheckOCRRequired(ByVal filePath As String)
' Read all file content...
Using extractor As TextExtractor = New TextExtractor()
extractor.RegistrationKey = "demo"
extractor.RegistrationName = "demo"
' Load document
extractor.LoadDocumentFromFile(filePath)
Console.WriteLine("{1}*******************{1}{1}FilePath: {0}", filePath, vbLf)
Dim pageIndex As Int32 = 0
' Identify OCR operation is recommended for page
If (extractor.IsOCRRecommendedForPage(pageIndex)) Then
Console.WriteLine("{0}OCR Recommended: True", vbLf)
' Enable Optical Character Recognition (OCR)
' in .Auto mode (SDK automatically checks if needs to use OCR or not)
extractor.OCRMode = OCRMode.Auto
' Set the location of OCR language data files
extractor.OCRLanguageDataFolder = "c:\Program Files\Bytescout PDF Extractor SDK\ocrdata\"
' Set OCR language
extractor.OCRLanguage = "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
' Set PDF document rendering resolution
extractor.OCRResolution = 300
Else
Console.WriteLine("{0}OCR Recommended: False", vbLf)
End If
' Read all text
Dim allExtractedText = extractor.GetText()
Console.WriteLine("{1}Extracted Text:{1}{0}{1}{1}", allExtractedText, vbLf)
End Using
End Sub
End Module
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
Get Your API Key
Explore Web API Docs
Explore Web API Samples
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
Get Your API Key
Explore Web API Docs
Explore Web API Samples
also available as: