Here you may get thousands pre-made source code samples for simple implementation in your own programming VBScript projects. ByteScout Premium Suite was made to help with pdf ocr (optical character recognition) with pdf extractor sdk in VBScript. ByteScout Premium Suite is the set that includes 12 SDK products from ByteScout including tools and components for PDF, barcodes, spreadsheets, screen video recording.
VBScript code snippet like this for ByteScout Premium Suite works best when you need to quickly implement pdf ocr (optical character recognition) with pdf extractor sdk in your VBScript application. If you want to know how it works, then this VBScript sample code should be copied and pasted into your application’s code editor. Then just compile and run it. Check these VBScript sample code examples to see if they acknowledge to your needs and requirements for the project.
ByteScout Premium Suite free trial version is available for download from our website. Free trial also includes programming tutorials along with source code samples.
' This example demonstrates the use of Optical Character Recognition (OCR) 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" ' 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 ' You can also apply various preprocessing filters to improve the recognition on low-quality scans. ' But they significantly hit the performance, so do not enable them by default. ' Automatically deskew skewed scans 'extractor.OCRImagePreprocessingFilters.AddDeskew() ' Remove vertical or horizontal lines (sometimes helps to avoid OCR engine's page segmentation errors) 'extractor.OCRImagePreprocessingFilters.AddVerticalLinesRemover() 'extractor.OCRImagePreprocessingFilters.AddHorizontalLinesRemover() ' Repair broken letters 'extractor.OCRImagePreprocessingFilters.AddDilate() ' Remove noise 'extractor.OCRImagePreprocessingFilters.AddMedian() ' Apply Gamma Correction 'extractor.OCRImagePreprocessingFilters.AddGammaCorrection() ' Add Contrast ' extractor.OCRImagePreprocessingFilters.AddContrast(20) ' (!) You can use new OCRAnalyzer class to find an optimal set of image preprocessing ' filters for your specific document. ' See "OCR Analyser" example. ' Save extracted text to file extractor.SaveTextToFile("output.txt") WScript.Echo "Extracted text saved as 'output.txt'." Set extractor = Nothing