Skip to content
GBG Documents & Biometrics Documentation

CSSNLib library

Address Address2 Address3 Address4
Address5 Address6 Audit AutoDetectState
AutoDetectStateEx CalibrateScanner CalibrateScannerEx CalibrationThreshold
City Class Clean ConcatenateImage
ConvertImage County CSC DateOfBirth
DetectProcessAndCompareEx DetectProcessDuplexEx Duplex Endorsements
ExpirationDate ExtractText Eyes Fee
getBCData1D getBCAddress getBCCity getBCClass
getBCDateOfBirth getBCExpirationDate getBCLicense getBCName
getBCNameFirst getBCNameLast getBCNameMiddle getBCNameSuffix
getBCSex getBCSocialSecurity getBCState getBCZip
getBCEndorsements getBCHair getBCEyes getBCHeight
getBCWeight getBCAddress2 getBCCity2 getBCState2
getBCZip2 GetDetectAccuracy GetFaceImage GetFaceImageEx
GetFaceImageBuffer GetFaceImageBufferDirect GetFirstCountry GetFirstStateByCountry
GetIDFieldMRZChecksumVerified GetImageBufferData GetImageBufferDataDirect GetImageBufferDataBack
GetImageBufferDataBackDirect GetImageDimensions GetImageProperties getJpgQuality
getMagAddress getMagCity getMagClass getMagDateOfBirth
getMagEndorsements getMagExpirationDate getMagEyes getMagHair
getMagHeight getMagIssueDate getMagLicense getMagNameFirst
getMagNameLast getMagNameMiddle getMagNameSuffix getMagRawData
getMagRestriction getMagSex getMagState getMagWeight
getMagZip GetNextCountry GetNextStateByCountry getPassportFaceEx
getPassportAddress2 getPassportAddress3 getPassportCountry getPassportCountryLong
getPassportPassportNumber getPassportPersonalNumber getPassportSex getPassportDateOfBirth4
getPassportExpirationDate4 getPassportIssueDate4 GetPassportMRZChecksumVerified GetRawData
GetRawDataDirect GetRawField getResolution getScanHeight
getScannerColorScheme getScanVersion getScanWidth GetSignImage
Hair Id Id2Country Id2State
IdCountry IdCountryShort IdOriginal IdWideCharacters
ImageColor ImageDPI ImageHeight ImageWidth
ImgDespeckle InitBarcodeLibrary InitCImageLibrary InitCOcrLibrary
InitIdDataLibrary InitMagLibLibrary InitPassportLibrary InitSLibLibrary
InOutScan IsNeedCalibration IsReaderValid IsScannerValid
IssueDate LastErrorStatus LastStateIndex License
mText NameFirst NameLast NameMiddle
NameSuffix NameFirst_NonMRZ NameLast_NonMRZ NameMiddle_NonMRZ
NameSuffix_NonMRZ PaperInTray ProcBarcode1DImage ProcBarcodeImage
ProcessMag ProcessMagEx ProcessPassport ProcState
ReformatImage RefreshBarcodeData RefreshData RefreshDataAu
RegionAutoDetectSupport RegionByCountry RegionGetFirst RegionGetFirstCountry
RegionGetIdByName RegionGetNameById RegionGetNext RegionGetNextCountry
RegionSet Restriction RotateImage ScannerType
ScanToFile ScanToFileEx setResolution setScanHeight
setScannerColorScheme setJpgQuality Sex Side
SigNum setScanWidth State State2Id
StateIsSupported SocialSecurity textStampOnImgEx Type_
textStampOnImg VersionCImage VersionCOcr
unInit Version Weight Zip
VersionIdData WasCardSweeped ResetPassportData DateOfBirth4
idProcMRZ ResetIDFields ReleasePort GetCountryIDByStateID
ExpirationDate4 IssueDate4 Text1 Text2
KillSnapServer PressedButton DefaultScanner AssignScanner
Text3 StopScan SetCurrentScannerIndex GetFaceImageDuplex
GetCurrentScannerIndex ReleaseScanner GetTwainScanner SetTwainScanner
GetFirstTwainSource GetNextTwainSource NameLast2 DatesFormat
UseFixedModel NameLast1 getPassportFaceAndSignatureImagesOnly ActivateOnServer
GetFaceAndSignatureImagesOnly getPassportSignature
isActivated

Returns the Address value in string format (read-only)

Syntax

Address As String

Parameters

None

Return Values

Returns the Address value

Returns the Address2 value in string format (read-only)

Syntax

Address2 As String

Parameters

None

Return Values

Returns the Address2 value

Returns the Address3 value in string format (read-only)

Syntax

Address3 As String

Parameters

None

Return Values

Returns the Address3 value

Returns the Address4 value in string format (read-only)

Syntax

Address4 As String

Parameters

None

Return Values

Returns the Address4 value

Returns the Address5 value in string format (read-only)

Syntax

Address5 As String

Parameters

None

Return Values

Returns the Address5 value

Returns the Address6 value in string format (read-only)

Syntax

Address6 As String

Parameters

None

Return Values

Returns the Address6 value

Returns the Audit value as a string (read-only)

Syntax

Audit As String

Parameters

None

Return Values

Returns the Audit value

Automatically detects the state type according to the image. If the function returns with no error values, then the return value is the state ID. This value can be assigned to the IdState input parameter in the ProcState function for data extraction.

Syntax

AutoDetectState(Reserved As String) As Long

Parameters

Parameter Description
[in] Reserved Null-terminated empty string

Return Values

Value Description
LICENSE_INVALID License invalid; all scanner operations disabled
LICENSE_EXPIRED License expired; all scanner operations disabled
INVALID_INTERNAL_IMAGE No internal image loaded; must scan an image first
ID_ERR_STATE_NOT_SUPPORTED License image does not match any state template
ID_ERR_STATE_NOT_RECOGNIZED License image does not match any state template

Automatically aligns the internal image horizontally and then detects the angle of rotation.

If the function returns with none of the above error values, then the return value is the state ID. This value can be assigned to the IdState input parameter in the ProcState function for data extraction. You can dump the rotated image from the internal buffer to a file using the RotateImage function.

Syntax

AutoDetectStateEx(Reserved As String, angle As Long) As Long

Parameters

Parameter Description
[in] Reserved Null-terminated empty string
[out] Angle Returns the number of clockwise 90 degree turns that the image was rotated to be aligned horizontally

Return Values

Value Description
LICENSE_INVALID License invalid; all scanner operations disabled
ID_ERR_USA_TEMPLATES_ NOT_FOUND Template database UsaIds.bin file for U.S. missing from the SDK files location
INVALID_INTERNAL_IMAGE No internal image loaded; must scan an image first
ID_ERR_STATE_NOT_SUPPORTED License image does not match any state template
ID_ERR_STATE_NOT_RECOGNIZED License image does not match any state template

Calibrates the scanner using the calibration card (similar to the CalibrateScanner function described in the ScanW_Library.pdf document) but this function will display the calibration progress bar dialog. 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.

The CalibrateScanner may store one of the following values:

Value Description
SLIB_TRUE Operation succeeded
SLIB_FALSE Operation failed (no calibration card was found)
SLIB_ERR_SCANNER_BUSSY Scanner still busy executing the previous scanner command
LICENSE_INVALID Library not initialized with proper license
SLIB_ERR_SCANNER_NOT_FOUND No attached scanner found
SLIB_ERR_INVALID_SCANNER Attached scanner invalid

Syntax

CalibrateScanner()

Parameters

None

Return Values

None

Calibrates the scanner using the calibration card (similar to the CalibrateScanner function) but this function will display the calibration progress bar dialog.

Syntax

CalibrateScannerEx()

Return Values

None

Returns or gets the Calibration Threshold value. This value will affect the Is Need Calibration function. (read/write)

Accepted values: 1 - 100, where 1 is the most sensitive and 100 is the least sensitive. (DEFAULT is 60)

Syntax

CalibrationThreshold As Integer

Parameters

None

Return Values

Returns the Calibration Threshold value

Returns the City value in string format (read-only)

Syntax

City As String

Parameters

None

Return Values

Returns the City value

Returns the Class value in string format (read-only)

Syntax

Class As String

Parameters

None

Return Values

Returns the Class value

Cleans the scanner lens by running the cleaning pad (supplied with the scanner kit) back and forth. This function applies only to scanner modules ScanShell 800/N.

Syntax

Clean()

Return Values

Value Description
SLIB_ERR_SCANNER_BUSY Scanner busy executing the previous scanner command

Combines two image files into a single image file. The function follows this sequence:

  1. Imports SourceImage0 to an image object 0.

  2. Rotates image object0 by Angle0.

  3. Imports SourceImage1 to an image object 1.

  4. Rotates image object1 by Angle1.

  5. Combines Image0 and Image1 one on top of each other (if CombType is equal to IMAGE_COMB_VERTICAL) or one to the left of the other (if CombType is equal to IMAGE_COMB_ HORIZONTAL).

  6. Saves the resulting image to an external file or to the clipboard.

    Note: This function only works on image files and not on the internal image.

Syntax

ConcatenateImage(SourceImage0 As String, Angle0 As Long, SourceImage1 As String, Angle1 As Long, CombType As Long, DestType As Long, DestImage As String)

Parameters

Parameter Description
[in] SourceImage0 Full path name of the first image.
[in] Angle0 Angle to rotate the SourceImage0 before the combination.
[in] SourceImage1 Full path name of the second image.
[in] Angle1 Angle to rotate SourceImage0 before the combination.
[in] CombType Location of the images in the result image file:
[in] DestType Destination of rotated image:
[in] DestImage Full path of the destination file; ignored if DestType is set to SAVE_TO_CLIPBOARD

Return Values

Value Description
IMG_ERR_SUCCESS Function succeeded
LICENSE_INVALID License invalid; library not initialized with proper license
IMG_ERR_BAD_ANGLE_0 Bad rotation parameter for Image0
IMG_ERR_BAD_ANGLE_1 Bad rotation parameter for Image1
IMG_ERR_FILE_OPEN_FIRST Can’t open SourceImage0 file
IMG_ERR_FILE_OPEN_SECOND Can’t open SourceImage1 file
IMG_ERR_BAD_DESTINATION Bad destination parameter (not file or clipboard)
IMG_ERR_COMB_TYPE Bad CombType value
IMG_ERR_FILE_SAVE_TO_CLIPBOARD Can’t save image to clipboard
IMG_ERR_FILE_SAVE_TO_FILE Can’t save destination file (bad destination path or disk error)

This function is a shorter version of the RotateImage**()** function. It takes an input file (if SourceImage is not empty) or uses the internal image as a source (if SourceImage is empty) and saves it to a file. Using different file extensions for the source and the destination converts the image type to the desired type.

Image type conversion must be done carefully because some color schemes are not supported in all file types. The following table shows the available destination types and the color schemes they are capable of storing:

