bardecode.com

  • Increase font size
  • Default font size
  • Decrease font size
Home Knowledge Base Identifying output files when using tiff split

Identifying output files when using tiff split

This article explains how to correlate the output files produced during a tiff split process against the barcode values returned by GetBarString. The algorithm shown here assumes default split mode (TiffSplitMode = 0) and handles multiple barcodes on a single page and the possibility of no barcode on the first page.

The code below uses the .net component, but it could equally be applied to other interfaces if GetBarStringPage was replaced by GetBarStringPos. In the algorithm, fileIndex is only increased when the current barcode is on a new page, and the boolean variable doneFile is use to make sure that output files are only processed once.

        barcode = New SoftekBarcodeLib2.BarcodeReader

        barcode.TifSplitMode = 0
        barcode.TifSplitPath = "C:\temp\output%d.tif"

        nBarCodes = barcode.ScanBarCode(inputFilePath)

        Dim page As Integer
        Dim fileIndex As Integer
        Dim doneFile As Boolean
        Dim barstring As String

        page = 1
        fileIndex = 1
        doneFile = False

        For i = 1 To nBarCodes
            barstring = barcode.GetBarString(i)
            If barcode.GetBarStringPage(i) > page Then
                page = barcode.GetBarStringPage(i)
                fileIndex = fileIndex + 1
                doneFile = False
            End If
            If doneFile = False Then
                MsgBox("Process file " & fileIndex.ToString() & " with lead barcode value " & barstring)
                doneFile = True
            End If
        Next