Find the first barcode
Visual Basic |
---|
Public Function FirstBarcode() As CiBarcode |
Use FirstBarcode/NextBarcode methods when searching for barcodes with specific requirements, e.g., prefix presence in CiBarcode.Text value
Sub ReadBarcodes2DFirstNext(imageFile As String) ' Create objects and open input images Dim Ci As New CiServer Dim Barcode As CiBarcode, reader Set reader = Ci.CreatePdf417 ' To read PDF416 barcodes ' Set reader = Ci.CreateDataMatrix ' To read DataMatrix barcodes ' Set reader = Ci.CreateQR ' To read QR barcodes reader.Image.Open imageFile ' Configure reader ' reader.Directions = cibHorz ' Limit barcode search direction (Faster processing) Set Barcode = reader.FirstBarcode Do While Not Barcode Is Nothing Debug.Print Barcode.Text & vbCrLf ' If (barcodeFound) Then Exit For ' End processing after the first barcode matching specific requirements is found Set Barcode = reader.NextBarcode Loop End Sub