Destination image extension Destination image type
Destination image extension True color (24-bit) 256 colors (8-bit) Grayscale (8-bit) Black & White (1-bit)
BMP √ √ √ √
TIF √ √ √
JPG √ √
PCX √ √ √
TGA √ √ √
PNG √ √ √
PSD √

Note: This table is applicable to all functions in this library.

Syntax

ConvertImage(SourceImage As String, DestImage As String) As Long

Parameters

Parameter Description
[in] SourceImage 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 Values

Value Description
IMG_ERR_SUCCESS Function succeeded
LICENSE_INVALID Library not initialized with proper license
IMG_ERR_BAD_DESTINATION Bad destination parameter (not file or clipboard)
IMG_ERR_FILE_OPEN Can’t open input file; SourceImage string is not empty but points to missing or invalid source image file
INVALID_INTERNAL_IMAGE No document scanned (internal image in the memory); SourceImage string empty
IMG_ERR_FILE_SAVE_TO_FILE Can’t save destination file; invalid destination file or disk save error

Returns the County value as a string (read-only)

Syntax

County As String

Parameters

None

Return Values

Returns a string with the County value

Returns the CSC value as a string (read-only)

Syntax

CSC As String

Parameters

None

Return Values

Returns a string with the CSC value

Returns the DateOfBirth value in string format (read-only)

Syntax

DateOfBirth As String

Parameters

None

Return Values

Returns the DateOfBirth value

Detects and processes a card with two sides that each of the sides can contain text and/or barcode data. After using this function, you can get the fields data from the idData and Barcode classes (using the ScanShell 3000D/ScanShell 800DX only). To use the internal image (after scanning a card), ImageA and ImageB should be empty strings.

Syntax

DetectProcessAndCompareEX(ImageA As String, ImageB As String, state As Integer, ImageA_assignment As Integer, angleA As Integer, angleB As Integer, reserved As Integer) As Long

Parameters

Parameter Description
[in] ImageA Full name of the source driver’s license image file (Side A)
[in] ImageB Full name of the source driver’s license image file (Side B)
[in] State StateID can be -1 for auto detect state
[in,out] ImageA_assignment
[in,out] angleA Contains the angle that has been used to rotate image A
[in,out] angleB Contains the angle that has been used to rotate image B
[in] reserved Use the value 0

Return Values

Value Description
stateID Function succeeded
-1 Function failed

Detects the front side and extracts the data from the two sides of a card. After using this function, you can get the fields value from the idData class (using ScanShell 3000D/ScanShell 800DX only). To use the internal image (after scanning a card), ImageA and ImageB should be empty strings.

Syntax

DetectProcessDuplexEx(ImageA As String, ImageB As String, state As Integer, ImageA_assignment As Integer, angleA As Integer, angleB As Integer, reserved As Integer) As Long

Parameters

Parameter Description
[in] ImageA Full name of the source driver’s license image file (Side A)
[in] ImageB Full name of the source driver’s license image file (Side B)
[in] State StateID can be -1 for auto detect state
[in,out] ImageA_assignment
[in,out] angleA Contains the angle that has been used to rotate image A
[in,out] angleB Contains the angle that has been used to rotate image B
[in] reserved Use the value 0

Return Values

Value Description
stateID Function succeeded
-1 Function failed

Activates the double-side scan when using the ScanShell 3000D | ScanShell 800DX | ScanShell 800DXN scanners

Syntax

Duplex As Integer

Parameters

None

Return Values

Returns the Duplex value

Returns the Endorsements value in string format (read-only)

Syntax

Endorsements As String

Parameters

None

Return Values

Returns the Endorsements value

Returns the ExpirationDate value in string format (read-only)

Syntax

ExpirationDate As String

Parameters

None

Return Values

Returns the ExpirationDate value

Extracts bulk text from an image (up to 4K (4096) characters)

Syntax

ExtractText(SourceImage As String, Type_ As Long) As Long

Parameters

Parameter Description
[in] SourceImage Full path name of the original image.
[in] Type_ Instructs the OCR what type of data is written in the image. This value increases the detection accuracy and speeds up the OCR operation. This value can be one of the following values:

Return Values

Value Description
TOCR_SUCCESS Function succeeded
LICENSE_INVALID License invalid; library not initialized with proper license
TOCRJOBERROR OCR engine unable to perform the detection process correctly
TOCR_BAD_TYPE Bad TextType value

Returns the Eyes value in string format (read-only)

Syntax

Eyes As String

Parameters

None

Return Values

Returns the Eyes value

Returns the Fee value as a string (read-only)

Syntax

Fee As String

Parameters

None

Return Values

Returns a string with the Fee value

Returns the getBCData1D value in string format (read-only)

Syntax

getBCData1D As String

Parameters

None

Return Values

Returns the getBCData1D value

Returns the getBCAddress value in string format (read-only)

Syntax

getBCAddress As String

Parameters

None

Return Values

Returns the getBCAddress value

Returns the getBCCity value in string format (read-only)

Syntax

getBCCity As String

Parameters

None

Return Values

Returns the getBCCity value

Returns the getBCClass value in string format (read-only)

Syntax

getBCClass As String

Parameters

None

Return Values

Returns the getBCClass value

Returns the getBCDateOfBirth value in string format (read-only)

Syntax

getBCDateOfBirth As String

Parameters

None

Return Values

Returns the getBCDateOfBirth value

Returns the getBCExpirationDate value in string format (read-only)

Syntax

getBCExpirationDate As String

Parameters

None

Return Values

Returns the getBCExpirationDate value

Returns the getBCIssueDate value in string format (read-only)

Syntax

getBCIssueDate As String

Parameters

None

Return Values

Returns the getBCIssueDate value

Returns the getBClicense value in string format (read-only)

Syntax

getBClicense As String

Parameters

None

Return Values

Returns the getBClicense value

Returns the getBCName in string format (read-only)

Syntax

getBCName As String

Parameters

None

Return Values

Returns the getBCName value

Returns the getBCNameFirst value in string format (read-only)

Syntax

getBCNameFirst As String

Parameters

None

Return Values

Returns the getBCNameFirst value

Returns the getBCNameLast value in string format (read-only)

Syntax

getBCNameLast As String

Parameters

None

Return Values

Returns the getBCNameLast value

Returns the getBCNameMiddle value in string format (read-only)

Syntax

getBCNameMiddle As String

Parameters

None

Return Values

Returns the getBCNameMiddle value

Returns the getBCNameSuffix value in string format (read-only)

Syntax

getBCNameSuffix As String

Parameters

None

Return Values

Returns the getBCNameSuffix value

Returns the getBCSex value in string format (read-only)

Syntax

getBCSex As String

Parameters

None

Return Values

Returns the getBCSex value

Returns the getBCSocialSecurity value as a string (read-only)

Syntax

getBCSocialSecurity As String

Parameters

None

Return Values

Returns the getBCSocialSecurity value

Returns the getBCState value in string format (read-only)

Syntax

getBCState As String

Parameters

None

Return Values

Returns the getBCState value

Returns the getBCZip value in string format (read-only)

Syntax

getBCZip As String

Parameters

None

Return Values

Returns the getBCZip value

Returns the getBCEndorsements value in string format (read-only)

Syntax

getBCEndorsements As String

Parameters

None

Return Values

Returns the getBCEndorsements value

Returns the getBCHair value in string format (read-only)

Syntax

getBCHair As String

Parameters

None

Return Values

Returns the getBCHair value

Returns the getBCEyes value in string format (read-only)

Syntax

getBCEyes As String

Parameters

None

Return Values

Returns the getBCEyes value

Returns the getBCHeight value in string format (read-only)

Syntax

getBCHeight As String

Parameters

None

Return Values

Returns the getBCHeight value

Returns the getBCWeight value in string format (read-only)

Syntax

getBCWeight As String

Parameters

None

Return Values

Returns the getBCWeight value

Returns the getBCAddress2 value in string format (read-only)

Syntax

getBCAddress2 As String

Parameters

None

Return Values

Returns the getBCAddress2 value

Returns the getBCCity value as a string (read-only)

Syntax

getBCCity As String

Parameters

None

Return Values

Returns a string with the getBCCity value

Returns the getBCState value in string format (read-only)

Syntax

getBCState As String

Parameters

None

Return Values

Returns the getBCState value

Returns the getBCZip2 value in string format (read-only)

Syntax

getBCZip2 As String

Parameters

None

Return Values

Returns the getBCZip2 value

Checks the detected data values and returns a value that indicates the detection accuracy (as a percentage value). This function, combined with the RotateImage() function, is useful when implementing the auto-orientation feature in the application. This feature can be implemented by rotating the internal image and for each new position, executing the ProcState() function. The operation success can be evaluated using GetDetectAcuracy() which allows us to determine if the image is in the right orientation or if a new rotation-detection-inspection is needed.

Syntax

GetDetectAcuracy() As Long

Parameters

None

Return Values

Returns a numeric value between 0–100 that represents an estimated percentage of the detection accuracy

Extracts the image rectangle of the person’s face from the source ID image. The source image can be either:

  • 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.

    Note: Use the proper file extension (for example, .bmp for bitmap, .jpg for Jpeg) to specify the image format.

Syntax

GetFaceImage(Source As String, Dest As String, idState As Long) As Long

Parameters

Parameter Description
[in] Source Null-terminated string that contains the full path of the scanned ID image. If this string is empty, then the internal image is used as the image source.
[in] Dest Null-terminated string that contains the full name of the destination image file that will contain the face image from the ID document.
[in] idState The state index value as defined in the idLibDef.bas file

Return Values

Value Description
ID_TRUE Function succeeded
LICENSE_INVALID Library not initialized with proper license
ID_ERR_FILE_OPEN Failed to load source image (if SourceFileName is not empty)
INVALID_INTERNAL_IMAGE No internal image loaded; attempted to use internal image without first scanning image
ID_ERR_STATE_ NOT_SUPPORTED Requested state not supported
ID_BAD_DESTINATION_FILE Bad destination path (couldn’t create the destination file)
ID_ERR_FILE_OPEN Bad source image file (used only when using a file as the source image); source file is missing or can’t 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); no image in buffer
ID_ERR_FACE_IMAGE_ NOT_FOUND Analyzer can’t detect the face image in the driver’s license image
ID_ERR_CANNOT_DELETE_ DESTINATION_IMAGE A file with the same name as the destination file already exists and can’t be overwritten
ID_ERR_CANNOT_COPY_ TO_DESTINATION Destination file can’t be opened for write on the disk

This function is similar to the GetFace function but can extract more than one face image from the card. The imageType value can be 0 to get the regular face image, or 1 to get face image with the background. This function with ImageType other than a 0 value, will work only for supported cards. For now only “Spain Police” cards are supported by this function.

Syntax

