<!--Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default"--><!--CTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt--> <script type="text/vbscript">// <![CDATA[ Sub Value() Msgbox "Hello" End Sub Sub ScanProcessImage Set CSSNLib1 = CreateObject("ScanX.CSSNLib") Dim imageType Dim imgScannedImage Dim rad_val Dim result ' // Clear data ' ClearDataFromControls ' // Scan '// For Bar Code scanning we need to scan at 600 dpi. For DL scan and Medi cards scan we can use 300 dpi CSSNLib1.setResolution(600) CSSNLib1.setScanHeight(-1) CSSNLib1.setScanWidth(-1) result = CSSNLib1.ScanToFileEx("D:\\Analysis Docs\\Scanner-SDK Card Scan Sample\\Test Licence\\WebSite1\\TestPics\\VBScriptScan.jpg") ' ScannerErrorAlert result ' // Load scanned Image ' imgScannedImage = document.getElementsByName("imgScannedImage") ' imgScannedImage.src = "C:\\temp\\VBScriptScan.jpg" ' ProcessDriverLicense End Sub Sub ScanProcessImage Msgbox "Hello" Set CSSNLib1 = CreateObject("ScanX.CSSNLib") Dim imageType Dim imgScannedImage Dim rad_val Dim result Dim CSSNLib1 Dim LicsKey LicsKey = "2GC97EWB8WTHA81U" Set CSSNLib1 = CreateObject("ScanX.CSSNLib") ' // Set SnapShell as default scanner CSSNLib1.DefaultScanner = 13 ' //Init Scanner Library result = CSSNLib1.InitSLibLibrary(cstr(LicsKey)) ' ScannerErrorAlert result ' // Clear data ' ' // Scan ' // For Bar Code scanning we need to scan at 600 dpi. For DL scan and Medi cards scan we can use 300 dpi CSSNLib1.setResolution(600) CSSNLib1.setScanHeight(-1) CSSNLib1.setScanWidth(-1) result = CSSNLib1.ScanToFileEx("D:\\Analysis Docs\\Scanner-SDK Card Scan Sample\\Test Licence\\WebSite1\\TestPics\\VBScriptScan.jpg") ' ScannerErrorAlert result ' // Load scanned Image imgScannedImage = document.getElementsByName("imgScannedImage") imgScannedImage.src = "D:\\Analysis Docs\\Scanner-SDK Card Scan Sample\\Test Licence\\WebSite1\\TestPics\\VBScriptScan.jpg" ' ProcessDriverLicense End Sub Sub ProcessDriverLicense Dim StateId Dim retVal Dim faceImagePath Dim imgFaceImage Dim signImagePath Dim imgSignImage Dim result Dim propTextElement Set CSSNLib1 = CreateObject("ScanX.CSSNLib") '//Init Image library result = CSSNLib1.InitCImageLibrary(CStr(LicsKey)) 'Alert result '//Init IDData library result = CSSNLib1.InitIdDataLibrary(CStr(LicsKey)) 'Alert result result = CSSNLib1.RegionSetDetectionSequence(0, 1 ,2, 3, 6, -1, -1) '//0 - USA, 1 - Canada. Change the sequence according to the country you are scanning 'IDdataAlertErrorAlert result StateId = CSSNLib1.AutoDetectState("") 'IDdataAlertErrorAlert result If(StateId > 0) Then retVal = CSSNLib1.ProcState("", clng(StateId)) 'IDdataAlertErrorAlert result '// Face image faceImagePath = "D:\\Analysis Docs\\Scanner-SDK Card Scan Sample\\Test Licence\\WebSite1\\TestPics\\faceImageVBA.jpg" retVal = CSSNLib1.GetFaceImage("", CStr(faceImagePath), clng(StateId)) 'IDdataAlertErrorAlert result ' // Sign image signImagePath = "D:\\Analysis Docs\\Scanner-SDK Card Scan Sample\\Test Licence\\WebSite1\\TestPics\\signImageVBA.jpg" retVal = CSSNLib1.GetSignImage("", CStr(signImagePath), clng(StateId)) ' IDdataAlertErrorAlert result ' // Load face image imgFaceImage = document.getElementsByName("imgFaceImage") imgFaceImage.src = faceImagePath ' // Load sign image imgSignImage = document.getElementsByName("imgSignImage") imgSignImage.src = signImagePath ' // Display results dim id id = document.getElementsByName("id") id.value = CSSNLib1.Id dim FirstName FirstName = document.getElementsByName("fname") FirstName.Value = CSSNLib1.NameFirst dim LastName LastName= document.getElementsByName("lname") LastName.Value= CSSNLib1.NameLast dim Address Address= document.getElementsByName("address") Address.Value =CSSNLib1.Address dim DOB DOB = document.getElementsByName("dob") DOB.Value = CSSNLib1.DateOfBirth dim City City = document.getElementsByName("city") City.Value= CSSNLib1.City dim State State = document.getElementsByName("state") State.Value= CSSNLib1.State dim Zip Zip = document.getElementsByName("zip") Zip.Value = CSSNLib1.Zip '//MsgBox("Address - " & CSSNLib1.Address & VbCrLf & "Address 2 - " & CSSNLib1.Address2 & VbCrLf & "City - " & CSSNLib1.City & VbCrLf & "Zip - " & CSSNLib1.Zip & VbCrLf & "State - " & CSSNLib1.State) End If End Sub // ]]></script> <form id="form1" enctype="application/x-www-form-urlencoded" method="get">
Face image Sign image
ID <input id="id" type="text" />
First Name <input id="fname" type="text" />
Last Name <input id="lname" type="text" />
DOB <input id="dob" type="text" />
Address <input id="address" type="text" />
City <input id="city" type="text" />
State <input id="State" type="text" />
Zip <input id="zip" type="text" />
<input onclick="ScanProcessImage()" name="aButton" type="button" value="Scan" /> </form>

Last edited Jun 2, 2012 at 12:59 AM by sutirth_patel, version 4