CSSN ScanShell 2000, ScanShell 800, ScanShell 2000N, ScanShell 800DXN, ScanShell 3000 Description

...
Page 1
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
SDK Library Description
SDK Version 9.31.6
June 2008
Card Scanning Solutions 1
Page 2
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
Table of Context
Table of Context ..................................................................................................................................................2
Introduction ..........................................................................................................................................................4
Retrieving information from ID cards ................................ .............................................................................6
Functions and properties summery................................ ...................................................................................7
Licensing...............................................................................................................................................................8
Distribution ...........................................................................................................................................................8
Library SlibEx: General Functionality................................ ...........................................................................10
SlibEx Library Functions ................................ .................................................................................................10
1.1.1. InitLibrary .....................................................................................................................................10
1.1.2. CalibrateScanner ..........................................................................................................................11
1.1.3. Clean...............................................................................................................................................11
1.1.4. ScanToFile ....................................................................................................................................12
1.1.5. ScanToFileEX...............................................................................................................................12
SlibEx Library Properties .................................................................................................................................14
1.1.6. IsNeedCalibration ........................................................................................................................14
1.1.7. IsScannerValid..............................................................................................................................14
1.1.8. LastErrorStatus .............................................................................................................................14
1.1.9. PaperInTray ...................................................................................................................................15
1.1.10. PressedButton ..........................................................................................................................15
1.1.11. Resolution ................................................................................................................................16
1.1.12. ScanHeight ...............................................................................................................................16
1.1.13. ScannerColorScheme .............................................................................................................16
1.1.14. ScanWidth ................................................................................................................................17
1.1.15. ScannerType ............................................................................................................................17
1.1.16. Version................................ ......................................................................................................18
Library IdData: General Functionality................................ ...........................................................................19
idData Library Functions ................................ .................................................................................................19
1.1.17. AutoDetectState ................................ ......................................................................................19
1.1.18. AutoDetectStateEx ................................ .................................................................................20
1.1.19. InitLibrary ................................................................................................................................21
1.1.20. ProcState...................................................................................................................................21
1.1.21. GetFaceImage..........................................................................................................................22
1.1.22. GetFirstCountry.......................................................................................................................23
1.1.23. GetFirstStateByCountry ........................................................................................................23
1.1.24. GetNextCountry ................................ ......................................................................................24
1.1.25. GetNextStateByCountry ........................................................................................................24
1.1.26. GetSignImage ..........................................................................................................................25
1.1.27. RefreshData .............................................................................................................................26
1.1.28. RefreshDataAu ........................................................................................................................26
1.1.29. State2Id .....................................................................................................................................26
1.1.30. Id2Country ...............................................................................................................................27
1.1.31. Id2State .....................................................................................................................................27
1.1.32. StateIsSupported .....................................................................................................................28
1.1.33. GetDetectAcuracy...................................................................................................................28
1.1.34. CountySupportAutoDetect ....................................................................................................28
idData Library Properties ................................ .................................................................................................29
Library CBarCode: General Functionality ....................................................................................................30
CBarCode Library Functions ..........................................................................................................................30
1.1.35. InitLibrary ................................................................................................................................30
1.1.36. ProcImage ................................................................................................................................31
1.1.37. RefreshData .............................................................................................................................31
1.1.38. GetRawField ............................................................................................................................32
Card Scanning Solutions 2
Page 3
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
1.1.39. GetRawData.............................................................................................................................32
CBarCode Library Properties ..........................................................................................................................33
Library CImage: Properties and Functions ...................................................................................................34
1.1.40. InitLibrary ................................................................................................................................34
1.1.41. GetImageColor ........................................................................................................................34
1.1.42. RotateImage .............................................................................................................................35
1.1.43. ConvertImage ..........................................................................................................................36
1.1.44. ReformatImage ........................................................................................................................38
1.1.45. ConcatenateImage...................................................................................................................39
Library COcr: Properties and Functions........................................................................................................41
COcr Library Functions....................................................................................................................................41
1.1.46. InitLibrary ................................................................................................................................41
1.1.47. ExtractText ...............................................................................................................................41
1.1.48. ExtractTextEx..........................................................................................................................42
COcr Library Properties ...................................................................................................................................43
1.1.49. mText ........................................................................................................................................43
Library MagLib: General Functionality ........................................................................................................44
MagLib Library Functions ...............................................................................................................................44
1.1.50. InitLibrary ................................................................................................................................44
1.1.51. IsReaderValid ..........................................................................................................................45
1.1.52. WasCardSweeped ...................................................................................................................45
1.1.53. Process ................................ ......................................................................................................46
1.1.54. GetRawData.............................................................................................................................46
MagLib Library Properties ..............................................................................................................................47
Library CPassport: General Functionality .....................................................................................................48
CPassport Library Functions ................................ ...........................................................................................48
1.1.55. Init .............................................................................................................................................48
1.1.56. Process ................................ ......................................................................................................49
1.1.57. GetFace .....................................................................................................................................49
CPassport Library Properties................................ ...........................................................................................50
Appendix A – VB Demo Program ................................ .................................................................................51
1.1.58. Using the license key in the program ..................................................................................51
1.1.59. Applying the license key to the code...................................................................................51
Appendix B – SDK installation and Registration ........................................................................................52
1.1.60. Installing the SDK package ...................................................................................................52
1.1.61. Obtaining the full SDK package ..........................................................................................53
1.1.62. Library SlibEx constants .......................................................................................................54
1.1.63. Library idData constants ........................................................................................................56
1.1.64. Library CImage constants .....................................................................................................61
1.1.65. Library COcr constants ..........................................................................................................61
1.1.66. License related constants .......................................................................................................62
1.1.67. Library CBarCode constants................................ .................................................................62
1.1.68. Library MagLib constants .....................................................................................................64
Appendix D – Debugging Flags ................................ ......................................................................................65
Appendix E – Errata Information ...................................................................................................................65
Appendix F – Supported States for Detection ..............................................................................................66
Card Scanning Solutions 3
Page 4
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
Introduction
ScanW.Dll library is a wrap per COM object that eases the integration between VC++ source libraries and VB code. The library includes four sub libraries:
SlibEx – Controls the scanner activity and contains the last scanned image in an internal memory. This library controls the scann ing settings such as scan size, color scheme and resolution. The scanned image is loaded to an internal memory and can be saved to an external file in a bitmap format. Ocr (In OCR version only) – Extract the textual data from the internal image. IdData (In the ID version only) – Parse and refine the textual data extracted by the OCR. The data is kept in internal variables ready to be exported to the application. Cimage – Use for internal image manipulation such as rotation, color scheme modification, dpi modification and image export to a file in various formats. This library can also be used for external image files manipulation.
Each sub library can function as individual library regardless to the other libraries.
SLib.dll
Internal image
buffer
ImageCtrl.dll
User
Application
IdCard.dll
SOcr.dll
BarCode.dll
SDK
Figure1 : ScanW library internal architecture
Card Scanning Solutions 4
Page 5
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
Card Scanning Solutions 5
Page 6
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
Retrieving information from ID cards
Retrieving the data from an id card involves 4 steps:
Loading the internal image. Scanning the ID card in True color and 300 dpi, 2.2 x 3.6 inch does this. Processing the internal image – use ProcState to activate the OCR on the scanner’s internal image. Retrieve the data – use RefreshData function to retrieve the detected data Export the internal image to a file in the proper dpi and color scheme.
IMPORTANT: The internal image is overwritten in every new scan. It is the application responsibility to make sure that the scan is performed in the proper setting (True color, 300 dpi, 2.2 x 3.6 inch). Failing to do so may result with bad data retrieval.
Card Scanning Solutions 6
Page 7
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Name
Type
Functionality
InitLibrary
Function
Activate and enables the library functionality
CalibrateScanner
Function
Calibrate the scanner color sensor
ScanToFile
Function
Scan document to a bitmap file
IsScannerValid
Property
Verify the scanner functionality
LastErrorStatus
Property
Retrieve the last operation error status
Resolution
Property
Set/Retrieve the scanning
resolution
ScannerColorScheme
Property
Set/retrieve the scanner to color/gray/bw color scheme
ScanWidth
Property
Set/retrieve the image width
Name
Type
Functionality
ProcState
Funct
ion Initialize the image process and data extraction from the id image file
RefreshDate
Function
Update the data collected by ProcState to the internal variables
Name
Property
Address
Property
City Property
State
Property
Zip Property
DateOfBir
th Property
ExpirationDate
Property
IssueDate
Property
ID Property
License
Property
Class
Property
Eyes Property
Hair Property
Height
Property
Sex Property
Duplicate/Exam
Property
County
Property
Res
triction
Property
Endorsements
Property
SigNum
Property
Original Date
Property
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
Functions and properties summery
Library: SlibEx
IsNeedCalibration Property Check if the scanner nee ds to be calibrated
PaperInTray Property Check is a document is in the scanner tray
ScanHeight Property Set/retrieve the image height
Library: Idata
Weight Property
CSC Property
Type Property
Card Scanning Solutions 7
Page 8
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Name
Type
Functionality
Conatenatelmage
Function
Concatenate two images into a single image file
Convertlmage
Function
Convert ima
ge format (internal or external image)
Rotateimage
Function
Rotate image clock
-
wise in 90,180and 270 degrees
ReformatImage
Function
Modify the image dpi, color scheme and save scheme
Name
Type Functionality
ExtractText
Function
Extract text bulks from an image file.
mText
Property
A buffer that contains the extracted text data
Library: CImage
Library: COcr
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
(internal or external image)
(internal or external image)
Licensing
Each library must to be initialized with a license number prior to usage using the Init() function of each library. Failing to initialize the library will block the access to the library functionality. There are two types of licenses:
Temporary License: Using this type of license common for library evaluation. This type of license normally expires after 60 days. A temporary SDK license can be obtained from http://id-
scan.com/developer
Permanent License: Unique key that is used to activate the library with no time limit and also used to identify the customer when calling Card Scanning Solutions for customer support.
The software dealer supplies the permanent license key.
Distribution
To install the SDK files at destination computer you just need to copy all the SDK files that are in the SDK installation folder to the destination computer. There are some files that will need to be register on the destination computer such as COM\ ActiveX objects, install these files at the end of the SDK files installations since it will need the none COM\ActiveX files to exist before register. Here is a list of the files that need to be register: ScanW.dll (Com object) ScanWEx.dll (Com object) ScanX.dll (ActiveX object) mostly used for VB scripts
Note:
If you don’t use the COM interface in your application and use the SDK files directly like in VC++ then you don’t need to install these files on the destination computer.
Card Scanning Solutions 8
Page 9
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
Card Scanning Solutions 9
Page 10
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
InitLibrary
(License
As String) As Long
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
Library Properties and Methods
Library SlibEx: General Functionality
SlibEx library is used to scan documents and load their image to the internal image container. The library also saves the scanned image to an external bitmap file. The library sets and retrieves the scanners properties (such as scanning size, resolution and color scheme). The validity of all operations on properties or functions is reflected on the property LastErrorStatus. This property automatically reset upon reading.
Important: Some scanner functions may take several seconds to execute (such as Scan or Clean). While executing lengthi ly function one should not try to execute a second scanner function until the previous function has returned. Failing to follow this rule may cause software\hardware exception.
SlibEx Library Functions
1.1. 1. InitLibrary
Format
Parameters
[in] License – Null terminated string that holds license key value.
Return SLIB_ERR_SCANNER_BUSSY: The scanner is still busy executing the previous scanner command. LICENSE_VALID: License is valid and the library is ready to be used. LICENSE_INVALID: The license is invalid. All scanner operations are disabled. LICENSE_EXPIRED: License has expired. All scanner operations are disabled. SLIB_ERR_DRIVER_NOT_FOUND : The scanner driver was not found. To fix this error re-install
the scanner’s driver. All scanner operations are disabled. SLIB_ERR_SCANNER_NOT_FOUND: The scanner is not connected to the PC. To fix this error make sure the scanner is connected and re -starts the. All scanner operations are disabled.
Remarks
Use this function to initialize the scanner library. This function loads the scanner driver and initializes the internal image structure. This function must be called before calling any other function in the library.
IMPORTANT: When the application unload is should call the function UnInit to unload the SDK and release its memory (See the function description as section 1.1.34 on ScanWex.pdf )
Card Scanning Solutions 10
Page 11
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
CalibrateScanner ()
Clean ()
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
1.1. 2. CalibrateScanner
Format
Return value
Void.
Remarks
This function calibrates the scanner using the calibration card. The calibration results are stored in a file inside the windows directory. The operation result can be tested for good completion by reading
LastErrorStatus property. This property may store one of the following values:
SLIB_ERR_SCANNER_BUSSY: The scanner is still busy executing the previous scanner command. LICENSE_INVALID – Library was not initialized with proper license. SLIB_ERR_SCANNER_NOT_FOUND – No attached scanner was found. SLIB_ERR_INVALID_SCANNER – The attached scanner is invalid. SLIB_FALSE – The operation failed (Mostly because no calibration card was found) SLIB_TRUE – Operation succeeded.
1.1. 3. Clean
Format
Return value SLIB_ERR_SCANNER_BUSSY: The scanner is still busy executing the previous scanner command.
Remarks
This function clean th e scanner lens by running the cleaning pad (supplied in the scanner kit) back and fourth. This function applies only to scanner modules ScanShell800/N.
Card Scanning Solutions 11
Page 12
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
ScanToFile
(FileName
As String) As Long
ScanToFileEx
(FileName
As String) As Long
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
1.1. 4. ScanToFile
Format
Parameters
[in] FileName – Null terminated string that holds the full path of the scanned image.
Return
If function succeeds, the return value is SLIB_ERR_NONE If function fails, the return number is may be one of the following:
SLIB_ERR_SCANNER_BUSSY: The scanner is still busy executing the previous scanner command. LICENSE_INVALID – Library was not initialized with proper license. SLIB_ERR_SCANNER_NOT_FOUND – No attached scanner was found.
SLIB_ERR_SCANNER_GENERAL_FAIL SLIB_ERR_SCANNER_NOT_FOUND SLIB_ERR_HARDWARE_ERROR SLIB_ERR_PAPER_FED_ERROR SLIB_ERR_SCANABORT SLIB_ERR_NO_PAPER SLIB_ERR_PAPER_JAM SLIB_ERR_FILE_IO_ERROR SLIB_ERR_PRINTER_PORT_USED SLIB_ERR_OUT_OF_MEMORY
Remarks
Scan document to the internal image buffer and, in the same time, export it to a bitmap file named “File Name” in the local disk under. The operation result can be tested for good completion by reading
LastErrorStatus property.
Notice that it is important to scan the image in True color and 300 dpi for OCR recognition.
After the scan, the internal image can be further manipulated and exported using separate commands such as:
Rotation – use RotateImage() to rotate the internal image in 90,180 or 270 degrees. Color Scheme – Modify the internal image color to Gray or black and white i mages using
ReformatImage().
Resolution – Modify the internal image resolution to any resolution using ReformatImage(). Saving format – Save the internal image to external file in one of 7 popular file formats using either
ConvertImage() or ReformatImage() or RotateImage()
1.1. 5. ScanToFileEX
Format
Card Scanning Solutions 12
Page 13
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
Parameters
[in] FileName – Null terminated string that holds the full path of the scanned image.
Return
If function succeeds, the return value is SLIB_ERR_NONE If function fails, the return number is may be one of the following:
SLIB_ERR_SCANNER_BUSSY: The scanner is still busy executing the previous scanner command. LICENSE_INVALID – Library was not initialized with proper license. SLIB_ERR_SCANNER_NOT_FOUND – No attached scanner was found.
SLIB_ERR_SCANNER_GENERAL_FAIL SLIB_ERR_SCANNER_NOT_FOUND SLIB_ERR_HARDWARE_ERROR SLIB_ERR_PAPER_FED_ERROR SLIB_ERR_SCANABORT SLIB_ERR_NO_PAPER SLIB_ERR_PAPER_JAM SLIB_ERR_FILE_IO_ERROR SLIB_ERR_PRINTER_PORT_USED SLIB_ERR_OUT_OF_MEMORY
Remarks
This function is the same as ScasnToFile only this function will display a progress bar that will show the scanning progress.
Card Scanning Solutions 13
Page 14
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
SlibEx Library Properties
1.1. 6. IsNeedCalibration
Type
Property.
Direction
Read Only.
Remarks
Retrieve if the scanner needs to be calibrated. This should be tested before every scan. Non-calibrated scanner may generate images with incorrect colors. The property returns a non zero value if the scanner needs to be calibrated and a zero value if the scanner does not need to be calibrated.
1.1. 7. IsScannerValid
Type
Property.
Direction
Read Only.
Remarks
Detect if the scanner version is supported by current code. This property is 0 if scanner is not supported and non-zero if it is supported.
1.1. 8. LastErrorStatus
Type
Property.
Direction
Read Only.
Remarks
Retrieve the preceding property/command setup. This property is equal ELIB_ERR_NONE is no error happened in the previous command execution. This property clears itself automatically to ELIB_ERR_NONE after read.
Card Scanning Solutions 14
Page 15
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
BOTTOM_BUTTON
MIDDLE_BUTTON
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
1.1. 9. PaperInTray
Type
Property.
Direction
Read only.
Remarks
Detects is a document exists in the scanner tray. This property is equal 0 if no paper detected in tray or non-zero if paper is in tray.
1.1. 10. PressedButton
Type
Property.
Direction
Read only.
Remarks
Returns the button number that was pressed (valid for only when using ScanShell1000 scanner model). Read this value after reading the property PaperInTray (that indicate that one of the three buttons of the scanner was pressed) to retrieve which button was pressed. The return value can be one of the following: TOP_BUTTON MIDDLE_BUTTON BUTTOM_ BUTTON
These values corresponds to the buttons shown in the following figure.
TOP_BUTTON
Card Scanning Solutions 15
Page 16
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
1.1. 11. Resolution
Type
Property.
Direction
Read / Write.
Remarks
Set/retrieve the scanner resolution settings. Resolution value can be any integer in the range 50-600 (for 50-600 dpi). Trying to set value outside this will be rejected and the previous value will be used.
This property set the scanned image resolution. The internal image resolution can be modified after the scan using ReformatImage() function.
1.1. 12. ScanHeight
Type
Property.
Direction
Read / Write.
Remarks
Set/retrieve the scan height (in 1/100 inch units). Available range 200-400.
Auto-detect scan size: When using scanner model ScanShell800xx\2000xx\3000xx the scanner may also scan a document with un-known size. In this mode the scanner scan the document until it “sense” that the entire document has be fed into the scanner. Than, the black borders of the image is automatically cropped and the result image is returned to the calling application. To trigger this feature you must set the both properties ScanHeight and ScanWidth to –1. When the scan completes these properties will reflect the detected document size in milli- inches. Note: If you intend to use Auto-detect scan size make sure to set ScanHeight and ScanWidth with –1 before each scan as after the scan these properties are overwritten automatically with the recently scanned document size.
1.1. 13. ScannerColorScheme
Type
Property.
Direction
Read / Write.
Remarks
Set/retrieve the scanner color scheme. Available values are:
Card Scanning Solutions 16
Page 17
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
BW GRAY TRUECOLOR
This property set the scanned image color scheme. The internal image color scheme can be modified after the scan using ReformatImage() function.
1.1. 14. ScanWidth
Type
Property.
Direction
Read / Write.
Remarks
Set/retrieve the scan width (in 1/100 inch units). Available range 200-600.
Auto-detect scan size: When using scanner model ScanShell800xx\2000xx\3000xx the scanner may also scan a document with un-known size. In this mode the scanner scan the document until it “sense” that the entire document has be fed into the scanner. Than, the black borders of the image is automatically cropped and the result image is returned to the calling application. To trigger this feature you must set the both properties ScanHeight and ScanWidth to –1. When the scan completes these properties will reflect the detected document size in milli- inches. Note: If you intend to use Auto-detect scan size make sure to set ScanHeight and ScanWidth with –1 before each scan as after the scan these properties are overwritten automatically with the recently scanned document size.
1.1. 15. ScannerType
Type
Property.
Direction
Read only.
Remarks
Retrieve the scanner type. Scanner type can be one of these values: 0: No scanner 1: ScanShell 600 2: ScanShell 800 3: ScanShell 800N 4: ScanShell 1000 5: ScanShell 2000 6: ScanShell 2000N 7: ScanShell 800E 8: ScanShell 800EN 9: ScanShell 3000
Card Scanning Solutions 17
Page 18
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
10: ScanShell 4000 11: ScanShell 800G 12: ScanShell 5000 13: SnapShell (IDR) 14: ScanShell 800DX 15: ScanShell 800DXN 16: SnapShell (FDA) 17: SnapShell (WMD) 18: SnapShell (TWN)
1.1. 16. Version
Type
Property.
Direction
Read Only.
Remarks
Retrieve the SlibEx version.
Card Scanning Solutions 18
Page 19
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
AutoDetectState (
Reserved
As String) As Long
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
Library IdData: General Functionality
IdData library is where most of the image processing and data extraction is being handled. The library fetches the internal image (the last scanned image), process its graphic information and activates the OCR. The resultant text is kept in internal data structure ready to be retrieved by the application.
Notice: The library processes only the last image that was recently scanned. The library does not support external image file processing.
idData Library Functions
1.1. 17. AutoDetectState
Format
Parameters
[in] Reserved – Null terminated empty string - reserved. This parameter is not used.
Return LICENSE_INVALID: The license is invalid. All scanner operations are disabled. ID_ERR_USA_TEMPLATES_NOT_FOUND: The template database file for the USA states
(UsaIds.bin) is missing. The file should be located in the SDK files location. INVALID_INTERNAL_IMAGE – No internal image is loaded. This value return when attempting to use this function without scanning an image first.
ID_ERR_STATE_NOT_SUPORTED : The license image doe not match any state template. ID_ERR_STATE_NOT_RECOGNIZED : The license image doe not match any state template.
If non of the above error values is returned, the function return the state id value.
Remarks Use this function to automatically detect the state type according to the image. If the function returns with non of the above error values then the return value is the state id. This value can be assigned to the input parameter IdState in the function ProcState for data extraction.
Card Scanning Solutions 19
Page 20
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
AutoDetectStateEx (
Re
served
As String,
angle
As Long) As Long
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
1.1. 18. AutoDetectStateEx
Format
Parameters
[in] Reserved – Null terminated empty string - reserved. This parameter is not used. [out] angle – Return the amount of clockwise 90 degrees turns that the image was rotated to be aligned horizontally.
Return LICENSE_INVALID: The license is invalid. All scanner operations are disabled. ID_ERR_USA_TEMPLATES_NOT_FOUND: The template database file for the USA states
(UsaIds.bin) is missing. The file should be located in the SDK files location. INVALID_INTERNAL_IMAGE – No internal image is loaded. This value return when attempting to use this function without scanning an image first.
ID_ERR_STATE_NOT_SUPORTED : The license image doe not match any state template. ID_ERR_STATE_NOT_RECOGNIZED : The license image doe not match any state template.
If non of the above error values is returned, the function return the state id value.
Remarks Use this function to automatically align the internal image horizontally and then to detect the. If the function returns with non of the above error values then the return value is the state id. This value can be assigned to the input parameter IdState in the function ProcState for data extraction. The function loads in the parameter angle one of the following values: ANGLE_0: The image was received in the proper alignment. ANGLE_90: The image was rotated once in 90 degrees (clockwise). ANGLE_180: The image was rotated twice in 90 degrees (clockwise). ANGLE_270: The image was rotated three times in 90 degrees (clockwise). You can dump the rotated image from the internal buffer to a file using the function RotateImage
Card Scanning Solutions 20
Page 21
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
InitLibrary
(
License
As String) As Long
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
1.1. 19. InitLibrary
Format
Parameters
[in] License – Null terminated string that holds license key value.
Return
LICENSE_VALID: License is valid and the library is ready to be used. LICENSE_INVALID: The license is invalid. All scanner operations are disabled.
LICENSE_EXPIRED: License has expired. All scanner operations are disabled. LICENSE_DOES_NOT_MATCH_LIBRARY: The license is invalid for this library. All library
operations are disabled. GENERAL_ERR_PLUG_NOT_FOUND: This error returns if the attached scanner is not one of the following scanners: ScanShell 600 ScanShell 800 ScanShell 1000 SLIB_LIBRARY_ALREADY_INITIALIZED : The InitLibrary function call is ignored since the library is already loaded.
Remarks Use this function to initialize the idData library. This function must be called before calling any other function in the library.
1.1. 20. ProcState
Format
ProcState (Reserved As String, idState As Long) As Long
Parameters
[in] Reserved – Null terminated empty string - reserved. This parameter is not used. [in] idState – Constant numeric value of the processed state id.
Return
If function succeeds, the return value is ID_TRUE. If function fails, the return value is one of the following:
LICENSE_INVALID – Library was not initialized with proper license. SLIB_ERR_SCANNER_NOT_FOUND – No attached scanner was found. LICENSE_INVALID – The library was not initialized with the proper license. SLIB_ERR_INVALID_SCANNER – No scanner was found attached to the PC.
Card Scanning Solutions 21
Page 22
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
ID_ERR_STATE_NOT_SUPORTED – The requested state id is not supported. INVALID_INTERNAL_IMAGE – No internal image is loaded. This value return when attempting to
use this function without scanning an image first.
Remarks
Use this function to process the internal image acquired in the last scan. The function de skew and cleans the image and then pass to the ocr for analysis. The resultant textual data is kept in internal structure ready for retrieval by RefreashData() function. Processing the image does not modify the image content.
Successful image processing depends on the following: The image must be scanned in 24 bit (true color) and 300 dpi. The image must be aligned horizontally with tolerance of no more than ± 10 degrees.
1.1. 21. GetFaceImage
Format
GetFaceImage (SourceFileName As String, DestFileName As String, stateId As Integer) As Long
Parameters
[in] SourceFileName – Null terminated string that holds the full path of the scanned id image. If this string is empty the internal image is used as image source.
[in] DestFileName – Null terminated string that holds the full name of the destination image file that will contain the face image from the id document. [in] stateId – The state index value as defined in idLibDef.bas file.
Return
If function succeeds, the return value is ID_TRUE
If the function fails one of the following values is returned:
LICENSE_INVALID – Library was not initialized with proper license. ID_ERR_FILE_OPEN – Failing to load source image (if SourceFileName is not empty) INVALID_INTERNAL_IMAGE – No internal image is loaded. This value return when attempting to
use the internal image without scanning an image first.
ID_ERR_STATE_NOT_SUPORTED – The requested state is not supported. ID_BAD_DESTINATION_FILE – Bad destination path (could not create destination file). ID_ERR_FILE_OPEN – Bad source image file (used only when using a file as the source image).
This value return if the source file is missing or cannot be accessed for reading. INVALID_INTERNAL_IMAGE– Bad internal image (used only when extracting the face image from the image stored in the internal buffer). This value returned if there is no image in the buffer.
ID_FALSE– Internal processing error. ID_ERR_FACE_IMAGE_NOT_FOUND– Returned when the analyzer cannot detect the face image
in the driver’s license image. ID_ERR_CANNOT_DELETE_DESTINATION_IMAGE– Returned when a file with the same name as the destination file already exist and cannot be overwritten. ID_ERR_CANNOT_COPY_TO_DESTONATION– Returned when the destination file cannot be opened for write on the disk.
Card Scanning Solutions 22
Page 23
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
GetFirstCountr
y( ) As Long
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
Remarks
Use this function to extract the image rectangle of the person’s face from the source id image. The source image can be one of two: Internal image : The last scanned image (stored in the internal memory). This image will be used only
if the SourceFileName string is empty External image file: The full file name is given in SourceFileName parameter. If an external file is used as the source image it must be a 24 bit image (true color) and have a resolution of 300dpi. The source and file destination can be one of the following formats: BMP, TIFF, JPG, PCX, TGA, PNG, PSD. To set the image format use the proper file extension (xxx.bmp for bitmap, xxx.jpg for Jpeg, etc.)
1.1. 22. GetFirstCountry
Format
Return value
The constant value of the first country in the countries list.
Remarks
Use this function to get the first country in the countries list. Combining this function with the function GetNextCountry allow you to obtain the constant values of all supported countries. The countries constant values in the Region ARE NOT always consecutive and should be obtained using the function GetNextCountry.
1.1. 23. GetFirstStateByCountry
Format
GetFirstStateByCountry (country As Integer) As Long
Parameters
[in] country – Constant value of the country
Return ID_ERR_NO_MATCH : Bad country constant. Otherwise, the function return the constant value of the first state in the country.
Remarks
Use this function to retrieve the first state constant in the country.
Card Scanning Solutions 23
Page 24
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
GetNextCountry( ) As Long
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
The states constant values in the country ARE NOT always consecutive And should be obtained using the function GetNextStateByCountry.
1.1. 24. GetNextCountry
Format
Return value ID_ERR_COUNTRY_NOT_INIT : Returned if GetFirstCntry function was not called before.. ID_ERR_NO_MATCH: Returned if list has internal error. ID_ERR_NO_NEXT_COUNTRY – Returned if this country is the last country in the list.
Return the next country constant.
Remarks
Use this function to obtain the next country in the country list. To obtain the countries list call GetFirstCountry once to obtain the first country. Then countiuousely call GetNextCountry until the value ID_ERR_NO_NEXT_COUNTRY
is returned.
1.1. 25. GetNextStateByCountry
Format
GetNextStateByCountry (country As Integer) As Long
Parameters
[in] country – Constant value of the country
Return value ID_ERR_NO_MATCH : Bad country constant. ID_ERR_COUNTRY_NOT_INIT : Returned if GetFirstCountry function was not called before.. ID_ERR_NO_NEXT_STATE – Returned if this state is the last state of the country state list .
Return the next state constant.
Remarks
Use this function to obtain the next state in the list.
Card Scanning Solutions 24
Page 25
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
1.1. 26. GetSignImage
Format
GetSignImage (SourceFileName As String, DestFileName As String, stateId As Integer) As Long
Parameters
[in] SourceFileName – Null terminated string that holds the full path of the scanned id image. If this string is empty the internal image is used as image source.
[in] DestFileName – Null terminated string that holds the full name of the destination image file that will contain the signature image from the id document. [in] stateId – The state index value as defined in idLibDef.bas file.
Return
If function succeeds, the return value is ID_TRUE
If the function fails one of the following values is returned:
LICENSE_INVALID – Library was not initialized with proper license. ID_ERR_FILE_OPEN – Failing to load source image (if SourceFileName is not empty)
INVALID_INTERNAL_IMAGE – No internal image is loaded. This value return when attempting to
use the internal image without scanning an image first.
ID_ERR_STATE_NOT_SUPORTED – The requested state is not supported. ID_BAD_DESTINATION_FILE – Bad destination path (could not create destination file). ID_ERR_FILE_OPEN – Bad source image file (used only when using a file as the source image).
This value return if the source file is missing or cannot be accessed for reading. INVALID_INTERNAL_IMAGE– Bad internal image (used only when extracting the signature image from the image stored in the internal buffer). This value returned if there is no image in the buffer.
ID_FALSE– Internal processing error. ID_ERR_FACE_IMAGE_NOT_FOUND– Returned when the analyzer cannot detect the face image
in the driver’s license image. ID_ERR_CANNOT_DELETE_DESTINATION_IMAGE– Returned when a file with the same name as the destination file already exist and cannot be overwritten. ID_ERR_CANNOT_COPY_TO_DESTONATION– Returned when the destination file cannot be opened for write on the disk.
Remarks
Use this function to extract the image rectangle of the person’s signature from the source id image. Signature extraction is relatively new feature and is not implemented yet for all the state templates (For supported states see Appendix F). The source image can be one of two: Internal image : The last scanned image (stored in the internal memory). This image will be used only if the SourceFileName string is empty
External image file: The full file name is given in SourceFileName parameter. If an external file is used as the source image it must be a 24 bit image (true color) and have a resolution of 300dpi. The source and file destination can be one of the following formats: BMP, TIFF, JPG, PCX, TGA, PNG, PSD. To set the image format use the proper file extension (xxx.bmp for bitmap, xxx.jpg for Jpeg, etc.)
Card Scanning Solutions 25
Page 26
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Refresh
Data () As Long
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
1.1. 27. RefreshData
Format
Return Value
If the function returns non-zero value, the data was retrieved successfully. If the function returns zero value, the data was retrieved un-successfully.
Remarks
This function is used to load library properties with the recently detected data. This function should normally be called after the execution of ProcState function.
1.1. 28. RefreshDataAu
Type
Function.
Format
RefreshDataAu () As Long
Return Value
If the function returns non-zero value, the data was retrieved successfully. If the function returns zero value, the data was retrieved un-successfully.
Remarks
This function is identical to RefreashData() function.
1.1. 29. State2Id
Format
State2Id (StateName As String) As Long
Parameters
[in] StateName – A string that holds the state name.
Return Value
The state ID if the StateName is recognizable state name.
ID_ERR_NO_MATCH – if the string contain unrecognizable state name.
Remarks
This helper function is used to convert a state name (string) to its equivalent id value. For example, passing StateName loaded with the string “California” will return the value 4. The function converts the string to the id even if the state is not supported by the library.
Card Scanning Solutions 26
Page 27
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
See also: Id2State(), LastStateIndex
1.1. 30. Id2Country
Format
Id2Country ( countryId As Integer, CountryName As String) As Long
Parameters
[in] countryId – An integer that holds the country id value. [out] coutryName A string that will be loaded by the function with the country name.
Return Value ID_TRUE: The function succeeded. ID_ERR_NO_MATCH – No country with such id was found.
Remarks
This helper function is used to convert a country id to the country name (string).
1.1. 31. Id2State
Format
Id2State ( stateId As Integer, StateName As String) As Long
Parameters
[in] stateId – An integer that holds the state id value. [out] StateName A string that will be loaded by the function with the state name.
Return Value ID_TRUE: The function succeeded. ID_ERR_NO_MATCH – No state with such id was found.
Remarks
This helper function is used to convert a state id to the state name (string). For example, passing
stateId loaded with the value 4 loads the string StateName with the string “California”. The
function converts the string to the id even if the state is not supported by the library.
See also: State2Id(), LastStateIndex
Card Scanning Solutions 27
Page 28
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
1.1. 32. StateIsSupported
Format
StateIsSupported (stateId As Integer) As Long
Return Value LICENSE_INVALID – Library was not initialized with proper license. ID_TRUE: The state is supported and can be detected by the library. ID_ERR_STATE_NOT_SUPORTED – the library does not support the state.
Remarks
This function is used to inform the application is the id image of a given state can be processed. Use this function to detect what states the library currently supports.
1.1. 33. GetDetectAcuracy
Format
GetDetectAcuracy () As Long
Return Value
The function returns a number in the range 0-100 that estimates the detection accuracy percentage.
Remarks
This helper function checks the detected data values and returns a value that indicates the detection accuracy (in percents). This function, combined with RotateImage() function is useful when implementing auto-orientation feature in the application. This feature can be implemented by rotating the internal image and for each new position executing ProcState() function. The operation success can be evaluated using GetDetetAcuracy() which allow us to determine if the image is in the right orientation or a new rotation-detection-inspection is needed.
1.1. 34. CountySupportAutoDetect
Format
CountySupportAutoDetect (countryId As Integer) As Long
Parameters
[in] countryId – countryId – Constant value of the country.
Return Value
ID_TRUE: The country support state auto detection. ID_FALSE: The country does not support state auto detection.
Card Scanning Solutions 28
Page 29
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Name (as shown on card)
NameFirst
NameMiddle
NameLast
NameSuffix
ID
License
IssueDat
e License
Address
ExperationDate
CSC City Eyes Dup_Test
State
Hair Endorsements
Zip Height
Fee County
Class
Restriction
Type
Weight
Address2
Address3
Address4
Address5
Side
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
Remarks
The state auto-detection feature is not implemented on all the supported countries. Use this function to determine which countries can use the AutoDetectState function.
idData Library Properties
idData library store the detected textual information in an internal data structure. This structure is refreshed in each RefreshData() function call. Some of the properties are relevant to some states and some are irrelevant. For example, the property Weight is relevant to id cards of states such as Arizona, California and Georgia but it does not exist in states such as Arkansas or Michigan. If a property is irrelevant to a particular state, or if the field is not detected, it clears to an empty string. Loading the properties is done using a simp le string assignment. The Name field is parsed and generates four additional fields (First name, Middle name, last name and name suffix).
The supported properties are:
DateOfBirth Sex SigNum
Text1 Text2 Text3
An additional property is L astStateIndex. It is useful when iterating in a loop between the entire states id from the first (index 0) to the last one.
Card Scanning Solutions 29
Page 30
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
InitLibrary
(
License
As String) As Long
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
Library CBarCode: General Functionality
CBarCode library functionality is similar to idData library. It extract the data from 2D, PDF417 type bar code image. The library fetches the internal image (the last scanned image), process its graphic information and activates its internal image analyzer. The resultant text is kept in internal data structure ready to be retrieved by the application.
Notice: The library processes only the last image that was recently scanned. The library does not support external image file processing.
NOTE: The image MUST be scanned in 600dpi, gray scale (256 shades of gray) format.
CBarCode Library Functions
1.1. 35. InitLibrary
Format
Parameters
[in] License – Null terminated string that holds license key value.
Return
LICENSE_VALID: License is valid and the library is ready to be used. LICENSE_INVALID: The license is invalid. All scanner operations are disabled.
LICENSE_EXPIRED: License has expired. All scanner operations are disabled. LICENSE_DOES_NOT_MATCH_LIBRARY: The license is invalid for this library. All library
operations are disabled. GENERAL_ERR_PLUG_NOT_FOUND: This error returns if the attached scanner is not one of the following scanners: ScanShell 600 ScanShell 800 ScanShell 1000 SLIB_LIBRARY_ALREADY_INITIALIZED : The InitLibrary function call is ignored since the library is already loaded.
Remarks Use this function to initialize the CBarCode library. This function must be called before calling any other function in the library.
Card Scanning Solutions 30
Page 31
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
RefreshData () As Long
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
1.1. 36. ProcImage
Format
ProcImage (Reserved As String) As Long
Parameters
[in] Reserved – Null terminated empty string - reserved. This parameter is not used.
Return
If function succeeds, the return value is BC_ERR_NONE. If function fails, the return value is one of the following:
LICENSE_INVALID – Library was not initialized with proper license. SLIB_ERR_SCANNER_NOT_FOUND – No attached scanner was found. LICENSE_INVALID – The library was not initialized with the proper license. SLIB_ERR_INVALID_SCANNER – No scanner was found attached to the PC. ID_ERR_STATE_NOT_SUPORTED – The requested state id is not supported. INVALID_INTERNAL_IMAGE – No internal image is loaded. This value return when attemp ting to
use this function without scanning an image first.
BC_ERR_NO_BC_FOUND – No barcode pattern (PDF417) was found on the image.
Remarks
Use this function to process the internal image acquired in the last scan. The function de skew and cleans the image and then pass to the image analyzer for data extraction. The resultant textual data is kept in internal structure ready for retrieval by RefreashData() function. Processing the image does not modify the image content.
Successful image processing depends on the following: The image must be scanned in 600 dpi – Gray scale color scheme. The image must be aligned in such way that the bar code image is vertical with tolerance of no more than ±10 degrees.
1.1. 37. RefreshData
Format
Return Value
If the function returns non-zero value, the data was retrieved successfully. If the function returns zero value, the data was retrieved un-successfully.
Remarks
This function is used to load library properties with the recently detected data. This function should normally be called after the execution of ProcImage function.
Card Scanning Solutions 31
Page 32
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
1.1. 38. GetRawField
Format
GetRawField ( Index As Integer, Value As String) As Long
Parameters
[in] Index An Integer that holds the value of the requested field. [out] Value – A string that holds the returned value indicated by Index..
Return
If function succeeds, the return value is BC_ERR_NONE. If function fails, the return value is BC_ERR_BAD_PARAM to indicate that the value passes by Index is not a valid field index.
Remarks
AAMVA National standard defines 51-field type that might be encoded in the PDF417 bar code image. Each one of the fields may be retrieved from the image using the filed index specified in section 1.1.43. If the field is populated its value is retrieved and copied to Value. If the field is empty (or not implemented on the image) the parameter Value is set to be empty string. The maximum field size may be up to 60 characters long. Its important to understand that the fields are populated differently in different states. For example, The field NAME is populated in field index BCF_NAME for Alabama driver license, and the same field is populated in field index BCF_DRIVER_LAST_NAME for Delaware driver license. The raw field range from BCF_NAME (0) to BCF_AKA_PREFIX (50)
In addition to the raw fields, the CBarCode offers an additional set of fields (range from BCF_EMUL_FULL_NAME to BCF_EMUL_SSN). These fields are generated after the raw fields are loaded. The fields uniform the data extraction by copying the data from the raw fields and diverting it while considering its originated state type. This removes the developer the burden of knowing the state type and the way the data is handled in this particular state.
1.1. 39. GetRawData
Format
GetRawData (Buffer As String)
Parameters
[out] Buffer A string that holds the returned value..
Return
No return value.
Remarks
This function returns the extracted text data in one bulk as detected by the bar code analyzer. The data is returned, “as is” with no parsing or additional processing. This function is useful for retrieving data from general purpose bar code images.
Card Scanning Solutions 32
Page 33
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Name (as shown on card)
Nam
eFirst
NameMiddle
NameLast
NameSuffix
DateOfBirth
License
IssueDate
ExperationDate
Address
City State
Zip SSN
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
CBarCode Library Properties
CBarCode library store the detected textual information in an internal data structure. This structure is refreshed in each RefreshData() function call. All the properties are copied from the relevant raw fields and can be retrieved directly by using GetRawFiled function while passing the proper BFC_EMUL_XXX index. ame, last name and name suffix).
The supported properties are:
Card Scanning Solutions 33
Page 34
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
InitLibrary
(
License
As String) As Long
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
Library CImage: Properties and Functions
CImage library is a collection of graphic functions, capable of manipulating an image object. The image object may be loaded from external file or the image object stored in ScanLib library (which is the image of the last scanned document). The library functions are capable of doing the following: Image rotation: Rotating an image in 90, 180 or 270 degrees. Resolution modification: Modify the resolution to any value. Image color conversion: Converting the image to 24 bit (true color), 256 colors (gray or color) or Black and White (1 bit). Concatenate two image files to a single image: Attach two images (horizontally or vertically) to form a single image file of both id card sides.
The image can be exported (saved) to external image file in any one of seven popular image formats such as BMP, JPG, TIFF, PCX, PNG, TGA and PSD. Alternatively, the image object can be exported to the clipboard and from there be imported to other applications.
1.1. 40. InitLibrary
Format
Parameters
[in] License – Null terminated string that holds license key value.
Return
LICENSE_VALID: License is valid and the library is ready to be used. LICENSE_INVALID: The license is invalid. All scanner operations are disabled.
LICENSE_EXPIRED: License has expired. All scanner operations are disabled. LICENSE_DOES_NOT_MATCH_LIBRARY: The license is invalid for this library. All l ibrary
operations are disabled.
Remarks Use this function to initialize the CImage library. This function must be called before calling any other function in the library.
1.1. 41. GetImageColor
Format
Card Scanning Solutions 34
Page 35
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
RotateImage ( _
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
GetImageColor (FileName As Integer) As Long
Parameters
[in] FileName – Image file name or empty string if evaluating the internal image.
Return
IMG_ERR_FILE_OPEN: Cannot open input image file. INVALID_INTERNAL_IMAGE: Internal image is invalid and cannot be analyzed. IMAGE_BW – The image has Black and White colors (1 bit image). IMAGE_GRAY_256 - The image has 256 colors of gray (8 bit image). IMAGE_COLOR_256 - The image has 256 colors (8 bit image). IMAGE_COLOR_TRUE - The image has 16 million (24 bit image).
Remarks
Use this function to obtain the image color scheme.
1.1. 42. RotateImage
Format
SourceImage As String, _ Angle As Long, _ DestType As Long, _ DestImage As String _
)
Parameters
[in] SourceImage – Full path name of the original image file. If this string is empty the rotation is performed on the internal image. [in] Angle – The angle to rotate the original image. This value can be one of the following values:
ANGLE_0 : 0 degrees rotation ANGLE_90: 90 degrees rotation ANGLE_180: 180 degrees rotation ANGLE_270: 270 degrees rotation
[in] DestType – The destination of the rotated image. This parameter may be one of two values:
SAVE_TO_FILE : Save the image to a file. The file name should be given in DestImage parameter. SAVE_TO_CLIPBOARD : Copy the rotated image the image to the clipboard.
[in] DestImage – Full path name of the destination file. This parameter is ignored if the parameter
DestType is set to SAVE_TO_CLIPBOARD. If this value is an empty string no save will be
performed.
Return
If function succeeds, the return the value IMG_ERR_SUCCESS. Card Scanning Solutions 35
Page 36
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
If the function fails it returns one of the following values:
LICENSE_INVALID – Library was not initialized with proper license. IMG_ERR_BAD_ANGLE_0 – bad rotation parameter. IMG_ERR_BAD_DESTINATION – Bad destination parameter (the destination parameter is neither
file or clipboard) IMG_ERR_FILE_OPEN – Cannot open input file. This value is returned if the SourceImage st ring is not empty but it points to a missing or invalid source image file. INVALID_INTERNAL_IMAGE – This value is returned if the SourceImage string is empty but no document was scanned so there is no internal image in the memory.
IMG_ERR_FILE_SAVE_TO_CLIPBOARD – Cannot save image to clipboard due to an error. IMG_ERR_FILE_SAVE_TO_FILE – Cannot save destination file due to invalid destination file or
disk save error.
Remarks
Use this function to rotate an image in 0, 90, 180 or 270 degrees and save it to a file in any one of seven formats. The manipulated image may be loaded from an external file (if SourceImage string
holds a string value equal to the source image file name) or performed on the internal image buffer (if
SourceImage string is empty). When using a file as the image source, it is important to use the
proper file extension to indicate the image format. Proper extension types are: BMP, JPG, TIFF, PCX, PNG, TGA and PSD. If an image has unrecognizable extension due to an error (e.g. TIFF instead of TIF) the function refers to the file as BITMAP. After the image is rotated it can be exported to either the clipboard or to external image file. The destination file name may be one of the seven file formats indicated above. If an image has unrecognizable extension due to an error (e.g. TIFF instead of TIF) the function exports to the file in a BITMAP format. The destination file name may be the same as the source file name. In such case the new file, resulting with a rotated image, will overwrite the original file. If no destination image file name is given (empty string) no save is done.
Do not be misled by the name of this function. This function flexibility actually allows implicitly to do the following:
Use the following function call to convert an image file from one type to another: RotateImage (“xxx.bmp”, ANGLE_0, SAVE_TO_FILE, “xxx.jpg”)
Use the following function call to copy an image file to the clipboard: RotateImage (“xxx.bmp”, ANGLE_0, SAVE_TO_CLIPBOARD, “”)
Use the following function call to rotate the internal image : RotateImage (“”, ANGLE_0, SAVE_TO_FILE, “”)
Use the following function call to save the internal image to a file: RotateImage (“”, ANGLE_0, SAVE_TO_FILE, “xxx.bmp”)
1.1. 43. ConvertImage
Format
ConvertImage ( _ SourceImage As String, _ DestImage As String _ )
Card Scanning Solutions 36
Page 37
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Destination image type
Destination i
mage extension
True color
256 colors
Gray scale
Black and
BMP
v v v v
TIF v v v
JPG v v PCX v v v
TGA v v v
PNG v v v
PSD v
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
Parameters
[in] Source Imag e – Full path name of the original image file. If this string is empty the rotation is performed on the internal image. [in] DestImage – Full path name of the destination file.
Return
If function succeeds, the return the value IMG_ERR_SUCCESS. If the function fails it returns one of the following values:
LICENSE_INVALID – Library was not initialized with proper license. IMG_ERR_BAD_DESTINATION – Bad destination parameter (the destination parameter is neither
file or clipboard) IMG_ERR_FILE_OPEN – Cannot open input file. This value is returned if the SourceImage string is not empty but it points to a missing or invalid source image file. INVALID_INTERNAL_IMAGE – This value is returned if the SourceImage string is empty but no document was scanned so there is no internal image in the memory. IMG_ERR_FILE_SAVE_TO_FILE – Cannot save destination file due to invalid destination file or disk save error.
Remarks
This function is a shorter version of the function RotateImage(). It takes and input file (if
SourceImage is not empty) or use the internal image as a source (if SourceImage is empty) and
save it to a file. Using different file extension for the source and the destination converts the image type to the desired type. Image type conversion must be done carefully since some color schemes are not supported in all file types. The following table shows the available destination types and the color scheme they as capable of storing:
(24 bit)
(8 bit)
(8 bit)
white (1 bit)
Important: This table is applicable to all the functions in this library.
Card Scanning Solutions 37
Page 38
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
ReformatImage ( _
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
1.1. 44. ReformatImage
Format
SourceImage As String, _ toColor As Integer, _ toDpi As Integer, _ DestImage As String _
)
Parameters
[in] SourceImage – Full path name of the original image file. If this string is empty the rotation is performed on the internal image.
[in] toColor – One of five values:
LICENSE_INVALID – Library was not initialized with proper license. IMAGE_SAME_COLOR – no modification in the image color scheme IMAGE_BW – Convert to black and white color scheme. IMAGE_GRAY_256 – convert to 256 gray scale color scheme. IMAGE_COLOR_256 – convert to 256-color scheme. IMAGE_CO LOR_TRUE – convert to true color scheme.
[in] toDpi – Set the new Image DPI. A value of 0 indicate no DPI modification.
[in] DestImage – Full path name of the destination file. Is this value is an empty string no save will be performed.
Return
If function succeeds, the return the value IMG_ERR_SUCCESS. If the function fails it returns one of the following values:
IMG_ERR_BAD_COLOR – Bad toColor parameter value. IMG_ERR_BAD_DPI – Bad toDpi parameter value. IMG_ERR_FILE_OPEN – Cannot open input file. T his value is returned if the SourceImage
string is not empty but it points to a missing or invalid source image file. INVALID_INTERNAL_IMAGE – This value is returned if the SourceImage string is empty but no document was scanned so there is no internal image in the memory.
IMG_ERR_FILE_SAVE_TO_FILE – Cannot save destination file. IMG_ERR_FILE_SAVE_TO_FILE – Cannot save destination file due to invalid destination file or
disk save error.
Remarks
Use this function to modify the image color scheme and resolution and save it to a file in any one of seven formats. The manipulated image may be loaded from an external file (if SourceImage string holds a string value equal to the source image file name) or performed on the internal image buffer (if
SourceImage string is empty). When using a file as the image source, it is important to use the
proper file extension to indicate the image format. Proper extension types are: BMP, JPG, TIFF, PCX, PNG, TGA and PSD. If an image has unrecognizable extension due to an error (e.g. TIFF instead of TIF) the function refers to the file as BITMAP.
Card Scanning Solutions 38
Page 39
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
Image reformat can be done either on the image color scheme or the image dpi or both. Notice that changing the image format may lose the image color information (e.g., when converting from 24 bit true color to 256 gray scale). Modifying and image format from 256 gray scales to 24 bit true color will (obviously) not add color to the image but it will save the image with the proper RGB format (no color map) instead of or using 256 gray scale palette. After the image is reformatted it can be exported to external image file. The destination file name may be one of the seven file formats indicated above. If the destination file name has unrecognizable extension the function exports to the file in a BITMAP format (the default format). If no destination image file name is given (empty string) no save is done.
Important: The 256 colors scheme is NOT supported for JPG and TIF files.
1.1. 45. ConcatenateImage
Type
Function.
Format
ConatenateImage( _ SourceImage0 As String, _ Angle0 As Long, _ SourceImage1 As String, _ Angle1 As Long, _ CombType As Long, _ DestType As Long, _ DestImage As String _ )
Parameters
[in] SourceImage0 – Full path name of the first image. [in] Angle0 – The angle to rotate SourceImage0 before the combination. [in] SourceImage1 – Full path name of the second image. [in] Angle1 – The angle to rotate SourceImage0 before the combination. [in] CombType – The location of the images in the result image file:
IMAGE_COMB_HORIZONTAL – SourceImage0 is located to the left of SourceImage1 IMAGE_COMB_VERTICAL - SourceImage0 is located above SourceImage1.
[in] DestType – The destination of the rotated image. This parameter may be one of two values:
SAVE_TO_FILE : Save the image to a file. The file name should be given in DestImage parameter. SAVE_TO_CLIPBOARD : Copy the rotated image the image to the clipboard.
[in] DestImage – Full path name of the destination file. This parameter is ignored if the parameter
DestType is set to SAVE_TO_CLIPBOARD.
Return
If function succeeds, the return the value IMG_ERR_SUCCESS.
Card Scanning Solutions 39
Page 40
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
If the function fails it returns one of the following values:
LICENSE_INVALID – Library was not initialized with proper license. IMG_ERR_BAD_ANGLE_0 – Bad rotation parameter for Image 0. IMG_ERR_BAD_ANGLE_1 – Bad rotation parameter for Image 1.
IMG_ERR_FILE_OPEN_FIRST – Cannot open SourceImage0 file. IMG_ERR_FILE_OPEN_SECOND – Cannot open SourceImage1 file. IMG_ERR_BAD_DESTINATION – Bad destination parameter (the destination is neither file or clipboard) IMG_ERR_COMB_TYPE – Bad CombType value.
IMG_ERR_FILE_SAVE_TO_CLIPBOARD – Cannot save image to clipboard due to an error. IMG_ERR_FILE_SAVE_TO_FILE – Cannot save destination file due to a bad destination path or
disk error.
Remarks
Use this function to combine two image files into a single image file. The function works in the following sequence:
Imports SourceImage0 to an i mage object 0. Rotate image object0 by Angle0 Imports SourceImage1 to an image object 1. Rotate image object1 by Angle1 Combine Image0 and Image1 one on top of each other (if CombType is equal
IMAGE_COMB_VERTICAL) or one to the left of the other (if CombType is equal IMAGE_COMB_ HORIZONTAL).
Save the result image to an external file or to the clipboard.
Notice: This function can work only on image files and not on the internal image.
Card Scanning Solutions 40
Page 41
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
ExtractText ( _
InitLibrary
(
License
As String) As Long
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
Library COcr: Properties and Functions
COcr provides basic text extraction from an image file. The image file format must have a resolution of 300 dpi. The image may be in either color or black and white color scheme.
COcr Library Functions
1.1. 46. InitLibrary
Format
Parameters
[in] License – Null terminated string that holds license key value.
Return
LICENSE_VALID: License is valid and the library is ready to be used. LICENSE_INVALID: The license is invalid. All scanner operations are disabled.
LICENSE_EXPIRED: License has expired. All scanner operations are disabled. LICENSE_DOES_NOT_MATCH_LIBRARY: The license is invalid for this library. All library
operations are disabled. GENERAL_ERR_PLUG_NOT_FOUND: This error returns if the attached scanner is not one of the following scanners: ScanShell 600 ScanShell 800 ScanShell 1000
Remarks Use this function to initialize the COcr library. This function must be called before calling any other function in the library.
1.1. 47. ExtractText
Type
Function.
Format
SourceImage As String, _ TextType As Long, _
)
Card Scanning Solutions 41
Page 42
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
Parameters
[in] SourceImage – Full path name of the original image. [in] TextType – Instruct the OCR what type of data is written in the image. This value increases the detection accuracy and speeds the OCR operation. This value can be one of the following values:
USE_ALPHANUM : The image contains alphanumeric characters. USE_ALPHA_CAPS_ONLY: The image contains capital letters only. USED_NUM_ONLY : The image contains numbers only
Return
If function succeeds, the return the value TOCR_SUCCESS. If the function fails it returns one of the following values:
LIC ENSE_INVALID – Library was not initialized with proper license. TOCRJOBERROR – The OCR engine was not able to accomplish the detection process correctly.
TOCR_BAD_TYPE– Bad TextType value.
Remarks
Use this function to extract text bulks from an image. The text size is limited to 4K (4096) characters.
1.1. 48. ExtractTextEx
Type
Function.
Format
ExtractTextEx ( SourceImage As String )
Parameters
[in] SourceImage – Full path name of the original image.
Return
If function succeeds, the return the value TOCR_OK (=0). If the function fails it returns one of the following values:
LICENSE_INVALID – Library was not initialized with proper license. TOCRJOBERROR – The OCR engine was not able to accomplish the detection process correctly.
TOCR_BAD_TYPE– Bad TextType value.
Remarks
Use this function to extract text bulks from an image. The text size is limited to 4K (4096) characters. This function process the image file in a different method than ExtractText function does; this result in a longer processing time but with higher accuracy. This functi on is recommended for use with complex document structure where processing time is not critical.
Card Scanning Solutions 42
Page 43
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
COcr Library Properties
1.1. 49. mText
Type
Property.
Direction
Read Only.
Remarks
Contains the extracted text. This property is loaded after the execution of ExtractText() function.
Card Scanning Solutions 43
Page 44
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
Library MagLib: General Functionality
MagLib controls the magnetic reader, collect and analyses its data once a card was swiped. The library scans COM1-COM16 for the existence of the magnetic reader and initializes it. Once a magnetic card is swiped, the data is parsed and refresh the relevant properties of the library. The library automatically detects the data format and parses it. The following driver license formats are supported:
AAMVA Old DMV (California) Old DMV (Louisiana).
MagLib Library Functions
1.1. 50. InitLibrary
Format
InitLibrary ( License As String) As Long
Parameters
[in] License – Null terminated string that holds license key value.
Return
LICENSE_VALID: License is valid and the library is ready to be used. LIC ENSE_INVALID: The license is invalid. All scanner operations are disabled.
LICENSE_EXPIRED: License has expired. All scanner operations are disabled. LICENSE_DOES_NOT_MATCH_LIBRARY: The license is invalid for this library. All library
operations are disabled. GENERAL_ERR_PLUG_NOT_FOUND: This error returns if the attached scanner is not one of the following scanners: ScanShell 600 ScanShell 800 ScanShell 1000 MAG_ERR_NO_READER_FOUND : The magnetic reader device could not be found on any of the PC ports.
Remarks This function scan COM1-COM16 and search for the magnetic reader device. Once found, the reader is initialized and the library loads and initialized.
Card Scanning Solutions 44
Page 45
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
IsReaderValid () As Long
WasCardSweeped () As Long
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
1.1. 51. IsReaderValid
Format
Return MAG_ERR_NO_READER_FOUND : The reader is not connected to the PC.
MAG_ERR_NONE: The reader is connected to the PC and functioning correctly.
Remarks Detect if the Magnetic Reader hardware is connected and functioning. The reader is searched in the COM port found in InitLibrary function.
1.1. 52. WasCardSweeped
Format
Return MAG_ERR_NO_READER_FOUND : The reader is not connected to the PC. SERIAL_NOT_INIT: Serial port is not initialized. SERIAL_PORT_NOT_OPEN: Serial port could not be opened. SERIAL_PORT_CONFIG_FAIL: COM Port configuration failed. SERIAL_COM_TIMEOUT_FAIL: COM Port timeout failure. MAG_ERR_CARD_NOT_DETECTED: No new card swipe was detected from the last call to this
function. MAG_ERR_CARD_DETECTED : A recent card swipe was detected and the data is available for process.
Remarks Call this function periodically to find out if a new card swipe was performed. If no new swipe was performed, the function returns MAG_ERR_CARD_NOT_DETECTED. If the reader detects a new swipe it returns MAG_ERR_CARD_DETECTED . If the system is in error condition (due to bad initialization or disconnection of the reader from the PS) the function return one of the other values.
Card Scanning Solutions 45
Page 46
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Process
() As Long
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
1.1. 53. Process
Format
Return LONG_AAMVA: Standard AAMVA format ( includes channel1, channel2 and channel3). SHORT_AAMVA: Short AAMVA format (includes channel1 and channel3). OLD_CA_DMV: Old DMV format (California). OLD_LA_DMV: Old DMV format (Louisiana). UNKNOWN_FORMAT: Unknown format. In such case no further processing is done.
Remarks
Call this function to process the recently swiped card raw data. The raw data is scanned for format detection. If a specific format is detected, the data is parsed further and load the library properties.
1.1. 54. GetRawData
Format
GetRawData (bufer As String) As Long
Parameters
[in] Buffer – Null terminated string that receives the raw data.
Return MAG_ERR_NONE: Data retrieve successfully.
MAG_ERR_CARD_NOT_DETECTED: Buffer is empty.
Remarks Call this function to get the data as retrieved from the magnetic reader device without further processing.
Card Scanning Solutions 46
Page 47
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Address
City Class
DateOfBirth
Endorsements
ExpirationDate
Eyes Air Height
Issue License
NameFirst
NameLast
NameMiddle
Restriction
Sex State
Weight
Zip
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
MagLib Library Properties
MagLib library store the detected textual information in an internal data structure. This structure is refreshed in each Process() function call. Some of the properties are relevant to some magnetic card formats and some are irrelevant. For example, the property ISSUE is relevant to California Old DMV id cards and not to standard AAMVA cards. If a property is irrelevant to a particular state, or if the field is not detected, it clears to an empty string. Loading the properties is done using a simple string assignment.
The supported properties are:
Card Scanning Solutions 47
Page 48
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
Library CPassport: General Functionality
CPassport analyses and retrieve data from a standard passport image. The passport image is taken using ScanShell1000 scanner in either color or gray color scheme, analysed by the library and the result data is stored the library properties. The image may be a full image of the page (3”x5”) or only the lower portion of the page (1”x5”).
CPassport Library Functions
1.1. 55. Init
Format
Init (License As String) As Long
Parameters
[in] License – Null terminated string that holds license key value.
Return
LICENSE_VALID: License is valid and the library is ready to be used. LICENSE_INVALID: The license is invalid. All scanner operations are disabled.
LICENSE_EXPIRED: License has expired. All scanner operations are disabled. LICENSE_DOES_NOT_MATCH_LIBRARY: The license is invalid for this library. All library
operations are disabled. GENERAL_ERR_PLUG_NOT_FOUND: This error returns if the attached scanner is not one of the following scanners: ScanShell 600 ScanShell 800 ScanShell 1000 MAG_ERR_NO_READER_FOUND : The magnetic reader device could not be found on any of the PC ports.
Remarks This function initilize the library. This functin must be called before any othe function in the library can be used.
Card Scanning Solutions 48
Page 49
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Process () As Long
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
1.1. 56. Process
Format
Return
If function succeeds, the return value is PASS_ERR_NONE. If function fails, the return value is one of the following:
LICENSE_INVALID – The library was not initialized with the proper license. INVALID_INTERNAL_IMAGE – No internal image is loaded. This value return when attempting to
use this function without scanning an image first.
Remarks
Call this function to process the recently scanned passport image. When the scanning the passport page using the ScanShell1000, the opened page should be aligned to the top right corner which yields a rotated internal image. Before processing the image it needs to be rotated in 180 degrees (using the function RotateImage).
The image should have the following properties:
Color scheme: Select one of the following 24 bit (True color) 256 Gray shades
Image size: Select one of t he following 3” x 5”: This scan the full page of the passport 1” x 5”: This scans only the lower portion of the page.
Once the function returns PASS_ERR_NONE, the library properties will be loaded with analyzed text. Otherwise, the library property fields will be empty.
The raw data is scanned for format detection. If a specific format is detected, the data is parsed further and load the library properties.
1.1. 57. GetFace
Format
GetFace (DestFile As String) As Long
Parameters
[in] DestFile – Null terminated string that holds the full name of the destination image file that will contain the face image from the passport.
Card Scanning Solutions 49
Page 50
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
PassportNumber
NameFirst
NameMiddle
NameLast
ExpirationDate
DateOfBirth
Sex Pe
rsonalNumber
Nationality
NationalityLong
Country
CountryLong
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
Return
If function succeeds, the return value is PASS_ERR_NONE.
If the function fails one of the following values is returned:
LICENSE_INVALID – Library was not initialized with proper license. PASS_ERR_CANNOT_DELETE_DESTINATION_IMAGE– Returned when a file with the same
name as the destination file already exist and cannot be overwritten. PASS_ERR_CANNOT_COPY_TO_DESTONATION – Returned when the destination file cannot be opened for write on the disk.
PASS_ERR_FACE_IMAGE_NOT_FOUND – Could not retrieve the face image from the passport image.
Remarks
Use this function to extract the image rectangle of the person’s face from the source passport image. Remember that the original scanned image must be rotated in 180 degrees (so it will be aligned correctly) before this function is called. This function works properly only for 3”x5” images. The destination image is generated in BITMAP format.
CPassport Library Properties
CPassport library store the detected textual information in an internal data structure. This structure is refreshed in each Process() function call.
The supported properties are:
Notes: The field Country stands for the Passport Issuing country The fields Country and Nationality comes in two formats: Regular format (Nationality, Country): The text as appears in the passport, i.e., USA for United States, SGP for Singapore, etc. Long Format (NationalityLong, CountryLong ): Interpreted country names: United States, Singapore, etc.
Card Scanning Solutions 50
Page 51
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
Appendix A – VB Demo Program
The attached demo VB project shows the utilization of the four libraries. The program shows in a nutshell the various aspects of the libraries:
Paper insertion detection Document scan Image file manipulation OCR text extraction (using OCR related license only) ID card data extraction (using ID CARD license only)
1.1. 58. Using the license key in the program
To activate the proper libraries you must first apply the proper license number to the program. The license activates the libraries in the Form.Load() function. To obtain the license key please contact your local Card Scanning Solution product dealer.
1.1. 59. Applying the license key to the code
Open the file License.bas and type in your license value. So instead of the original line:
' Setup the license value. This value is used to unlock the libraries usage Public Const LI CENSE_VALUE = "XXXXXXXXXXXXXXXX"
You will type your license key value: ' Setup the license value. This value is used to unlock the libraries usage Public Const LICENSE_VALUE = "A7MIIFHXDZT8J3FU"
An updated temporary SDK license can be obtained from http://www.id-scan.com/developer
Card Scanning Solutions 51
Page 52
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
File name
Destination directory
Functionality
imgForm.DLL
Windows
\
system32
Image processing tools collection
Parser.DLL
Sdk destination directory
Handle driver’s license data parsing per
BarCode.DLL
Sdk destination direct
ory 2D barcode analyzer
\
parser
ImageCtrl.dll
Sdk destination directory
Image processing tools collection
IdCard.dll
Sdk destination directory
Driver’s license image analyzer
Msvbvm50.dll
Sdk destination directory
OCR_PreProc.dll
Sdk destination direct
ory Driver’s license image analyser
ScanW.dll
Sdk destination directory
Wrapper library to SDK
ScanWex.dll
Sdk destination directory
SLib.dll
Sdk destination directory
Controls the scanner activity
SOCRdll.dll
Sdk destination directory
OCR library
test5.gar
Sdk destination directory
OCR library
test5.n3s
Sdk destination directory
OCR library
test5.teh
Sdk destination directory
OCR library
TOCRR.ini
Sdk destination directory
OCR library
AfricaIDs.bin
Sdk destination directory
Africa template collections for auto
-
state
AfricaIDs.dat
Sdk destination directory
Snps_
AfricaIDs.dat
Sdk de
stination directory
EuropeIDs.bin
Sdk destination directory
European template collections for auto
-
EuropeBwIDs.dat
Sdk destination directory
Snps_
EuropeBwIDs.dat
Sdk destination directory
EuropeIDs.dat
Sdk destination directory
Eur
opeSIDs.dat
Sdk destination directory
Snps_
EuropeSIDs.dat
Sdk destination directory
AmericaIDs.bin
Sdk destination directory
South
-
America template collections for
AmericaIDs.dat
Sdk destination directory
Snps_
AmericaIDs.dat
Sdk destination directory
UsaIDs.bin
Sdk destination directory
USA template collections for auto
-
state
UsaIDs.dat
Sdk destination directory
Snps_
UsaIDs.dat
Sdk destination directory
detection
AsiaIDs.dat
Sdk destination directory
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
Appendix B – SDK installation and Registration
1.1. 60. Installing the SDK package
The SDK files are packed in a single setup file (SDK_Setup.exe). Installing the setup file extract the following file list:
state
CImage.dll
test5.qnp Sdk destination directory OCR library
TOCRRdll.dll Sdk destination directory OCR library TOCRRService.exe Sdk destination directory OCR library
detection
state detection
auto-state detection
detection
AsiaIDs.bin Sdk destination directory Asia template collections for auto-state
Snps_AsiaIDs.dat Sdk destination directory AustraliaIDs.bin Sdk destination directory Australia template collections for auto-
Card Scanning Solutions 52
Page 53
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
state detection
AustraliaIDs.dat
Sdk destination director
y
Snps_
AustraliaIDs.dat
Sdk destination directory
CanadaIDs.bin
Sdk destination directory
Canada template collections for auto
-
state
CanadaIDs.dat
Sdk destination directory
Snps_
CanadaIDs.dat
Sdk destination directory
Passport
s.dat
Sdk d
estination directory
Snps_
GeneralIDs.dat
Sdk destination directory
EngRotDB.bin
Sdk destination directory
Card alignment template detection
MSI.DLL
Windows
\
system32
Part of Windows system (
Installs only if
NetScanW.dll
Sdk destination directory
Wrapper of the ScanW.dll to use in .Net
NetScanW
ex
.dll Sdk destination directory
Wrappe
r of the ScanWex.dll to use in
ScanX.dll
Sdk destination directory
Wrapper of the SDK to use it as ActiveX
Version.txt
Sdk destination directory
SDK Versi
on indicator
file
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
detection
Snps_Passports.dat GeneralIDs.dat Sdk destination directory
MRZlines.dat Sdk destination directory
ATL.DLL Windows\system32 Part of Windows system ( Installs only if
newer )
newer )
.Net
control (for java vba…)
Note: The libraries imgForm.dll, ImageCtrl.dll, OCR_PreProc.dll and Slib.dll are mandatory libraries and must exist in ALL sdk configurations
After the extraction the installation program register ATL.DLL (if newer) and MSI.DLL (if newer) and eventually register Scanw.dll.
Manual registration 1:
Another method to register the ScanW.dll library is to use the mouse right click button. To use this option you must first merge the attached OCX file ‘ocxdllreg.reg’ (can be found under TOOLS directory) by clicking on it and selecting YES button when asked. This will enable the option to register ScanW.dll using the mouse when you will click on the file name in windows explorer with the mouse right button.
Manual registration 2:
Additional method to register Scanw.dll is to open a shell command prompt and in the SDK files destination directory and type the following command:
REGSVR32.EXE SCANW.DLL
1.1. 61. Obtaining the full SDK package
The full sdk package includes the sdk files, documentation; VB and VC++ sample codes can be obtained from:
http://www.id-scan.com/ FTP/Applications/SDK/SDK.zip
Card Scanning Solutions 53
Page 54
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
Appendix C – Constant Definitons
The following values are used as constants:
1.1. 62. Library SlibEx constants
' Scanner color scheme types Public Const GRAY = 1 Public Const BW = 2 Public Const HT = 3 Public Const TRUECOLOR = 4
' Scanner return values Public Const SLIB_FALSE = 0 Public Const SLIB_TRUE = 1
' Scanner general error types Public Const SLIB_ERR_NONE = 1 Public Const SLIB_ERR_INVALID_SCANNER = -1
' Scanning failure definition Public Const SLIB_ERR_SCANNER_GENERAL_FAIL = -2 Public Const SLIB_ERR_CANCELED_BY_USER = -3 Public Const SLIB_ERR_SCANNER_NOT_FOUND = -4 Public Const SLIB_ERR_HARDWARE_ERROR = -5 Public Const SLIB_ERR_PAPER_FED_ERROR = -6 Public Const SLIB_ERR_SCANABORT = -7 Public Const SLIB_ERR_NO_PAPER = -8 Public Const SLIB_ERR_PAPER_JAM = -9 Public Const SLIB_ERR_FILE_IO_ERROR = -10 Public Const SLIB_ERR_PRINTER_PORT_USED = -11 Public Const SLIB_ERR_OUT_OF_MEMORY = -12
Public Const SLIB_ERR_BAD_WIDTH_PARAM = -2 Public Const SLIB_ERR_BAD_HEIGHT_PARAM = -3
Public Const SLIB_ERR_BAD_PARAM = -2
Public Const SLIB_LIBRARY_ALREADY_INITIALIZED = -13 Public Const SLIB_ERR_DRIVER_NOT_FOUND = -14 Public Const SLIB_ERR_SCANNER_BUSSY = -15 Public Const SLIB_ERR_IMAGE_CONVERSION = -16 Public Const SLIB_UNLOAD_FAILED_BAD_PARENT = -17 Public Const SLIB_NOT_INITILIZED = -18 Public Const SLIB_LIBRARY_ALREADY_USED_BY_OTHER_APP = -19 Public Const SLIB_CONFLICT_WITH_INOUTSCAN_PARAM = -20 Public Const SLIB_CONFLICT_WITH_SCAN_SIZE_PARAM = -21
' Button definition for ScanShell1000 Public Const TOP_BUTTON = 1 Public Const MIDDLE_BUTTON = 3 Public Const BOTTOM_BUTTON = 2
Card Scanning Solutions 54
Page 55
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
‘Error values for multiple devices management Public Const SLIB_NO_SUPPORT_MULTIPLE_DEVICES = -22 Public Const SLIB_ERR_CAM_ALREADY_ASSIGNED = -23 Public Const SLIB_ERR_NO_FREE_CAM_FOUND = -24 Public Const SLIB_ERR_CAM_NOT_FOUND = -25 Public Const SLIB_ERR_CAM_NOT_ASSIGNED_TO_THIS_APP = -26
Card Scanning Solutions 55
Page 56
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
1.1. 63. Library idData constants
' Country definitions Public Const COUNTRY_USA = 0 Public Const COUNTRY_AUSTRALIA = 1 Public Const COUNTRY_MALAYSIA = 2 Public Const COUNTRY_CANADA = 3 Public Const COUNTRY_CHILE = 4 Public Const COUNTRY_FRANCE = 5 Public Const COUNTRY_MEXICO = 6 Public Const COUNTRY_UNITED_KINGDOM = 7 Public Const COUNTRY_BRAZIL = 8 Public Const COUNTRY_ISRAEL = 9 Public Const COUNTRY_GERMANY = 10 Public Const COUNTRY_SPAIN = 11 Public Const COUNTRY_ROMANIA = 12 Public Const COUNTRY_BERMUDA = 13 Public Const COUNTRY_SINGAPORE = 14 Public Const COUNTRY_NORWAY = 15 Public Const COUNTRY_NEW_ZELAND = 16 Public Const COUNTRY_HOLAND = 17 Public Const COUNTRY_LUX = 18 Public Const COUNTRY_LITHUANIA = 19 Public Const COUNTRY_SWISS = 20 Public Const COUNTRY_BAHAMAS = 21 Public Const COUNTRY_SWEDEN = 22 Public Const COUNTRY_ITALY = 23 Public Const UNIVERSITY_USA = 24 Public Const COUNTRY_TURKEY = 25 Public Const EMPLOYMENT_CARDS = 26 Public Const COUNTRY_POLAND = 27 Public Const COUNTRY_PERU = 29 Public Const COUNTRY_PUERTO_RICO = 30 Public Const COUNTRY_PORTUGAL = 31 Public Const COUNTRY_NICARAGUA = 32 Public Const COUNTRY_GUATEMALA = 33 Public Const COUNTRY_EL_SALVADOR = 34 Public Const COUNTRY_SOUTH_AFRICA = 35 Public Const COUNTRY_PANAMA = 36 Public Const COUNTRY_INDONESIA = 37 Public Const COUNTRY_BELGIUM = 38 Public Const SERVICE_CARDS = 39 Public Const ENTERTAINMENT_CARDS = 40 Public Const COUNTRY_CROATIA = 41 Public Const USAPILOTS_CARDS = 42 Public Const COUNTRY_CHINA = 43 Public Const ACCESS_CARDS = 44 Public Const COUNTRY_BULGARIA = 45 Public Const fine EUROPE_GENERAL_CARDS = 46 Public Const COUNTRY_CZECH = 47 Public Const COUNTRY_BOSNIA = 48 Public Const COUNTRY_HUNGARY = 49 Public Const COUNTRY_SLOVAKIA = 50 Public Const COUNTRY_KOSOVO = 51
Card Scanning Solutions 56
Page 57
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
Public Const OCB_CARDS = 52 Public Const COUNTRY_SLOVENIA = 53 Public Const COUNTRY_IRELAND = 54 Public Const COUNTRY_UAE = 55 Public Const COUNTRY_ BAHRAIN = 56
' states definitions Public Const ID_ALABAMA = 0 Public Const ID_ALASKA = 1 Public Const ID_ARIZONA = 2 Public Const ID_ARKANSAS = 3 Public Const ID_CALIFORNIA = 4 Public Const ID_COLORADO = 5 Public Const ID_CONNECTICUT = 6 Public Const ID_DELAWARE = 7 Public Const ID_WASHINGTON_DC = 8 Public Const ID_FLORIDA = 9 Public Const ID_GEORGIA = 10 Public Const ID_IDAHO = 11 Public Const ID_ILLINOIS = 12 Public Const ID_INDIANA = 13 Public Const ID_IOWA = 14 Public Const ID_KANSAS = 15 Public Const ID_KENTUCKY = 16 Public Const ID_LOUISIANA = 17 Public Const ID_MAINE = 18 Public Const ID_MARYLAND = 19 Public Const ID_MASSACHUSETTS = 20 Public Const ID_MICHIGAN = 21 Public Const ID_MINNESOTA = 22 Public Const ID_MISSISSIPPI = 23 Public Const ID_MISSOURI = 24 Public Const ID_MONTANA = 25 Public Const ID_NEBRASKA = 26 Public Const ID_NEVADA = 27 Public Const ID_NEW_HAMPSHIRE = 28 Public Const ID_NEW_JERSEY = 29 Public Const ID_NEW_MEXICO = 30 Public Const ID_NEW_YORK = 31 Public Const ID_NORTH_CAROLINA = 32 Public Const ID_NORTH_DAKOTA = 33 Public Const ID_OHIO = 34 Public Const ID_OKLAHOMA = 35 Public Const ID_OREGON = 36 Public Const ID_PENNSYLVANIA = 37 Public Const ID_RHODE_ISLAND = 38 Public Const ID_SOUTH_CAROLINA = 39 Public Const ID_SOUTH_DAKOTA = 40 Public Const ID_TENNESSEE = 41 Public Const ID_TEXAS = 42 Public Const ID_UTAH = 43 Public Const ID_VERMONT = 44 Public Const ID_VIRGINIA = 45 Public Const ID_WASHINGTON = 46
Card Scanning Solutions 57
Page 58
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
Public Const ID_WEST_VIRGINIA = 47 Public Const ID_WISCONSIN = 48 Public Const ID_WYOMING = 49 Public Const ID_HAWAII = 54 Public Const ID_GREEN_CARD = 81 Public Const ID_ARMY_CARD = 82 Public Const ID_SSN_CARD = 83 Public Const ID_NYPD = 84 Public Const ID_MEXICO_USA = 85 Public Const ID_GUAM = 86 Public Const ID_CEMA_COMPLIANT = 87
Public Const ID_NSW = 50 Public Const ID_ACT = 51 Public Const ID_QLD = 52 Public Const ID_VIC = 53 Public Const ID_TAS = 55 Public Const ID_WST = 56 Public Const ID_SA = 57 Public Const ID_NT = 58 Public Const ID_COOK_ISLANDS = 59
Public Const ID_MALAYSIA = 60 Public Const ID_SINGAPORE = 180 Public Const ID_NEW_ZELAND = 200
Public Const ID_ONTARIO = 70 Public Const ID_ALBERTA = 71 Public Const ID_BRITISH_COLUMBIA = 72 Public Const ID_MANITOBA = 73 Public Const ID_NEW_BRUNSWICK = 74 Public Const ID_NEW_FOUNDLAND = 75 Public Const ID_NWTERITORIES = 76 Public Const ID_NOVASCOTIA = 77 Public Const ID_SASKATCHEWAN = 78 Public Const ID_CANADA_CITIZEN_ID = 79 Public Const ID_QUEBEC = 1079
Public Const ID_CHILE = 80 Public Const ID_FRANCE = 90 Public Const ID_MEXICO = 100 Public Const ID_UNITED_KINGDOM = 110 Public Const ID_ISRAEL = 120 Public Const ID _BRAZIL = 130 Public Const ID_GERMAN_ID = 140 Public Const ID_GERMAN_LIC = 141 Public Const ID_SPAIN = 150 Public Const ID_ROMANIA = 160 Public Const ID_NORWAY = 190 Public Const ID_HOLAND = 210 Public Const ID_LUX = 220 Public Const ID_LITHUANIA = 230 Public Const ID_SWISS = 240 Public Const ID_SWEDEN = 260 Public Const ID_ITALY = 270 Public Const ID_UNIVERSITY_USA = 280
Card Scanning Solutions 58
Page 59
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
Public Const ID_TURKEY = 290 Public Const ID_EMPLOY = 300 Public Const ID_POLAND = 310 Public Const ID_COSTA_RICA = 320 Public Const ID_PERU = 330 Public Const ID_PUERTO_RICO = 340 Public Const ID_PORTUGAL = 350 Public Const ID_NICARAGUA = 360 Public Const ID_GUATEMALA = 370 Public Const ID_EL_SALVADOR = 380 Public Const ID_SOUTH_AFRICA = 390 Public Const ID_PANAMA = 400 Public Const ID_INDONESIA = 410 Public Const ID_BELGIUM = 420 Public Const ID_PROTECTIVE = 430 Public Const ID_ENTERTAINMENT = 440 Public Const ID_CROATIA = 450 Public Const ID_USAPILOTS = 460 Public Const ID_CHINA = 470 Public Const ID_ACCESS = 480 Public Const ID_BULGARIA = 490 Public Const ID_KEYPASS = 500 Public Const ID_EUROPE_GENERAL_CARDS = 510 Public Const ID_CZECH = 520 Public Const ID_BOSNIA = 530 Public Const ID_HUNGARY = 540 Public Const ID_SLOVAKIA = 550 Public Const ID_KOSOVO = 560 Public Const OCB_CARDS = 570 Public Const ID_SLOVENIA = 580 Public Const ID_MRZ_INFO = 590 Public Const ID_IRELAND = 600 Public Const ID_UAE = 610 Public Const ID_ BAHRAIN = 620 Public Const ID_SPAIN_POLICE = 630 Public Const ID_AUSTRIA = 640 Public Const ID_RUSSIA = 650 Public Const ID_SERBIA = 660 Public Const ID_BOLIVIA = 670
' region definitions Public Const REGION_USA = 0 Public Const REGION_CANADA = 1 Public Const REGION_SOUTH_AMERICA = 2 Public Const REGION_EUROPE = 3 Public Const REGION_AUSTRALIA = 4 Public Const REGION_ASIA = 5 Public Const REGION_GENERAL_DOC = 6 Public Const REGION_AFRICA = 7
Public Const FRONT_IMAGE_SIDE = 0 Public Const BACK_IMAGE_SIDE = 1 Public Const UNKNOWN_IMAGE = 2
Card Scanning Solutions 59
Page 60
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
' function return values Public Const ID_TRUE = 1 Public Const ID_FALSE = 0
' error enums Public Const ID_ERR_NONE = 1 Public Const ID_ERR_STATE_NOT_SUPORTED = -2 Public Const ID_ERR_BAD_PARAM = -3 Public Const ID_ERR_NO_MATCH = -4 Public Const ID_ERR_FILE_OPEN = -5 Public Const ID_BAD_DESTINATION_FILE = -6 Public Const ID_ERR_FEATURE_NOT_SUPPORTED = -7
Public Const ID_ERR_COUNTRY_NOT_INIT = -8 Public Const ID_ERR_NO_NEXT_COUNTRY = -9 Public Const ID_ERR_STATE_NOT_INIT = -10 Public Const ID_ERR_NO_NEXT_STATE = -11 Public Const ID_ERR_CANNOT_DELETE_DESTINATION_IMAGE = -12 Public Const ID_ERR_CANNOT_COPY_TO_DESTONATION = -13 Public Const ID_ERR_FACE_IMAGE_NOT_FOUND = -14
' state auto-detect error Public Const ID_ERR_STATE_NOT_RECOGNIZED = -15 Public Const ID_ERR_USA_TEMPLATES_NOT_FOUND = -16 Public Const ID_ERR_WRONG_TEMPLATE_FILE = -17 Public Const ID_ERR_REGION_NOT_INIT = -18 Public Const ID_ERR_AUTO_DETECT_NOT_SUPPORTED = -19 Public Const ID _ERR_COMPARE_NO_TEXT= -20 Public Const ID_ERR_COMPARE_NO_BARCODE = -21 Public Const ID_ERR_COMPARE_BC_LIB_NOT_FOUND = -22 Public Const ID _ERR_COMPARE_LICENSE_DONT_MATCH_BC_LIBRARY= -23 Public Const ID _ERR_DM_LIBRARY_NOT_FOUND= -24 Public Const ID _ERR_DM_LIBRARY_NOT_LOADED = -25 Public Const ID _ERR_DM_WM_NOT_FOUND= -26 Public Const ID_ERR_DM_WM_NOT_AUTHENTICATED = -27
Card Scanning Solutions 60
Page 61
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
1.1. 64. Library CIm age constants
' return values Public Const IMG_ERR_SUCCESS = 0 Public Const IMG_ERR_FILE_OPEN = -100 Public Const IMG_ERR_BAD_ANGLE_0 = -101 Public Const IMG_ERR_BAD_ANGLE_1 = -102 Public Const IMG_ERR_BAD_DESTINATION = -103 Public Const IMG_ERR_FILE_SAVE_TO_FILE = -104 Public Const IMG_ERR_FILE_SAVE_TO_CLIPBOARD = -105 Public Const IMG_ERR_FILE_OPEN_FIRST = -106 Public Const IMG_ERR_FILE_OPEN_SECOND = -107 Public Const IMG_ERR_COMB_TYPE = -108
Public Const IMG_ERR_BAD_COLOR = -130 Public Const IMG_ERR_BAD_DPI = -131 Public Const INVALID_INTERNAL_IMAGE = -132
' image saving target definition Public Const SAVE_TO_FILE = 0 Public Const SAVE_TO_CLIPBOARD = 1
' image rotation angle definitions Public Const ANGLE_0 = 0 Public Const ANGLE_90 = 1 Public Const ANGLE_180 = 2 Public Const ANGLE_270 = 3
' image combination options Public Const IMAGE_COMB_VERTICAL = 0 Public Const IMAGE_COMB_HORIZONTAL = 1
' image color conversion Public Const IMAGE_SAME_COLOR = 0 Public Const IMAGE_BW = 1 Public Const IMAGE_GRAY_256 = 2 Public Const IMAGE_COLOR_256 = 3 Public Const IMAGE_COLOR_TRUE = 4
1.1. 65. Library COcr constants
' return values Public Const TOCR_SUCCESS = 1 Public Const TOCRJOBERROR = -2 Public Const TOCR_BAD_TYPE = -3
' OCR text type detection Public Const USE_ALPHANUM = 0 Public Const USED_NUM_ONLY = 2 Public Const USE_ALPHA_CAPS_ONLY = 3
Card Scanning Solutions 61
Page 62
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
1.1. 66. License related constants
Public Const LICENSE_VALID = 1 Public Const LICENSE_EXPIRED = -20 Public Const LICENSE_INVALID = -21 Public Const LICENSE_DOES_NOT_MATCH_LIBRAR Y = -22 Public Const GENERAL_ERR_PLUG_NOT_FOUND = -200
1.1. 67. Library CBarCode constants
' List of all driver license field indexes ' The values of the fields is extracted directly from the bar code analyzer. Public Const BCF_NAME = 0 Public Const BCF_ADDRESS = 1 Public Const BCF_CITY = 2 Public Const BCF_JURISTRICTION_CODE = 3 Public Const BCF_POASTAL_CODE = 4 Public Const BCF_LICENSE_MAIN = 5 Public Const BCF_CLASS = 6 Public Const BCF_RESTRICTION = 7 Public Const BCF_ENDORSEMENT = 8 Public Const BCF_EXPIRES = 9 Public Const BCF_DOB = 10 Public Const BCF_SEX = 11 Public Const BCF_ISSUE = 12 Public Const BCF_HEIGHT = 13 Public Const BCF_WEIGHT = 14 Public Const BCF_EYES = 15 Public Const BCF_HAIR = 16 Public Const BCF_SSNUMBER = 17 Public Const BCF_PERMIT_CLASS = 18 Public Const BCF_PERMIT_EXP = 19 Public Const BCF_PERMIT_ID = 20 Public Const BCF_PERMIT_ISSUE = 21 Public Const BCF_PERMIT_REST = 22 Public Const BCF_PERMIT_ENDORSEMENT = 23 Public Const BCF_DRIVER_LAST_NAME = 24 Public Const BCF_DRIVER_FIRST_NAME = 25 Public Const BCF_DRIVER_MIDDLE_NAME = 26 Public Const BCF_DRIVER_NAME_SUFFIX = 27 Public Const BCF_DRIVER_NAME_PREFIX = 28 Public Const BCF_MAIL_STREET_ADDRESS2 = 29 Public Const BCF_RES_STREET_ADDRESS1 = 30 Public Const BCF_RES_STREET_ADDRESS2 = 31 Public Const BCF_RES_CITY = 32 Public Const BCF_RES_JURISTRICTION = 33 Public Const BCF_RES_POSTAL_CODE = 34
Card Scanning Solutions 62
Page 63
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
Public Const BCF_HEIGHT_CM = 35 Public Const BCF_WEIGHT_KG = 36 Public Const BCF_ISSUE_TIMESTAMP = 37 Public Const BCF_NUM_OF_DUPLICATES = 38 Public Const BCF_MEDICAL_IND = 39 Public Const BCF_ORGAN_DONOR = 40 Public Const BCF_NON_RESIDENT = 41 Public Const BCF_UNIWUE_CUSTOMER_ID = 42 Public Const BCF_AKA_DOB = 43 Public Const BCF_AKA_SSN = 44 Public Const BCF_AKA_NAME = 45 Public Const BCF_AKA_LAST_NAME = 46 Public Const BCF_AKA_FIRST_NAME = 47 Public Const BCF_AKA_MIDDLE_NAME = 48 Public Const BCF_AKA_SUFFIX = 49 Public Const BCF_AKA_PREFIX = 50
' emulated field indexes. Although PDF417 standard has fixed fields definition, the ' fields population depends on the type of state. The following emulated fields ' extract the data from the raw fields and organized it in unified manner regardless ' to the state type for convenient integration Public Const BCF_EMUL_FULL_NAME = 100 Public Const BCF_EMUL_FIRST_NAME = 101 Public Const BCF_EMUL_MIDDLE_NAME = 102 Public Const BCF_EMUL_LAST_NAME = 103 Public Const BCF_EMUL_NAME_SUFFIX = 104 Public Const BCF_EMUL_DOB = 105 Public Const BCF_EMUL_ISSUE = 106 Public Const BCF_EMUL_EXP = 107 Public Const BCF_EMUL_ADDRESS = 108 Public Const BCF_EMUL_CITY = 109 Public Const BCF_EMUL_STATE = 110 Public Const BCF_EMUL_ZIP = 111 Public Const BCF_EMUL_LICENSE = 112 Public Const BCF_EMUL_SSN = 113
Public Const BCF_EMUL_END = 114 Public Const BCF_EMUL_EYES = 115 Public Const BCF_EMUL_HAIR = 116 Public Const BCF_EMUL_HEIGHT = 117 Public Const BCF_EMUL_WEIGHT = 118
' return error values Public Const BC_ERR_NO_BC_FOUND = 0 Public Const BC_ERR_NONE = 1 Public Const BC_ERR_BAD_PARAM = -1
Card Scanning Solutions 63
Page 64
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
1.1. 68. Library MagLib constants
Public Const MAG_ERR_NONE = 1 Public Const MAG_ERR_CARD_DETECTED = 2
Public Const MAG_ERR_NO_FREE_COM = -30 Public Const MAG_ERR_NO_READER_FOUND = -31 Public Const MAG_ERR_BAD_PARAM = -32 Public Const MAG_ERR_CARD_NOT_DETECTED = -33 Public Const SERIAL_NOT_INIT = -34 Public Const SERIAL_PORT_NOT_OPEN = -35 Public Const SERIAL_PORT_CONFIG_FAIL = -36 Public Const SERIAL_COM_TIMEOUT_FAIL = -37 Public Const SERIAL_FAIL_TO_TX = -38
' driver's license card formats Public Const UNKNOWN_FORMAT = 0 Public Const LONG_AAMVA = 1 Public Const SHORT_AAMVA = 2 Public Const OLD_CA_DMV = 3 Public Const OLD_LA_DMV = 4
Card Scanning Solutions 64
Page 65
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
Appendix D – Debugging Flags
Developing image manipulation code may something be a very hectic task due to the many image format support by the Cimage library. In some cases the notorious “General Failure Event” pops up with no reasonable explanation. To ease the debug process a single debug property (named DebugFlag) was added to the libraries Cimage and idData. The default value of these flags is 0 (non-active). Setting these flags to 1 activate the message system inside the libraries so whenever an error occur the libraries to issue a more detailed error message that explains the failure reason.
Appendix E – Errata Information
The Cimage library currently does not supports image saving the following conditions:
Saving 256 color images in JPG or TIF formats.
Card Scanning Solutions 65
Page 66
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Name
ID
ID
ID USA 0 USA 0 Alabama
0
Alaska
1
Arizona
2
Arkansas
3
California
4
Colorado
5
Connecticut
6
Delaware
7
Wash
ington D.C.
8
Florida
9
Georgia
10
Idaho 11 Illinois
12
Indiana
13
Iowa
14
Kansas
15
Kentucky
16
Louisiana
17
Maine
18
Maryland
19
Massachusetts
20
Michigan
21
Minnesota
22
Mississi
ppi 23 Missouri
24
Montana
25
Nebraska
26
Nevada
27
New Hampshire
28
New Jersey
29
New Mexico
30
New York
31
North Carolina
32
North Dakota
33
Ohio 34 Oklahoma
35
Oregon
36
Pennsylvania
37
Rhode Island
38
South Carolina
39
South Dakota
40
Tennessee
41
Texas
42
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
Appendix F – Supported States for Detection
The following table shows the supported states by ScanW library. This list will be updated in every new version release of ScanW library.
Country
Region
Country Name Country
Document Name Document
Card Scanning Solutions 66
Page 67
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Utah 43 Vermont
44
Virginia
45
Washington
46
West Virginia
47
Wisconsin
48
Wyoming
49
Hawaii
54
Permanent Resid
ent
81 USA Army
82
Social Security Card
83
NY Police department
84
Matricula consular
85 Tribal
88
US Virgin Islands
91
Australia
4
Australia
1
New South Wales
- DL 50 Australian Capital
51 Queensland
- DL 52 Victoria
- DL 53 Tasmania
- DL 55 Western Australia
- DL 56 South Australia
- DL 57 Northern Territory
-
58 New Zealand
– DL 200 Cook Island
– DL 59 Fiji - DL 61
Asia 5 C
hina 43 Hong Kong
– National
470 Indonesia
37
Indonesia
– DL 410 Malaysia
2
Malaysia
– National ID
60 Singapore
14
Singapore
– DL 180 New Zealand
16
New Zealand
200 United Arab Emirates
55
United Arab Emirates
610 Brunei 68
Brunei
720 Canada
1
Canada
3
Ontario
- DL 70 Alberta
- DL 71 British Columbia
- DL 72 Manitoba
- DL 73 New Brunswick
- DL 74 New Foundland
- DL 75 New Territories
- DL 76 Nova Scotia
- DL 77 Saskatchewan
- DL 78 Canadian Citizen ID
79
Quebec
- DL 1079 South
2 Chile
4
Chile - DL + National
80
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
(Green Card)
(Mexican Id)
Territory - DL
DL
ID
+ Driver License
America
Card Scanning Solutions 67
ID
Page 68
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Mexico
6
Mexico
– DL +
100 Brazil
8
Brazil
– DL + National
130 Bermuda
13
Bermuda
– DL +
17 Costa
Rica 28 Costa Rica
– National
320 El Salvador
34
El Salvador
– DL +
380 Guatemala
33
Guatemala
– DL +
370 Nicaragua
32
Nicaragua
– National
360 Panama
36
Panama
– National ID
400 Peru 29 Peru –
National ID
330 Puerto Rico
30
Puerto Rico
– DL +
Firearms License
340
Bolivia
60
Passports
670 Ecuador
67
Identity card
710 Honduras
69
Identity card
730 D
ominican Republic
73
Identity card
770 H
aiti 74 Identity card
780 Europe
3
France
5
France
– Natio
nal ID
90
Belgium
38
Belgium
– National ID
420
National ID
Germany
10
Germany
– DL 140 Germany
10
Germ
any –National ID
141
ID
Italy 23 Identity card & driver
270 Luxembourg
18
Luxembourg
– National
220 Norway
15
Norway
– DL 190 Poland
27
Poland
– DL + National
310 Portugal
31
Portugal
– National ID
350 Romania
12
Romania
– DL +
160 Slovakia
50
Slovakia
– DL +
550
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
National ID + Voter card
ID
National ID
ID
National ID
National ID
ID
Bosnia 48 Bosnia – DL + National
530
ID Bulgaria 45 Bulgaria – National ID 490 Czech 57 Czech – DL 520 Croatia 41 Croatia – DL +
Spain 11 Spain – DL + National
Bosnia 48 Bosnia – DL + National
450
150
530
ID Hungary 49 Hungary – DL +
540
National ID Holland 17 Holland – DL +
210
National ID
license
ID
ID
National ID
Card Scanning Solutions 68
National ID
Page 69
10350 Santa Monica Blvd. Suite 285,
Los Angeles, CA 90025
Sweden
22
Swede
n driver license
260 Switzerland
20
Switzerland
– National
240 Turkey
25
Turkey
– DL 290 Israel
9
Israel
– DL 120 United Kingdom and
7 United Kingdom and
110 Kosovo
51
Kosovo
– National ID
560 Hungary
49
Identit
y card & driver
540 Slovenia
53
Slovenia Identity card
580 Austria
57
Passports
640 Liechtenstein
63
Identity card
680 Finland
64
Identity card
690 Estonia
71
Identity card
750 Denmark
72
Identity card
760 Africa
7
South Africa
35 South Africa
390 General
6 University documents
24 Student Id (UMASS,
280 Employment card
26
Employment card
300 Service card
39
Service card
430 Entertainmen
t Card
40
Entertainment Card
440 USA Pilots
42
USA Pilots
460 Access Card
44
Access Card
480 OCB Cards
52
OCB Cards
570 Spain Police
61
Spain Police
630 EHIC 65 EHIC
700 SCSIUSAC
70
SCSIUSAC
740 USAA
75
USAA_CARDS
790
Phone: 310-691-8920, 310-788-9840, Fax: 419-735-2419
ID
Documents
Ireland
(USA)
Ireland – DL
license
Boston Un., Emerson
Clg., Harward Un.,
NorthEastern Un.,
Suffolk Un.)
Card Scanning Solutions 69
Loading...