GetFaceImageEx(Source As String, Dest As String, idState As Long, ImageType As Long) As Long

Parameters

Parameter Description
[in] szSourceFile Full name of the source driver’s license image file
[in] szDestFile Full name of the destination face image
[in] stateID The state ID
[in] ImageType The face image type to extract

Return Values

Value Description
ID_TRUE Function completed successfully
ID_ERR_FILE_OPEN Unable to open input image file
INVALID_INTERNAL_IMAGE Invalid internal image file
ID_ERR_CANNOT_DELETE_DESTINATION_IMAGE Destination file already exists and can’t be overwritten
ID_ERR_CANNOT_COPY_TO_DESTINATION Unable to copy face image file to destination file

Extracts the face image from the document image to the given buffer. The source document image can be an existing image file (in BMP format) or the last scanned document (stored in the internal image buffer). If the SourceFile parameter is an empty string, then the image is taken from the internal image buffer. If this parameter contains the full name of a valid image file, then this file is used.

Syntax

GetFaceImageBuffer(sSource As String, pBuf As String, sFileType As String, nStateID as Long) As Long

Parameters

Parameter Description
[in] sSource Name of the source driver’s license image file
[in] pBuf A string buffer that contains the image content upon a successful return
[in] sFileType Sets the buffer image format. May be one of the following strings (case-insensitive): BMP | PNG | JPG | PCX | PSD | TGA | TIF
[in] nStateID The state ID

Return Values

Value Description
ID_TRUE Function succeeded
ID_FALSE Function failed

Extracts the face image from the document image to the given buffer. The source document image can be an existing image file (in BMP format) or the last scanned document (stored in the internal image buffer). If the SourceFile parameter is an empty string, then the image is taken from the internal image buffer. If this parameter contains the full name of a valid image file, then this file is used.

Syntax

GetFaceImageBufferDirect(sSource As String, sFileType As String, nStateID As Long) As String

Parameters

Parameter Description
[in] sSource Name of the source driver’s license image file
[in] sFileType Sets the buffer image format. May be one of the following strings (case-insensitive): BMP | PNG | JPG | PCX | PSD | TGA | TIF
[in] nStateID The state ID

Return Values

Returns the image buffer in string format

Gets the first country in the countries list. Combining this function with the function GetNextCountry lets you get the constant values of all supported countries. The countries’ constant values in the Region are not always consecutive and should be obtained using the GetNextCountry function.

Syntax

GetFirstCountry() As Integer

Parameters

None

Return Values

Returns the constant value of the first country in the countries list

Retrieves the first state constant in the country. The states constant values in the country are not always consecutive and should be obtained using the GetNextStateByCountry function.

Syntax

GetFirstStateByCountry(Country As Integer) As Integer

Parameters

Parameter Description
[in] country Constant value of the country

Return Values

Value Description
ID_ERR_NO_MATCH Bad country constant; otherwise, the returns the constant value of the first state in the country

Verifies the field value with its checksum digit on the MRZ line (where it was taken from)

Syntax

int GetIDFieldMRZChecksumVerified(nFieldIndex As Integer) As Integer

Parameters

Parameter Description
[in] nFieldIndex Constant value of the field

Return Values

Value Description
1 Verification success
0 Verification failed
-1 Not verified

Gets a copy of the internal image buffer. If successful, the function formats the image using the image format specified by the sFileType parameter and copies it to the pBuf. The application can dump content of pBuf to the hard drive as a binary file while assigning it a proper file extension, creating a standard image file.

Syntax

GetImageBufferData(sFileType As String, sBuffer As String) As Long

Parameters

Parameter Description
pBuf A string buffer that contains the image content upon successful return
sFileType Sets the buffer image format. May be one of the following strings (case insensitive): BMP | PNG | JPG | PCX | PSD | TIF | TGA

Return Values

Value Description
BAD_IMAGE_DUMP Function failed
INVALID_INTERNAL_IMAGE Can’t process image; internal image buffer is empty or invalid
IMG_ERR_SUCCESS Function processed successfully

Gets a copy of the internal image buffer. If successful, the function will format the image using the image format specified by the sFileType parameter. The application can dump the content of the return buffer data to the hard drive as a binary file while assigning it a proper file extension, creating a standard image file.

Syntax

GetImageBufferDataDirect(sFileType As String) As String

Parameters

Parameter Description
sFileType Sets the buffer image format. May be one of the following strings (case insensitive): BMP | PNG | JPG | PCX | PSD | TIF | TGA

Return Values

Returns a string buffer that contains the image content

Gets a copy of the internal image buffer. If successful, the function will format the image using the image format specified by the sFileType parameter and copies it to the pBuf. The application can dump content of pBuf to the hard drive as a binary file while assigning it a proper file extension, creating a standard image file.

Syntax

GetImageBufferDataBack(sFileType As String, sBuffer As String) As Long

Parameters

Parameter Description
pBuf A string buffer that contains the back image content upon successful return
sFileType Sets the buffer image format. May be one of the following strings (case insensitive): BMP | PNG | JPG | PCX | PSD | TIF | TGA

Return Values

Value Description
BAD_IMAGE_DUMP Failed to dump the Back image buffer; internal error
INVALID_INTERNAL_IMAGE Can’t process back image; internal image buffer is empty or invalid
IMG_ERR_SUCCESS Function processed successfully

Gets a copy of the internal image buffer. If successful, the function will format the image using the image format specified by the sFileType parameter and copies it to the pBuf. The application can dump content of pBuf to the hard drive as a binary file while assigning it a proper file extension, creating a standard image file.

Syntax

GetImageBufferDataBack(sFileType As String) As String

Parameters

Parameter Description
sFileType Sets the buffer image format. May be one of the following strings (case insensitive): BMP | PNG | JPG | PCX | PSD | TIF | TGA

Return Values

Returns a string buffer that contains the back image content

Finds the image dimension in pixels

Syntax

GetImageDimensions(fileName As String, Width As Long, Height As Long) As Long

Parameters

Parameter Description
[in] fileName Image file name (or empty string if referring to the internal image)
[in] Width Returns the width of the image (in pixels)
[in] Height Returns the height of the image (in pixels)

Return Values

Value Description
IMG_ERR_FILE_OPEN Failed to open input file
INVALID_INTERNAL_IMAGE Can’t process image; internal image buffer is empty or invalid
IMG_ERR_SUCCESS Function processed successfully

Finds the image color scheme and resolution. The color scheme may be set to one of the following:

Color scheme Image description
IMAGE_COLOR_TRUE A TRUE COLOR image (24-bit)
IMAGE_COLOR_256 Contains 256 colors
IMAGE_GRAY_256 Contains 256 gray colors
IMAGE_BW Contains black and white only

Syntax

GetImageProperties(fileName As String, Color As Long,
dpi As Long) As Long

Parameters

Parameter Description
[in] fileName Image file name (or empty string if referring to the internal image)
[out] Color Returns the image color scheme
[out] dpi Returns the image resolution in dots per inch (dpi)

Return Values

Value Description
IMG_ERR_FILE_OPEN Failed to open input file
INVALID_INTERNAL_IMAGE Can’t process image; internal image buffer is empty or invalid
IMG_ERR_SUCCESS Function processed successfully

Returns the getJpgQuality value in integer format (read-only)

Syntax

getJpgQuality() As Integer

Parameters

None

Return Values

Returns the getJpgQuality value

Returns the getMagAddress value in string format (read-only)

Syntax

getMagAddress() As String

Parameters

None

Return Values

Returns the getMagAddress value

Returns the getMagCity value in string format (read-only)

Syntax

getMagCity() As String

Parameters

None

Return Values

Returns the getMagAddress value

Returns the getMagClass in string format (read-only)

Syntax

getMagClass() As String

Parameters

None

Return Values

Returns the getMagClass value

Returns the getMagDateOfBirth in string format (read-only)

Syntax

getMagDateOfBirth() As String

Parameters

None

Return Values

Returns the getMagDateOfBirth value

Returns the getMagEndorsements in string format (read-only)

Syntax

getMagEndorsements() As String

Parameters

None

Return Values

Returns the getMagEndorsements value

Returns the getMagExpirationDate in string format (read-only)

Syntax

getMagExpirationDate() As String

Parameters

None

Return Values

Returns the getMagExpirationDate value

Returns the getMagEyes in string format (read-only)

Syntax

getMagEyes() As String

Parameters

None

Return Values

Returns the getMagEyes value

Returns the getMagHair in string format (read-only)

Syntax

getMagHair() As String

Parameters

None

Return Values

Returns the getMagHair value

Returns the getMagHair in string format (read-only)

Syntax

getMagHair() As String

Parameters

None

Return Values

Returns the getMagHair value

Returns the getMagHeight in string format (read-only)

Syntax

getMagHeight() As String

Parameters

None

Return Values

Returns the getMagHeight value

Returns the getMagIssueDate in string format (read-only)

Syntax

getMagIssueDate() As String

Parameters

None

Return Values

Returns the getMagIssueDate value

Returns the getMaglicense in string format (read-only)

Syntax

getMaglicense() As String

Parameters

None

Return Values

Returns the getMaglicense value

Returns the getMagNameFirst in string format (read-only)

Syntax

getMagNameFirst() As String

Parameters

None

Return Values

Returns the getMagNameFirst value

Returns the getMagNameLast in string format (read-only)

Syntax

getMagNameLast() As String

Parameters

None

Return Values

Returns the getMagNameLast value

Returns the getMagNameMiddle in string format (read-only)

Syntax

getMagNameMiddle() As String

Parameters

None

Return Values

Returns the getMagNameMiddle value

Returns the getMagNameSuffix in string format (read-only)

Syntax

getMagNameSuffix() As String

Parameters

None

Return Values

Returns the getMagNameSuffix value

Gets the data as retrieved from the magnetic reader device without further processing

Syntax

GetRawData(sData As String) As Long

Parameters

Parameter Description
[in] sData Null-terminated string that contains the raw data

Return Values

Value Description
MAG_ERR_NONE Data retrieved successfully
MAG_ERR_CARD_NOT-DETECTED Buffer is empty

Syntax

getMagRawData(sData As String) As Long

Parameters

None

Return Values

Returns the getMagRawData value

Returns the getMagRestriction in string format (read-only)

Syntax

getMagRestriction() As String

Parameters

None

Return Values

Returns the getMagRestriction value

Returns the getMagSex in string format (read-only)

Syntax

getMagSex() As String

Parameters

None

Return Values

Returns the getMagSex value

Returns the getMagState in string format (read-only)

Syntax

getMagState() As String

Parameters

None

Return Values

Returns the getMagState value

Returns the getMagWeight in string format (read-only)

Syntax

getMagWeight() As String

Parameters

None

Return Values

Returns the getMagWeight value

Returns the getMagZip in string format (read-only)

Syntax

getMagZip() As String

