Free Trial
Web API version
Licensing
Request A Quote
HAVE QUESTIONS OR NEED HELP? SUBMIT THE SUPPORT REQUEST FORM or write email to SUPPORT@BYTESCOUT.COM
Maximize performance and speed | VBScript
ExtractTextFromImageOrScannedPdfUsingOcr.vbs:
VB
' This example demonstrates the use of Optical Character Recognition (OCR) with "OCRMaximizeCPUUtilization" property to extract text ' from scanned PDF documents and raster images. ' Create TextExtractor object Set extractor = CreateObject("Bytescout.PDFExtractor.TextExtractor") extractor.RegistrationName = "demo" extractor.RegistrationKey = "demo" ' Load sample PDF document extractor.LoadDocumentFromFile("sample_ocr.pdf") ' Enable Optical Character Recognition (OCR) extractor.OCRMode = 1 ' OCRMode.Auto = 1 ' Set the location of OCR language data files extractor.OCRLanguageDataFolder = "c:\Program Files\Bytescout PDF Extractor 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. extractor.OCRLanguage = "eng" ' Find more language files at https://github.com/bytescout/ocrdata ' Set PDF document rendering resolution extractor.OCRResolution = 300 ' Enables max use of CPU and max use of multiple threads during OCR extractor.OCRMaximizeCPUUtilization = True ' Save extracted text to file extractor.SaveTextToFile("output.txt") WScript.Echo "Extracted text saved as 'output.txt'." Set extractor = Nothing