DecodeFile Method

Description

Decodes a local file specified by its full path and finds the barcodes in it.

Syntax

Public Sub DecodeFile (ByVal strFileName As String)

Parameters

strFileName
The path of the file.

Remarks

The file to read needs to be an image in the formats BMP, JPG, PNG, TIFF or PDF.

If your barcodes are from PDF files, DynamicPdf.dll and DynamicPdfx64.dll are mandatory.

Example

Dim reader As New DBRCtrl.BarcodeReader
Dim rdOption As New DBRCtrl.ReaderOptions
Dim oBarcodeFormat As New BarcodeFormat
rdOption.MaxBarcodesNumPerPage = 1
rdOption.BarcodeFormats = _
        oBarcodeFormat.OneD  Or _ 
        oBarcodeFormat.QR_CODE Or _
        oBarcodeFormat.PDF417 Or _
        oBarcodeFormat.DATAMATRIX
Set reader.ReaderOptions = rdOption
reader.DecodeFile "c:\test.bmp"
Dim iCount As Integer
Dim oBarcodes As BarcodeResultArray
Set oBarcodes = reader.Barcodes
iCount = oBarcodes.Count
For i = 0 To iCount - 1
   Dim bc As BarcodeResult
   Set bc = oBarcodes.Item(i)
   MsgBox bc.BarcodeText
Next i
Set reader = Nothing
Set rdOption = Nothing
Set oBarcodeFormat = Nothing

See Also

ActiveX/COM > Objects > BarcodeReader > DecodeFileRect
ActiveX/COM > Objects > BarcodeReader > ErrorCode
ActiveX/COM > Objects > ReaderOptions > BarcodeFormats
ActiveX/COM > Objects > ReaderOptions > MaxBarcodesNumPerPage
ActiveX/COM > Objects > BarcodeResult
ActiveX/COM > Objects > BarcodeResultArray