Parameters

None

Return Values

Returns the getMagZip value

Gets the next country in the country list. To get the countries list, call GetFirstCountry once to obtain the first country and then continuously call GetNextCountry until ID_ERR_NO_NEXT_COUNTRY is returned.

Syntax

GetNextCountry() As Integer

Parameters

None

Return Values

Value Description
ID_ERR_COUNTRY_NOT_INIT The GetFirstCntry function not previously called
ID_ERR_NO_MATCH List contains an internal error
ID_ERR_NO_NEXT_COUNTRY Last country in the list

Gets the next state in the list

Syntax

GetNextStateByCountry(Country As Integer) As Integer

Parameters

Parameter Description
[in] country Constant value of the country

Return Values

Value Description
ID_ERR_ NO_MATCH Bad country constant; otherwise, returns the constant value of the first state in the country
ID_ERR_COUNTRY_NOT_INIT GetFirstCountry function not previously called
ID_ERR_NO_NEXT_STATE Last state on the country state list

Extracts the image rectangle of the person’s face from the source passport image. Remember that the original scanned image must be rotated by 180 degrees (so it is aligned correctly) before this function is called. This function works properly only for 3”x5” images. The destination image is generated in bitmap format.

Syntax

getPassportFaceEx(srcFile As String, dstFile As String) As Long

Parameters

Parameter Description
[in] srcFile Full path and name of the passport source file
[in] dstFile Full path and name of the passport destination file

Return Values

Value Description
PASS_ERR_NONE Face extracted successfully
PASS_ERR_CANNOT_DELETE_ DESTINATION_IMAGE Returned when file with same name as destination file already exists and can’t be overwritten
PASS_ERR_CANNOT_COPY_ TO_DESTINATION Failed to copy the face image to the destination file
PASS_ERR_FACE_IMAGE_ NOT_FOUND Can’t locate the face image on the document

Returns the getPassportAddress2 value in string format (read-only)

Syntax

getPassportAddress2() As String

Parameters

None

Return Values

Returns the getPassportAddress2 value

Returns the getPassportAddress3 value in string format (read-only)

Syntax

getPassportAddress3() As String

Parameters

None

Return Values

Returns the getPassportAddress3 value

Returns the getPassportCountry value in string format (read-only)

Syntax

getPassportCountry() As String

Parameters

None

Return Values

Returns the getPassportCountry value

Returns the getPassportCountryLong value in string format (read-only)

Syntax

getPassportCountryLong() As String

Parameters

None

Return Values

Returns the getPassportCountryLong value

Returns the getPassportDateOfBirth value in string format (read-only)

Syntax

getPassportDateOfBirth() As String

Parameters

None

Return Values

Returns the getPassportDateOfBirth value

Returns the passport expiration date in string format (read-only)

Syntax

getPassportExpirationDate() As String

Parameters

None

Return Values

Returns the getPassportExpirationDate value

Extracts the image rectangle of the person’s face from the source passport image. Remember that the original scanned image must be rotated by 180 degrees (so it is aligned correctly) before this function is called. This function works properly only for 3”x5” images. The destination image is generated in BITMAP format.

Syntax

getPassportFace(Source As String) As Long

Parameters

Parameter Description
[in] DestFile Null-terminated string that contains the full name of the destination image file (which contains the face image from the passport)

Return Values

Value Description
PASS_ERR_NONE Function succeeded
LICENSE_INVALID License invalid; library not initialized with proper license
PASS_ERR_CANNOT_DELETE_ DESTINATION_IMAGE Returned when file with same name as destination file already exists and can’t be overwritten
PASS_ERR_CANNOT_COPY_ TO_DESTINATION Returned when destination file can’t be opened for write on the disk
PASS_ERR_FACE_IMAGE_ NOT_FOUND Could not retrieve the face image from the passport image

Extracts the image rectangle of the bearer’s face from the passport. Note that the original scanned image must be rotated by 180 degrees

Syntax

getPassportFace(Source As String) As Long

Parameters

Extracts the face image from the passport document image to the given buffer

The source document image can be an existing image file (in BMP format) or the last scanned document (stored in the internal image buffer). If the SourceFile parameter is an empty string, then the image is taken from the internal image buffer. If this parameter contains the full name of a valid image file, then this file is used.

Syntax

getPassportFaceImageBuffer(sSource As String, pBuf As String, sFileType As String) As Long

Parameters

Setting Description
[in] sSource Name of the source driver’s license image file
[in] pBuf A string buffer that contains the image content upon a successful return
[in] sFileType Sets the buffer image format. May be one of the following strings (case-insensitive): BMP | PNG | JPG | PCX | PSD | TGA | TIF
[in] nStateID The state ID

Return Values

Value Description
ID_TRUE Function succeeded
ID_FALSE Function failed

Returns the getPassportIssueDate in string format (read-only)

Syntax

getPassportIssueDate() As String

Parameters

None

Return Values

Returns the getPassportIssueDate value

Returns the NameFirst value in string format (read-only)

Syntax

getPassportNameFirst() As String

Parameters

None

Return Values

Returns the NameFirst value

Returns the NameLast value in string format (read-only)

Syntax

getPassportNameLast() As String

Parameters

None

Return Values

Returns the NameLast value

Returns the NameMiddle value in string format (read-only)

Syntax

getPassportNameMiddle() As String

Parameters

None

Return Values

Returns the NameMiddle value

Returns the getPassportNationality value in string format (read-only)

Syntax

getPassportNationality() As String

Parameters

None

Return Values

Returns the getPassportNationality value

Returns the getPassportNationalityLong value in string format (read-only)

Syntax

getPassportNationalityLong() As String

Parameters

None

Return Values

Returns the getPassportNationalityLong value

Returns the getPassportPassportNumber value in string format (read-only)

Syntax

getPassportPassportNumber() As String

Parameters

None

Return Values

Returns the getPassportPassportNumber value

Returns the getPassportPersonalNumber value in string format (read-only)

Syntax

getPassportPersonalNumber() As String

Parameters

None

Return Values

Returns the getPassportPersonalNumber value

Returns the getPassportSex value in string format (read-only)

Syntax

getPassportSex() As String

Parameters

None

Return Values

Returns the getPassportSex value

Returns the getPassportDateOfBirth4 value in string format (read-only)

Syntax

getPassportDateOfBirth4() As String

Parameters

None

Return Values

Returns the getPassportDateOfBirth4 value

Returns the getPassportExpirationDate4 value with a 4-digit year in string format (read-only)

Syntax

getPassportExpirationDate4() As String

Parameters

None

Return Values

Returns the getPassportExpirationDate4 value

Returns the getPassportIssueDate4 value with a 4-digit year in string format (read-only)

Syntax

getPassportIssueDate4() As String

Parameters

None

Return Values

Returns the getPassportIssueDate4 value

Verifies the field value with its checksum digit on the MRZ line (where it was taken from)

Syntax

GetPassportMRZChecksumVerified(nFieldIndex As Integer) As Integer

Parameters

Parameter Description
[in] FieldIndex Constant value of the field

Return Values

Value Description
1 Verification success
0 Verification failed
-1 Not verified

Returns the extracted text data in one bulk as detected by the barcode analyzer. The data is returned “as is” with no parsing or additional processing. This function is useful for retrieving data from general purpose barcode images.

Syntax

GetRawData(sBufData As String) As Long

Parameters

Parameter Description
[in] sBufData A string that contains the returned value

Return Values

None

Returns the extracted text data in one bulk as detected by the barcode analyzer. The data is returned “as is” with no parsing or additional processing. This function is useful for retrieving data from general purpose barcode images.

Syntax

GetRawDataDirect() As String

Parameters

Parameter Description
[in] sBufData A string that contains the returned value

Return Values

None

The AAMVA National standard defines 51-field types that might be encoded in the PDF417 barcode image. Each one of the fields may be retrieved from the image using the field index specified in GetImageBufferDataDirect. 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 Value parameter is set to an empty string. The maximum field size may be up to 60 characters long.

Note that the fields are populated differently in different states. For example, the field NAME is populated in field index BCF_NAME for an Alabama driver license, and the same field is populated in field index BCF_DRIVER_LAST_NAME for a Delaware driver license. The raw field ranges from BCF_NAME (0) to BCF_AKA_PREFIX (50).

