Sample source code below will display you how to manage a complex task like search barcodes in documents and write results to file with barcode reader sdk in VBScript. ByteScout Data Extraction Suite can search barcodes in documents and write results to file with barcode reader sdk. It can be applied from VBScript. ByteScout Data Extraction Suite is the set that includes 3 SDK products for data extraction from PDF, scans, images and from spreadsheets: PDF Extractor SDK, Data Extraction SDK, Barcode Reader SDK.
This prolific sample source code in VBScript for ByteScout Data Extraction Suite contains various functions and other necessary options you should do calling the API to search barcodes in documents and write results to file with barcode reader sdk. This VBScript 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! This basic programming language sample code for VBScript will do the whole work for you to search barcodes in documents and write results to file with barcode reader sdk.
You can download free trial version of ByteScout Data Extraction Suite from our website with this and other source code samples for VBScript.
' Create BarCodeReader object Set bc = CreateObject("Bytescout.BarCodeReader.Reader") ' Limit barcode search to PDF417 barcodes only bc.BarcodeTypesToFind.PDF417 = True ' Create File System object Set FSO = CreateObject("Scripting.FileSystemObject") ' Get folder object (current folder) Set objFolder = FSO.GetFolder(".") ' Get file list Set files = objFolder.Files ' Create output file Set TS = FSO.CreateTextFile("output.txt") ' Run barcode search for PDF and TIFF files For Each file in files ext = UCase(FSO.GetExtensionName(file)) If ext = "PDF" Or ext = "TIF" Then bc.ReadFromFile file.Name For i = 0 To bc.FoundCount - 1 ' Write found barcode information to output file TS.Write("File: """ & file.Name & """ Page " & CStr(bc.GetFoundBarcodePage(i)) & ": Barcode: " & bc.GetFoundBarcodeValue(i)) & vbCRLF Next End If Next TS.Close Set bc = Nothing Set TS = Nothing Set FSO = Nothing MsgBox "Done! See output.txt with found results"