ClearImage .NET API
FirstBarcode Method (CiPdf417)
Example 





Inlite.ClearImage Namespace > CiPdf417 Class : FirstBarcode Method
Find first barcode
Syntax
'Declaration
 
Public Function FirstBarcode() As CiBarcode
'Usage
 
Dim instance As CiPdf417
Dim value As CiBarcode
 
value = instance.FirstBarcode()
public CiBarcode FirstBarcode()
public function FirstBarcode(): CiBarcode; 
public function FirstBarcode() : CiBarcode;
public:
CiBarcode^ FirstBarcode(); 
Remarks

Use FirstBarcode/NextBarcode methods when searching for barcodes with specific requirements, e.g., prefix presence in CiBarcode.Text value

Example
void ReadBarcodes2DFirstNext(string imageFile)
{
    // Create objects and open input images
    CiServer ci = Inlite.ClearImageNet.Server.GetThreadServer();
    CiBarcode Barcode;
    CiPdf417 reader = ci.CreatePdf417();      // To read PDF416 barcodes
    // CiDataMatrix reader = ci.CreateDataMatrix();  // To read DataMatrix barcodes
    // CiQR reader = ci.CreateQR();          // To read QR barcodes
    reader.Image.Open(imageFile, 1);
    // Configure reader
    // reader.Directions = FBarcodeDirections.cibHorz;   // Limit barcode search direction (Faster processing)
    Barcode = reader.FirstBarcode();
    while (Barcode != null)
    {
        Console.WriteLine(Barcode.Text);
        // if (barcodeFound) break Exit For '  End processing after the first barcode matching specific requirements is found
        Barcode = reader.NextBarcode();
    }
}
Sub ReadBarcodes2DFirstNext(imageFile As String)
    ' Create objects and open input images
    Dim ci As CiServer = Inlite.ClearImageNet.Server.GetThreadServer()
    Dim Barcode As CiBarcode, reader As Object
    reader = ci.CreatePdf417()      ' To read PDF416 barcodes
    ' reader = ci.CreateDataMatrix()  ' To read DataMatrix barcodes
    ' reader = ci.CreateQR()          ' To read QR barcodes
    reader.Image.Open(imageFile, 1)
    ' Configure reader
    ' reader.Directions = FBarcodeDirections.cibHorz   ' Limit barcode search direction (Faster processing)
    Barcode = reader.FirstBarcode()
    Do While Not Barcode Is Nothing
        Console.WriteLine(Barcode.Text)
        ' If (barcodeFound) Then Exit For '  End processing after the first barcode matching specific requirements is found
        Barcode = reader.NextBarcode()
    Loop
End Sub
See Also

Reference

CiPdf417 Class
CiPdf417 Members