In addition to the raw fields, the CBarCode offers an additional set of fields (ranging 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 burden from the developer of knowing the state type and the way the data is handled in this particular state.

Syntax

GetRawField(Index As Long, Value As String) As Long

Parameters

Parameter Description
[in] Index An Integer that contains the value of the requested field
[out] Value A String that contains the returned value indicated by Index

Return Values

Value Description
BC_ERR_NONE Function succeeded
BC_ERR_BAD_PARAM Function failed; value passed by Index is not a valid field index

Retrieves the scanner resolution settings and sets the scanned image resolution. The resolution value can be any integer in the range 50–600 (for 50-600 dpi). Trying to set a value outside this is rejected and the previous value is used. The internal image resolution can be modified after the scan using the ReformatImage() function. (read/write)

Syntax

getResolution() As Integer

Parameters

None

Return Values

Returns the getResolution value

Sets and retrieves the scan height (in 1/100 inch units). Range is 200–400 milli-inches. (read/write)

When using scanner models ScanShell 800xx/2000xx/3000xx, the scanner may also scan a document with an unknown size. In this mode, the scanner scans the document until it detects that the entire document has been fed into the scanner. Then the black borders of the image are automatically cropped and the resulting image is returned to the calling application. To trigger this feature, you must set both ScanHeight and ScanWidth properties to –1. When the scan completes, these properties will reflect the detected document size in milli-inches.

Note: If you use Auto-detect scan size*,* make sure to set ScanHeight and ScanWidth to –1 before each scan because these properties are overwritten automatically with the recently scanned document size.

Syntax

getScanHeight() As Integer

Parameters

None

Return Values

Returns the ScannerHeight value

Gets the scanned image color scheme. The internal image color scheme can be modified after the scan using the ReformatImage function. Available values are: BW | GRAY | TRUECOLOR (read/write)

Syntax

getScannerColorScheme() As Integer

Parameters

None

Return Values

None

Gets the CSSNLib version (read-only)

Syntax

getScanVersion() As Integer

Parameters

None

Return Values

Returns the ScanVersion value

Gets the scan width (in 1/100 inch units) in a range of 200-600 (read/write)

Syntax

getScanWidth() As Integer

Parameters

None

Return Values

Returns the ScanWidth value

Extracts the image rectangle of the person’s signature from the source ID image. The source image can be either:

  • Internal Image - The last scanned image (stored in the internal memory). Used only if 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 300 dpi. 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.

Syntax

GetSignImage(Source As String, Dest As String, idState As Long) As Long

Parameters

Parameter Description
[in] Source Null-terminated string that contains the full path of the scanned ID image. If empty, uses the internal image as the image source
[in] Dest Null-terminated string that contains the full name of the destination
[in] idState State index value as defined in idLibDef.bas file

Return Values

Value Description
ID_TRUE Function succeeded
ID_FALSE Function failed:

Returns the Hair value in string format (read-only)

Syntax

Hair As String

Parameters

None

Return Values

Returns the Hair value

Returns the Id value in string format (read-only)

Syntax

Id As String

Parameters

None

Return Values

Returns the Id value

Converts the country ID number to the country name

Syntax

Id2Country(ICountryId As Long, Country As String) As Long

Parameters

Parameter Description
[in] ICountryId The country ID number
[in] Country Country name

Return Values

Value Description
ID_TRUE Function succeeded
ID_ERR_NO_MATCH The value in id is not a valid country ID

Id2State

Converts the state ID to the state name. For example, passing Id2State 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.

Syntax

Id2State(Id As Long, State As String) As Long

Parameters

Parameter Description
[in] CountryId The country ID number

Return Values

Value Description
ID_TRUE Function succeeded
ID_ERR_NO_MATCH No state with that ID was found

Returns the full name of the country that issued the document (read-only)

Syntax

IdCountry As String

Parameters

None

Return Values

Returns the IdCountry value in string format

Returns the IdCountryShort value as a string (read-only)

Syntax

IdCountryShort As String

Parameters

None

Return Values

Returns a string with the IdCountryShort value

Returns the IdOriginal value as a string (read-only)

Syntax

IdOriginal As String

Parameters

None

Return Values

Returns a string with the IdOriginal value

Returns the IdWideCharactersvalue as a string (read-only)

Syntax

IdWideCharacters As String

Parameters

None

Return Values

Returns a string with the IdWideCharacters value

Returns the ImageColor value in Long format (read-only)

Syntax

ImageColor As Long

Parameters

None

Return Values

Returns the ImageColor value

Returns the ImageDPI value in Long format (read-only)

Syntax

ImageDPI As Long

Parameters

None

Return Values

Returns the ImageDPI value

Returns the ImageHeight in string format (read-only)

Syntax

IdWideCharacters As String

Parameters

None

Return Values

Returns the ImageHeight value

Returns the ImageWidth in string format (read-only)

Syntax

ImageWidth As String

Parameters

None

Return Values

Returns the ImageWidth value

Cleans random pixels from black and white images. Such noise may be shown when converting images with gradient color transition from color to black and white color. The higher the value set in maxBlobArea, the more details in the image will be considered.

Syntax

ImgDespeckle(ImgFile As String, maxBlobArea As Long) As Long

Parameters

Parameter Description
sImageFileType Source image file name or an empty string if referring to the internal image
maxBlobArea Maximum area size (in square pixels) of random pixels that will be considered as noise and will be removed from the image (DEFAULT is 30)

Return Values

Value Description
IMG_ERR_FILE_OPEN Failed to open input file specified by sImageFile
INVALID_INTERNAL_IMAGE Can’t process image; internal image buffer is empty or invalid
IMG_ERR_SUCCESS Function processed successfully

Initializes the CBarCode library

Note: This function must be called before calling any other function in the library.

Syntax

InitBarcodeLibrary(license As String) As Long

Parameters

Parameter Description
[in] license Null-terminated string that holds the license key value

Return Values

Value Description
LICENSE_VALID License is valid and library is ready to use
LICENSE_INVALID License invalid; all scanner operations disabled
LICENSE_EXPIRED License expired; all scanner operations disabled
LICENSE_DOES_NOT_MATCH_LIBRARY License invalid for this library; all library operations disabled
GENERAL_ERR_PLUG_NOT_FOUND Returned if the attached scanner is not one of the following: ScanShell 600 | ScanShell 800 | ScanShell 1000

Initializes the CImage library

Note: This function must be called before calling any other function in the library.

Syntax

InitCImageLibrary(license As String) As Long

Parameters

Parameter Description
[in] license Null-terminated string that holds the license key value

Return Values

Value Description
LICENSE_VALID License is valid and library is ready to use
LICENSE_INVALID License invalid; all scanner operations disabled
LICENSE_EXPIRED License expired; all scanner operations disabled
LICENSE_DOES_NOT_MATCH_LIBRARY License invalid for this library; all library operations disabled
GENERAL_ERR_PLUG_NOT_FOUND Returned if the attached scanner is not one of the following: ScanShell 600 | ScanShell 800XX | ScanShell 1000 | ScanShell 2000XX | ScanShell 4000 | ScanShell 5000
SLIB_LIBRARY_ALREADY_INITIALIZED Library already loaded; ignores InitCImageLibrary function call

Initializes the IdData library

Note: This function must be called before calling any other function in the library.

Syntax

InitIdDataLibrary(license As String) As Long

Parameters

Parameter Description
[in] license Null-terminated string that holds the license key value

Return Values

Value Description
LICENSE_VALID License is valid and library is ready to use
LICENSE_INVALID License invalid; all scanner operations disabled
LICENSE_EXPIRED License expired; all scanner operations disabled
LICENSE_DOES_NOT_MATCH_LIBRARY License invalid for this library; all library operations disabled
GENERAL_ERR_PLUG_NOT_FOUND Returned if the attached scanner is not one of the following: ScanShell 600 | ScanShell 800 | ScanShell 1000

Initializes the InitCOcr library

Note: This function must be called before calling any other function in the library.

Syntax

InitCOcrLibrary(license As String) As Long

Parameters

Parameter Description
[in] license Null-terminated string that holds the license key value

Return Values

Value Description
LICENSE_VALID License is valid and library is ready to use
LICENSE_INVALID License invalid; all scanner operations disabled
LICENSE_EXPIRED License expired; all scanner operations disabled
LICENSE_DOES_NOT_MATCH_LIBRARY License invalid for this library; all library operations disabled
GENERAL_ERR_PLUG_NOT_FOUND Returned if the attached scanner is not one of the following: ScanShell 600 | ScanShell 800 | ScanShell 1000

Initializes the InitMagLib library

Note: This function must be called before calling any other function in the library.

Syntax

InitMagLibLibrary(license As String) As Long

Parameters

Parameter Description
[in] license Null-terminated string that holds the license key value

Return Values

Value Description
LICENSE_VALID License is valid and library is ready to use
LICENSE_INVALID License invalid; all scanner operations disabled
LICENSE_EXPIRED License expired; all scanner operations disabled
LICENSE_DOES_NOT_MATCH_LIBRARY License invalid for this library; all library operations disabled
GENERAL_ERR_PLUG_NOT_FOUND Returned if the attached scanner is not one of the following: ScanShell 600 | ScanShell 800 | ScanShell 1000

Initializes the InitPassportLibrary library

Note: This function must be called before calling any other function in the library.

Syntax

InitPassportLibrary (license As String) As Long

Parameters

Parameter Description
[in] license Null-terminated string that holds the license key value

Return Values

Value Description
LICENSE_VALID License is valid and library is ready to use
LICENSE_INVALID License invalid; all scanner operations disabled
LICENSE_EXPIRED License expired; all scanner operations disabled
LICENSE_DOES_NOT_MATCH_LIBRARY License invalid for this library; all library operations disabled
GENERAL_ERR_PLUG_NOT_FOUND Returned if the attached scanner is not one of the following: ScanShell 600 | ScanShell 800 | ScanShell 1000

Initializes the InitSLibLibrary library

Note: This function must be called before calling any other function in the library.

Syntax

InitSLibLibrary(license As String) As Long

Parameters

Parameter Description
[in] license Null-terminated string that holds the license key value

Return Values

Value Description
LICENSE_VALID License is valid and library is ready to use
LICENSE_INVALID License invalid; all scanner operations disabled
LICENSE_EXPIRED License expired; all scanner operations disabled
LICENSE_DOES_NOT_MATCH_LIBRARY License invalid for this library; all library operations disabled
GENERAL_ERR_PLUG_NOT_FOUND Returned if the attached scanner is not one of the following: ScanShell 600 | ScanShell 800 | ScanShell 1000

Returns or gets the InOutScan value (read/write)

Setting this value causes the ScanShell 3000D/ScanShell 800DX/ScanShell 800DXN to eject the scanned document in an opposite direction to the scan feed direction. This option is used to scan documents that can’t be scanned in a feed-through manner, such as passports.

Syntax

InOutScan As Integer

Parameters

None

Return Values

Returns or gets the InOutScan value

Retrieves if the scanner needs to be calibrated. This should be tested before every scan. A non-calibrated scanner may generate images with incorrect colors. Read-only.

Syntax

IsNeedCalibration As Integer

Parameters

None

Return Values

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

Detects if the magnetic stripe reader is connected and functioning. The reader is searched for in the COM port which is found in the InitLibrary function.

Syntax

IsReaderValid() As Long

Parameters

None

Return Values

Value Description
MAG_ERR_NO_READER_FOUND Reader not connected to PC
MAG_ERR_NONE Reader connected to PC and functioning correctly

Detects if the scanner version is supported by the current code (read-only)

Syntax

IsScannerValid As Integer

Parameters

None

Return Values

Returns a non-zero value if the scanner version is supported and a zero value if the scanner version is supported

Returns the IssueDate value in string format (read-only)

Syntax

IssueDate As String

Parameters

None

Return Values

Returns the IssueDate value

Retrieves the preceding property/command setup. This property is equal to ELIB_ERR_NONE when no error occurred in the previous command execution. This property clears itself automatically to ELIB_ERR_NONE after reading. (read-only)

Syntax

LastErrorStatus As Integer

Parameters

None

Return Values

Returns the LastErrorStatus value

Returns the LastStateIndex value as an Integer

Syntax

LastStateIndex As Integer

Parameters

None

Return Values

Returns the LastStateIndex value

Returns the license value in string format

Syntax

license As String

Parameters

None

Return Values

Returns the license value

Returns the mText value in string format (read-only)

Syntax

mText As String

Parameters

None

Return Values

Returns the mText value

Returns the NameFirst value in string format

Syntax

NameFirst As String

Parameters

None

Return Values

Returns the NameFirst value

Returns the NameLast value in string format

Syntax

NameLast As String

Parameters

None

Return Values

Returns the NameLast value

Returns the NameMiddle value in string format

Syntax

NameMiddle As String

Parameters

None

Return Values

Returns the NameMiddle value

Returns the NameSuffix value in string format

Syntax

NameSuffix As String

Parameters

None

Return Values

Returns the NameSuffix value

Returns the NameFirst_NonMRZ value in string format

Syntax

NameFirst_NonMRZ As String

Parameters

None

Return Values

Returns the NameFirst_NonMRZ value

Returns the NameLast_NonMRZ value in string format

Syntax

NameLast_NonMRZ As String

Parameters

None

Return Values

Returns the NameLast_NonMRZ value

Returns the NameMiddle_NonMRZ value in string format

Syntax

NameMiddle_NonMRZ As String

Parameters

None

Return Values

Returns the NameMiddle_NonMRZ value

Returns the NameSuffix_NonMRZ value in string format

Syntax

NameSuffix_NonMRZ As String

Parameters

None

Return Values

Returns the NameSuffix_NonMRZ value

Detects whether a document is present in the scanner tray. This property is equal to 0 if no paper is detected in the tray or non-zero if paper is in the tray. (read-only)

Syntax

PaperInTray As Integer

Parameters

None

Return Values

Returns the PaperInTray value

Detects the data encapsulated in the 1D barcode. The function decodes the barcode and stores the data in the Data1D property. If the function failed to process the barcode, the content of the Data1D property is set to an empty string.

Syntax

ProcBarcode1DImage(ImageFile As String) As Long

Parameters

Parameter Description
[in] ImageFile Empty string Reserved

Return Values

Value Description
LICENSE_INVALID License invalid; library not initialized
SLIB_ERR_SCANNER_NOT_FOUND Scanner not connected to PC; all scanner operations disabled. Check the scanner connection and restart the function
SLIB_ERR_INVALID_SCANNER Attached scanner invalid
INVALID_INTERNAL_IMAGE No internal image loaded; must scan an image first
BC_ERR_NO_BC_FOUND Failed to find 1D barcode printing on the image
BC_ERR_NONE Barcode detected successfully

Processes the barcode image

Syntax

ProcBarcodeImage(ImageFile As String) As Long

Parameters

Parameter Description
[in] ImageFile Empty string Reserved

Return Values

Value Description
LICENSE_INVALID License invalid; library not initialized
SLIB_ERR_SCANNER_NOT_FOUND Scanner not connected to PC; all scanner operations disabled. Check the scanner connection and restart the function
SLIB_ERR_INVALID_SCANNER Attached scanner invalid
INVALID_INTERNAL_IMAGE No internal image loaded; must scan an image first
BC_ERR_NO_BC_FOUND Failed to find 1D barcode printing on the image
BC_ERR_NONE Barcode detected successfully

Processes 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 loads the library properties.

Syntax

processMag() As Long

Parameters

None

Return Values

Value Description
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; no further processing performed

Processes 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 loads the library properties.

Syntax

processMagEx(strData As String) As Long

Parameters

Parameter Description
[in] strData

Return Values

Value Description
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; no further processing performed

Processes the scanned passport image

Syntax

ProcessPassport(fileName As String) As Long

Processes the internal image acquired in the previous scan. The function deskews (straightens) and cleans the image and then passes it to the OCR for analysis. The resultant textual data is kept in internal structure ready for retrieval by the RefreshData 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 a tolerance of no more than ±10 degrees.

Syntax

ProcState(fileName As String, idState As Long) As Long

Parameters

Parameter Description
[in] fileName Null-terminated empty string Reserved
[in] idState Constant numeric value of the processed state ID

Return Values

Value Description
ID_TRUE Function succeeded
LICENSE_INVALID License invalid; library not initialized
SLIB_ERR_SCANNER_NOT_FOUND Scanner not connected to PC; all scanner operations disabled. Check the scanner connection. Restart the function
SLIB_ERR_INVALID_SCANNER Attached scanner invalid
ID_ERR_STATE_NOT_SUPORTED Requested state ID not supported
INVALID_INTERNAL_IMAGE No internal image loaded; must scan an image first

Modifies the image color scheme and resolution and saves 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 an unrecognizable extension due to an error (for example, TIF instead of TIFF), the function refers to the file as BITMAP.

Image reformatting can be done either on the image color scheme, on the image dpi, or both. Notice that changing the image format may lose the image color information (for example, when converting from 24-bit true color to 256 grayscale). Modifying an image format from 256 grayscale 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 using the 256 grayscale palette.

After the image is reformatted, it can be exported to an external image file. The destination file name may be one of the seven file formats indicated above. If the destination file name has an unrecognizable extension, the function exports to the file in a BITMAP format (the default format). If no destination image file name is provided (empty string), then the image is not saved.

Note: The 256-color scheme is not supported for JPG and TIFF files.

Syntax

ReformatImage(SourceImage As String, toColor As Integer, toDpi As Integer, DestImage As String)

Parameters

Parameter Description
[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 the following values:
[in] toDpi Sets the new image DPI (a value of 0 indicates no DPI modification)
[in] DestImage Full path name of the destination file (If an empty string, no save performed)

Return Values

Value Description
IMG_ERR_BAD_COLOR Bad toColor parameter value
IMG_ERR_BAD_DPI Bad toDpi parameter value
IMG_ERR_FILE_OPEN Can’t open input file. Returned if SourceImage string is not empty but points to a missing or invalid source image file
INVALID_INTERNAL_IMAGE Returned if SourceImage string is empty but no document was scanned (no internal image in memory)
IMG_ERR_FILE_SAVE_TO_FILE Can’t save destination file due to an invalid destination file or disk save error
IMG_ERR_SUCCESS Function processed successfully

Syntax

RefreshBarcodeData() As Long

Loads the library properties with the recently detected data. This function should normally be called after executing the ProcStatefunction.

Syntax

RefreshData() As Long

Parameters

None

Return Values

  • If the function returns a non-zero value, the data was retrieved successfully.
  • If the function returns a zero value, the data was not retrieved.

Loads the library properties with the recently detected data. This function should normally be called after executing the ProcStatefunction.

Syntax

RefreshDataAu() As Long

Parameters

None

Return Values

  • If the function returns a non-zero value, the data was retrieved successfully.
  • If the function returns a zero value, the data was not retrieved.

Detects whether a document of a specific state can be automatically detected by the AutoDetectStateEx function after scanning the document. If so, AutoDetectStateEx will return the proper state enum, and this value can be used as an input parameter to the ProcState function, which retrieves the data from the image.

Note: If RegionAutoDetectSupport returns ID_FALSE, then skip the call to AutoDetectStateEx and call ProcState directly, while setting the stateID parameter manually.

Syntax

RegionAutoDetectSupport(RegionId As Long) As Long

Parameters

Parameter Description
[in] RegionId The region enumeration value

Return Values

Value Description
ID_ERR_NO_MATCH The RegionId parameter does not contain a valid region enum.
ID_TRUE The RegionId parameter represents a region that supports autodetection.
ID_FALSE The RegionId parameter represents a region that does not support autodetection.

Detects the region that contains the country. For a complete list of the regions and their related states, see Appendix A.

Syntax

RegionByCountry(Country As Long) As Long

Parameters

Parameter Description
[in] Country Constant value of a country

Return values

Value Description
ID_ERR_NO_MATCH The Country parameter does not contain a valid country ID. Otherwise, this returns the region ID that contains the input country

Gets the value of the first region in the SDK region list. The SDK divides the supported countries into several major regions. The regions are organized in a list that can be retrieved by calling to this function once, and then continuously calling the RegionGetNext() function.

The list size and order may vary in the future, therefore, you should never fix the region values in your code and always retrieve it using the RegionGetFirst and RegionGetNext functions.

Note: Not all the regions currently support auto detection.

Syntax

RegionGetFirst As Long

Parameters

None

Return values

Returns the value of the first region in the SDK region list

Gets the list of countries in the region (when used with RegionGetNextCountry)

Syntax

RegionGetFirstCountry(IRegion As Long) As Long

Parameters

Parameter Description
[in] IRegion The region ID that contains the country list

Return Values

Value Description
ID_TRUE Function succeeded
ID_ERR_NO_MATCH The value in region is not a valid region ID. Otherwise, the function returns the first country ID in the region.

Converts region name values into the region ID

Syntax

RegionGetNameById(lRegionId As Long, sRegion As String) As Long

Parameters

Parameter Description
[in] IRegionId The region numeric value
[in] sRegion A string that accepts the region name

Return Values

Value Description
ID_TRUE Region found; RegionName string returns with region name
ID_ERR_NO_MATCH The RegionId parameter is not a valid region enumeration

Converts region ID values into the region name

Syntax

RegionGetNameById(lRegionId As Long, sRegion As String) As Long

Parameters

Parameter Description
[in] IRegionId The region numeric value
[in] sRegion A string that accepts the region name

Return Values

Value Description
ID_TRUE Region found; RegionName string returns with region name
ID_ERR_NO_MATCH The RegionId parameter is not a valid region enumeration

Retrieves the region list:

  1. Call the RegionGetFirstfunction once.
  2. Call RegionGetNext continuously in a loop until the ID_ERR_NO_NEXT_COUNTRY value is returned. For each call, the function returns the ID of the next region.

Syntax

RegionGetNextCountry(Region As Integer) As Long

Parameters

None

Return Values

Parameter Description
ID_ERR_NO_MATCH The RegionGetFirst function was never called before calling this function
ID_ERR_NO_NEXT_COUNTRY No next country in list; last call retrieved the last country in the list. Otherwise, the function returns 1, the value of the next region ID.

Combined with RegionGetFirstCountry), obtains the list of countries in the region

  1. Call RegionGetFirstCountryonce.
  2. Then call RegionGetNextCountry continuously in a loop and store the returned value until the ID_ERR_NO_NEXT_COUNTRY value is returned.
  3. Retrieve the full region list using RegionGetFirstand RegionGetNextfunctions.
  4. For each Region, retrieve the full countries list using RegionGetFirstCountryand RegionGetNextCountry functions.
  5. For each Country, retrieve the full state list using GetFirstStateByCountryand GetNextStateByCountryfunctions.

Syntax

RegionGetNextCountry(IRegionId As Long) As Long

Parameters

Parameter Description
[in] IRegionId The region ID that contains the country list

Return Values

Value Description
ID_TRUE Function succeeded
ID_ERR_NO_MATCH Value in region not a valid region ID. Otherwise, the function returns the next country ID in the region.
ID_ERR_NO_NEXT_COUNTRY No next country in list; last call retrieved the last country in the list

The AcuFill SDK can automatically detect the card type using the following steps:

  1. Set the region number.

  2. Run the AutoDetectStateEx function (as described in the ScanW_Library.pdf document) after scanning the image.

    Currently, the following regions support autodetection:

ID Region
0 USA (DEFAULT)
1 Canada
4 Australia
5 Asia

The autodetection will support additional regions in the upcoming versions. For a complete list of the regions and their related states, see Appendix A.

Note: Upon invocation of the library, the DEFAULT region is set to USA (Region Number 0).

Syntax

RegionSet(RegionId As Long) As Long

Parameters

Parameter Description
[in] RegionId The current region ID

Return Values

Value Description
ID_TRUE Region setting successful
ID_ERR_AUTO_DETECT_NOT_SUPPORTED The RegionId parameter doesn’t support auto detection
ID_ERR_NO_MATCH The RegionId parameter is not a valid region identifier

Returns the Restriction value in string format (read-only)

Syntax

Restriction As String

Parameters

None

Return Values

Returns the Restriction value

Rotates an image by 0, 90, 180, or 270 degrees and saves it to a file in one of 7 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 an unrecognizable extension due to an error (for example, TIF instead of TIFF), the function refers to the file as BITMAP.

After the image is rotated, it can be exported to either the clipboard or to an external image file. The destination file name may be one of the seven file formats indicated above. If an image has an unrecognizable extension due to an error (for example, TIF instead of TIFF), the function exports the file in a BITMAP format. The destination file name may be the same as the source file name. In such a case, the new file, resulting with a rotated image, will overwrite the original file. If no destination image file name is provided (empty string), then the image is not saved.

Note: Don’t be misled by the name of this function.

The RotateImage function’s flexibility actually allows you to do the following implicitly:

Function call Description
RotateImage (“xxx.bmp”, ANGLE_0, SAVE_TO_FILE, “xxx.jpg”) Converts an image file from one type to another
RotateImage (“xxx.bmp”, ANGLE_0, SAVE_TO_CLIPBOARD, “”) Copies an image file to the clipboard
RotateImage (“”, ANGLE_0, SAVE_TO_FILE, “”) Rotates the internal image
RotateImage (“”, ANGLE_0, SAVE_TO_FILE, “xxx.bmp”) Saves the internal image to a file

Syntax

RotateImage(SourceImage As String, Angle As Long, DestType As Long, DestImage As String)

Parameters

Parameter Description
[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 Angle to rotate original image:
[in] DestType Destination of the rotated image:
[in] DestImage Full path and 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 is performed.

Return Values

Value Description
IMG_ERR_SUCCESS Function succeeded
LICENSE_INVALID License invalid; library not initialized with proper license
IMG_ERR_BAD_ANGLE_0 Bad rotation parameter
IMG_ERR_BAD_DESTINATION Bad destination parameter (not file or clipboard)
IMG_ERR_FILE_OPEN Can’t open input file; SourceImage string is not empty but points to missing or invalid source image file
INVALID_INTERNAL_IMAGE No document scanned (internal image in the memory); SourceImage string empty
IMG_ERR_FILE_SAVE_ TO_CLIPBOARD Can’t save image to the clipboard due to error
IMG_ERR_FILE_SAVE_TO_FILE Can’t save destination file; invalid destination file or disk save error

Retrieves the scanner type (read-only)

Syntax

ScannerType As Integer

Parameters

None

Return Values

The scanner type can be one of these values:

Value Description Value Description
0 No scanner 15 ScanShell 800DXN
1 ScanShell 600 16 SnapShell (FDA)
2 ScanShell 800 17 SnapShell (WMD)
3 ScanShell 800N 18 SnapShell (TWN)
4 ScanShell 1000 19 CSSN_PASS (SnapShell - Passport camera)
5 ScanShell 2000 20 CSSN_RTE8K
6 ScanShell 2000N 21 CSSN_TWAIN_N
7 ScanShell 800E 22 CSSN_MAGTEK_STX
8 ScanShell 800EN 23 CSSN_CLBS
9 ScanShell 3000 24 CSSN_IP
10 ScanShell 4000 25 CSSN_1000N
11 ScanShell 800G 26 CSSN_3000DN
12 ScanShell 5000 27 CSSN_IC_SCAN
13 SnapShell (IDR) 28 CSSN_RTE9K
14 ScanShell 800DX 28 CSSN_RTE9K

Scan a document to the internal image buffer and, at the same time, export it to a bitmap file named “File Name” in the local disk. The operation result can be tested for good completion by reading the LastErrorStatus property.

Note: You must scan the image in true color and at 300 dpi for OCR recognition.

After the scan, the internal image can be further manipulated and exported using separate commands:

Command Description
RotateImage Rotate the internal image by 90, 180 or 270 degrees and/or modify the internal image resolution
ReformatImage Modify the internal image color to gray or black and white images
ConvertImage Save the internal image to an external file in one of the seven file formats

Syntax

ScanToFile(fileName As String) As Long

Parameters

Parameter Description
[in] fileName Null-terminated string that contains the full path of the scanned image

Return Values

Value Description
SLIB_ERR_NONE Function succeeded
SLIB_ERR_SCANNER_BUSSY Scanner busy executing the previous scanner command
SLIB_ERR_SCANNER_NOT_FOUND Scanner not connected to PC; all scanner operations disabled. Check the scanner connection and restart the function
SLIB_ERR_SCANNER_GENERAL_FAIL Scanner failed to start
SLIB_ERR_HARDWARE_ERROR Scanner hardware error
SLIB_ERR_PAPER_FED_ERROR Document not fed far enough in tray to create image file
SLIB_ERR_SCANABORT Scanning was aborted
SLIB_ERR_NO_PAPER Paper jammed while scanner was running
SLIB_ERR_PAPER_JAM Failed to create image file on disk
SLIB_ERR_FILE_IO_ERROR Not applicable
SLIB_ERR_PRINTER_PORT_USED Not enough memory to create temporary image
SLIB_ERR_OUT_OF_MEMORY Paper jammed while scanner was running

Scan a document to the internal image buffer and, at the same time, export it to a bitmap file named “File Name” in the local disk. The operation result can be tested for good completion by reading the LastErrorStatus property.

Note: You must scan the image in true color and at 300 dpi for OCR recognition.

After the scan, the internal image can be further manipulated and exported using separate commands:

Command Description
RotateImage Rotate the internal image by 90, 180 or 270 degrees and/or modify the internal image resolution
ReformatImage Modify the internal image color to gray or black and white images
ConvertImage Save the internal image to an external file in one of the seven file formats

Syntax

ScanToFileEx(fileName As String) As Long

Parameters

Parameter Description
[in] fileName Null-terminated string that contains the full path of the scanned image

Return Values

Value Description
SLIB_ERR_NONE Function succeeded
SLIB_ERR_SCANNER_BUSSY Scanner busy executing the previous scanner command
SLIB_ERR_SCANNER_NOT_FOUND Scanner not connected to PC; all scanner operations disabled. Check the scanner connection and restart the function
SLIB_ERR_SCANNER_GENERAL_FAIL Scanner failed to start
SLIB_ERR_HARDWARE_ERROR Scanner hardware error
SLIB_ERR_PAPER_FED_ERROR Document not fed far enough in tray to create image file
SLIB_ERR_SCANABORT Scanning was aborted
SLIB_ERR_NO_PAPER Paper jammed while scanner was running
SLIB_ERR_PAPER_JAM Failed to create image file on disk
SLIB_ERR_FILE_IO_ERROR Not applicable
SLIB_ERR_PRINTER_PORT_USED Not enough memory to create temporary image
SLIB_ERR_OUT_OF_MEMORY Paper jammed while scanner was running

Returns the setJpgQuality value in Integer format.

Syntax

setJpgQuality(JpgQuality As Integer)

Parameters

None

Return Values

Returns the setJpgQuality value

Syntax

setResolution(Resolution As Integer)

Syntax

setScanHeight(ScanHeight As Integer)

Syntax

setScannerColorScheme(ScannerColorScheme As Integer)

Syntax

setScanWidth(ScanWidth As Integer)

Returns the Sex value in string format (read-only)

Syntax

Sex() As String

Parameters

None

Return Values

Returns the Sex value

Returns the Side value in string format (read-only)

Syntax

Side()As String

Parameters

None

Return Values

Returns the Side value

Returns the SigNum value in string format (read-only)

Syntax

SigNum() As String

Parameters

None

Return Values

Returns the SigNum value

Returns the SocialSecurity value as a string (read-only)

Syntax

SocialSecurity() As String

Parameters

None

Return Values

Returns the SocialSecurity value

Returns the State value in string format (read-only)

Syntax

State() As String

Parameters

None

Return Values

Returns the State value

Converts a state name (string) to its equivalent ID value, even if the state is not supported by the library. For example, passing the StateName loaded with the string “California” will return the value 4. See Id2State()and LastStateIndexSyntaxfor more information.

Syntax

State2Id(State As String) As Long

Parameters

Parameter Description
[in] StateName String that contains the state name

Return Values

Value Description
StateId String that contains the state name
ID_ERR_NO_MATCH Not a valid region ID; otherwise, the function returns the next country ID in the region.

Indicates whether the ID image of a given state can be processed. Use this function to detect what states the library currently supports.

Syntax

StateIsSupported(idState As Long) As Long

Parameters

Parameter Description
[in] idState Integer that contains the state ID

Return Values

Value Description
ID_TRUE State is supported and can be detected by library
LICENSE_INVALID Library not initialized with proper license
ID_ERR_STATE_NOT_SUPORTED State not supported

Stamps text on the horizontal center of the image and the vertical location specified. The vertical alignment of the text is set by the vertLocation parameter as follows:

IMAGE_TOP Prints the text on the upper portion of the image
IMAGE_MIDDLE Prints the text on the middle portion of the image
IMAGE_BOTTOM Prints the text on the bottom portion of the image

Syntax

textStampOnImg(srcFile As String, text As String, textHeight As Long, vertLocation As Long, textColor As Long, dstFile As String) As Long

Parameters

Parameter Description
[in] srcFile Full path name of the original image file. If this string is empty, the rotation is performed on the internal image.
[in] text Text to print on the image
[in] textHeight Height of the text, in pixels
[in] vertLocation Location of the text in the image (top, middle, bottom).
[in] textColor
[in] dstFile

Return Values

Value Description
IMG_ERR_SUCCESS Function succeeded
INVALID_INTERNAL_IMAGE Can’t process image; internal image buffer is empty or invalid
IMG_ERR_BAD_PARAM Bad vertical location parameter
IMG_ERR_FILE_OPEN Can’t open input file

Stamps text on an image in the location specified by horizontalPos and verticalPos

Syntax

TextStampOnImgEx(sourceFile As String, Text As String, color As Long, opacity As Long, verticalPos As Long, horizontalPos As Long, fontName As String, fontSize As Long, bold As Long, bUnderline As Long)

Parameters

Parameter Description
image Source image file name (or empty string if referring to the internal image)
txt Text to print on the image
color Color of the text (RGB)
Opacity Opacity value of the text color
vertPos Location of the text in the image
horizontalPos Location of the text in the image
fontName Name of the font
fontSize Size of the font
bold Indicates whether to use boldface
bUnderline Indicates whether to use underline

Return Values

None

Returns the Type_ value in string format

Syntax

Type_ As String

Parameters

None

Return Values

Returns the Type_ value

Syntax

unInit() As Long

Returns the Version value in string format (read-only)

Syntax

Version As String

Parameters

None

Return Values

Returns the Version value

Syntax

VersionCImage()

Syntax

VersionCOcr() As String

Syntax

VersionIdData() As String

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 PC), the function returns one of the other values.

Syntax

WasCardSweeped() As Long

Parameters

None

Return Values

Value Description
MAG_ERR_NO_READER_FOUND Reader is not connected to the PC
SERIAL_NOT_INIT Serial port 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 detected from last call to this function
MAG_ERR_CARD_DETECTED Recent card swipe detected and data available for processing

Returns the Weight value in string format (read-only)

Syntax

Weight() As String

Parameters

None

Return Values

Returns the Weight value

Returns the Zip value in string format (read-only)

Syntax

Zip() As String

Parameters

None

Return Values

Returns the Zip value

Syntax

idProcMRZ(FileName As String, rotationAngle As Long) As Long

Clears data from all the fields in the idData class

Syntax

ResetIDFields()

Parameters

None

Return Values

None

Clears data from all the fields in the passport class

Syntax

ResetPassportData()

Parameters

None

Return Values

None

Syntax

DateOfBirth4() As String

Syntax

ExpirationDate4() As String

Syntax

IssueDate4() As String

Syntax

ReleasePort()

Gets the country by a given StateID

Syntax

GetCountryIDByStateID(StateID As Integer) As Long

Parameters

Parameter Description
[in] StateID Constant value of the StateId

Return Values

Value Description
Constant value Country ID
ID_ERR_NO_MATCH Bad state constant

Stops and closes the SnapServer service that is used for the SnapShell camera.

Note: Call this function only after all the commands are done to close the application. This is the last function you should call when closing the application.

Syntax

KillSnapServer()

Parameters

None

Return Values

None

Returns the button number that was pressed (valid only when using ScanShell 1000 scanner model) (read-only) Reads this value after reading the property PaperInTray (that indicates that one of the three buttons of the scanner was pressed) to retrieve which button was pressed:

  • TOP_BUTTON

    TOP_BUTTON

  • MIDDLE_BUTTON

  • BUTTOM_ BUTTON

Syntax

PressedButton As Integer

Parameters

None

Return Values

Returns the number of the pressed button:

Value Description
1 Top button
3 Middle button
2 Bottom button

Returns the Text1 value as a string (read-only)

Syntax

Text1 As String

Parameters

None

Return Values

Returns the Text1 value

Returns the Text2 value as a string (read-only)

Syntax

Text2 As String

Parameters

None

Return Values

Returns the Text2 value

Returns the Text3 value as a string (read-only)

Syntax

Text3 As String

Parameters

None

Return Values

Returns the Text3 value

Stops the current scan process

Syntax

StopScan()

Parameters

None

Return Values

None

Sets the default scanner type (loads the SDK faster) (Write-only)

Syntax

DefaultScanner As Integer

Parameters

None

Return Values

Returns the DefaultScanner value

Use a loop to call this function to get all the SnapShell devices and save it in a local array to call each SnapShell device later in your application

Syntax

AssignScanner(ScannerIndex As Integer)

Parameters

Parameter Description
[in] Use -1 to get the USB port number of the next SnapShell camera

Return Values

The USB port number to which the SnapShell device is connected

Gets the active SnapShell device USB port

Syntax

GetCurrentScannerIndex()

Parameters

None

Return Values

Returns the active USB port number of the current active SnapShell device

Use a loop to call this function to release each SnapShell device or use the KillSnapServerfunction to release all the SnapShell devices at once.

Syntax

ReleaseScanner(ScannerIndex As Integer)

Parameters

Parameter Description
[in] Use -1 to release all SnapShell cameras

Return Values

None

Sets the active SnapShell device to a specific USB port

Syntax

SetCurrentScannerIndex(ScannerIndex As Integer)

Parameters

Parameter Description
[in] SnapShell device index as returned by the AssignScannerfunction

Return Values

None

Gets the face image without knowing whether it is located (on front or back)

Note: Duplex scanning is only available with ScanShell 800DX/800DXN/3100D/3100DN.

Use this function to extract the image rectangle of the person’s face from the source ID image. The source image can be either:

  • Internal Image - The last scanned image (stored in the internal memory). This image will be used only if the Source string is empty.

  • External Image File - The full file name is given in Source 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.

    Note: Use the proper file extension (for example, .bmp for bitmap, .jpg for Jpeg) to specify the image format.

Syntax

GetFaceImageDuplex(Source As String, BackSource As String, Dest As String, idState As Integer) As Long

Parameters

Parameter Description
[in] Source Null-terminated string that contains the full path of the scanned ID image. If this string is empty, then the internal image is used as the image source.
[in] BackSource Null-terminated string that contains the full path of the scanned back side ID image. If this string is empty the internal image is used as the image source.
[in] Dest Null-terminated string that contains the full name of the destination image file that will contain the face image from the ID document.
[in] idState The state index value as defined in the idLibDef.bas file

Return Values

Value Description
ID_TRUE Function succeeded
ID_FALSE Internal processing error

Detects and gets the first TWAIN scanner that connects to your system

  • If this function returns SLIB_ERR_NO_NEXT_VALUE, then no more TWAIN scanners have been detected.
  • If the return value is SLIB_TRUE, then there are more TWAIN scanners found and you can call the GetNextTwainSourcefunction to get the entire TWAIN scanners list.

Syntax

GetFirstTwainSource(ScannerName As String)

Parameters

Parameter Description
[In-out] ScannerName Gets the first TWAIN scanner name that is found

Return Values

Value Description
SLIB_TRUE Successfully completed
SLIB_FALSE Function failed to find scanner
SLIB_ERR_NO_NEXT_VALUE No more TWAIN scanners found
SLIB_ERR_NO_TWAIN_INSTALLED No TWAIN devices found

Detects and gets the next TWAIN scanner that connects to your system

  • If this function returns SLIB_ERR_NO_NEXT_VALUE, then no more TWAIN scanners have been detected.
  • If the return value is SLIB_TRUE, then there are more TWAIN scanners found and you can call the GetNextTwainSource function again to get the entire TWAIN scanners list.

Syntax

GetNextTwainSource(ScannerName As String)

Parameters

Parameter Description
[In-out] ScannerName Gets the next TWAIN scanner name that is found

Return Values

Value Description
SLIB_TRUE Successfully completed
SLIB_ERR_NO_NEXT_VALUE No more TWAIN scanners found

Gets the current TWAIN scanner that is connected to your system

Syntax

GetTwainScanner(ScannerName As String)

Parameters

Parameter Description
[In-out] ScannerName Gets the current connected TWAIN scanner name that is found

Return Values

Value Description
SLIB_TRUE Successfully completed
SLIB_ERR_NO_NEXT_VALUE No more TWAIN scanners found

Sets the current TWAIN scanner that is connected to your system

Note: Use this function before you initialize the library.

Syntax

SetTwainScanner(ScannerName As String)

Parameters

Parameter Description
[In] ScannerName String that contains the scanner name

Return Values

Value Description
SLIB_TRUE Successfully completed
SLIB_FALSE Failed to find a scanner

Sets the UseFixedModel value (Write)

Note: Setting this value will set the AcuFill SDK to work only with the given scanner type.

Syntax

UseFixedModel As Integer

Parameters

None

Return Values

Returns the UseFixedModel value

Returns the current date format (read/write)

Syntax

DatesFormat As Integer

Parameters

None

Return Values

Value Description
EXTRACT_DATE_FORMAT_NONE 0 (Use the default date extraction)
EXTRACT_DATE_FORMAT_MDY 1 (mm-dd-yy)
EXTRACT_DATE_FORMAT_DMY 2 (dd-mm-yy)
EXTRACT_DATE_FORMAT_YMD 3 (yy-mm-dd)
EXTRACT_DATE_FORMAT_YDM 4 (yy-dd-mm)

Extracts the face and signature images (similar to the GetFace function). The imageType value can be 0 to get the regular face image, or 1 to get face image with the background. This function with ImageType other than a 0 value, will work only for supported cards. Currently only “Spain Police” cards are supported by this function.

Syntax

GetFaceAndSignatureImagesOnly(Source As String, FaceDest As String, SignatureDest As String, idState As Long, ImageType As Long) As Long

Parameters

Value Description
[in] SourceFile Full name of the source driver’s license image file
[in] FaceDest Full name of the destination face image
[in] SignatureDest Full name of the destination signature image
[in] idState The state ID
[in] ImageType The face image type to extract

Return Values

Value Description
ID_ERR_FILE_OPEN Can’t open input image file
INVALID_INTERNAL_IMAGE Invalid internal image file
ID_FALSE Image processing failed
ID_ERR_CANNOT_DELETE_ DESTINATION_IMAGE Destination file already exists and can’t be overwritten

Extracts the signature image from an existing passport image. The source image must be 3”x 5”, 300 dpi, and true color (24-bit)

Syntax

getPassportSignature(srcFile As String, dstFile As String) As Long

Parameters

Value Description
[in] srcFile Full file path and name of the passport source file
[in] dstFile Full file path and name of the signature destination file

Return Values

Value Description
PASS_ERR_NONE Function completed successfully
PASS_ERR_CANNOT_DELETE_ DESTINATION_IMAGE File with same name as destination file already exists and can’t be overwritten
PASS_ERR_CANNOT_COPY_ TO_DESTINATION Failed to copy the signature image to the destination file
PASS_ERR_FACE_IMAGE_ NOT_FOUND Can’t locate the signature image on the document

Extracts the face and signature images (similar to GetFaceEx) from a passport image

Syntax

getPassportFaceAndSignatureImagesOnly(srcFile As String, FaceDest As String, SignatureDest As String) As Long

Parameters

Value Description
[in] srcFile Full name of the source passport image file
[in] FaceDest Full name of the face image destination file
[in] SignatureDest Full name of the signature image destination file

Return Values

Value Description
PASS_ERR_FILE_OPEN Can’t open input image file
INVALID_INTERNAL_IMAGE Invalid internal image file
PASS_ERR_CANNOT_DELETE_ DESTINATION_IMAGE File with same name as destination file already exists and can’t be overwritten
PASS_ERR_CANNOT_COPY_TO_DESTINATION Failed to copy the face image to the destination file
PASS_ERR_FACE_IMAGE_NOT_FOUND Can’t locate the face image on the document
PASS_ERR_NONE Function completed successfully

Activates the SDK. The PC must be connected to the Internet to complete this function successfully. After the operation succeeds, the SDK can be used with any TWAIN scanner.

Note: After the SDK is activated successfully, it does not require the PC to be connected to the Internet.

Syntax

ActivateOnServer(strActivationCode As String) As Long

Parameters

Value Description
strActivationCode A 16-character string that grants the SDK activation on a single PC

Return Values

None

Determines if the SDK is activated on the local PC

Syntax

IsActivated() As Long

Parameters

None

Return Values

Value Description
ACTIVE_ERR_FAIL (1) SDK is not activated
ACTIVE_ERR_NONE (1) SDK is activated