Image Viewer CP ActiveX Control

BarCodeReadPDFScan

 

Start to scanning barcode of PDF file for advanced Barcode recognition.

Public Function BarCodeReadPDFScan(
   ByVal iPage As long, _
   ByVal iImageIndex As long)
 As Integer

 

Parameter

iPage
Specifies the page number for scanning barcode. The first page is 1.

iImageIndex
Specifies the index of image for scanning barcode. The first index of image is 1.
Use BarCodeReadPDFImageCount method can get the total count of image for specifc page.

Return Value

Return the number of barcode detected, if return value smaller than 0, it mean failed.

Example

   

Visual Basic Syntax

iPageCount =ImageViewer1.BarCodeReadPDFOpen(strPDFFile)
 For i = 1 To iPageCount
  cbopdfpage.AddItem ("Page " + Trim(Str(i)))
 Next

If cbopdfpage.ListCount > 0 Then
 cbopdfpage.ListIndex = 0
End If

iImageCountPerPage=ImageViewer1.BarCodeReadPDFImageCount(cbopdfpage.ListIndex+1)
For i = 1 To iImageCountPerPage
cbopdfimageperpage.AddItem ("Image " + Trim(Str(i)))
Next

If cbopdfimageperpage.ListCount > 0 Then
cbopdfimageperpage.ListIndex = 0
End If
ImageViewer1.BarCodeReadScanMultiple = False
ImageViewer1.BarCodeReadScanWithoutRotation = True
ImageViewer1.BarCodeReadScan45Rotation =True
ImageViewer1.BarCodeReadScan45CouterRotation =True
ImageViewer1.BarCodeReadScanAccuracy = True
ImageViewer1.BarCodeReadCustomRotation=0

ibarcodeCount = Me.ImageViewer1.BarCodeReadPDFScan(cbopdfpage.ListIndex + 1, cbopdfimageperpage.ListIndex + 1)

str1 = "Total " + Str(ibarcodeCount) + " BarCode detected" + Chr(13) + Chr(10)

For i = 0 To ibarcodeCount - 1
strTmp = Me.ImageViewer1.BarCodeGetType(i) + " score:" + Str(Me.ImageViewer1.BarCodeGetScore(i)) + " value:" + Me.ImageViewer1.BarCodeGetValue(i)
str1 = str1 + Chr(13) + Chr(10) + strTmp
Next

MsgBox str1