ZKFinger Reader SDK For JAVA - en - V2
ZKFinger Reader SDK For JAVA - en - V2
for Java
Version: 2.0
—————————————————————————————————
Date: Sep 2016
Revision Records
Privacy Policy
No part of this document may be reproduced or transmitted in any form or by any means
without prior written consent of ZKTeco. The product described in this manual may include
copyrighted software of ZKTeco and possible licensors. Customers shall not reproduce,
distribute, modify, decompile, disassemble, decrypt, extract, reverse engineer, lease, assign, or
sublicense the said software in any manner, unless such restrictions are prohibited by
applicable laws or such actions are approved by respective copyright holders under license.
Usage Description
As functions of the ZKFinger SDK software are constantly expanded, ZKFinger SDK
documentations will be upgrading. Therefore, please read ZKFinger SDK documents
carefully when using the ZKFinger SDK software. We apologize for any inconvenience
caused by the preceding reasons. You can also contact the authors of the documentations.
Thank you.
Step 2: Copy ZKFingerReader.jar, right-click the lib directory and choose Paste to copy
ZKFingerReader.jar into the lib directory.
3.1 FingerprintSensor.class
FingerprintSensor.class is a class for controlling fingerprint readers, which can be used to start
and shut down a fingerprint reader, verify and identify.
3.1.1 Init
[Function]
public static int Init ()
[Purpose]
This function is used to Initialize resource.
[Parameter Description]
[Return Value]
0 Succeeded
Others See the error code description.
[Note]
[Function]
public static int Terminate ()
[Purpose]
This function is used to release resource.
[Parameter Description]
[Return Value]
0 Succeeded
Others See the error code description.
[Note]
3.1.3 OpenDevice
[Function]
public static long OpenDevice (int index)
[Purpose]
This function is used to connect to a device.
[Parameter Description]
index
Device index number. The value is determined based on the total number of
connected fingerprint readers.
Example:
When a total of one fingerprint reader is connected, the index is 0.
When a total of two fingerprint readers are connected, the index is 0 or 1.
…
[Return Value]
0 fail
Device handle success
[Note]
[Function]
public static int CloseDevice(long devHandle)
[Purpose]
This function is used to connect to a device.
[Parameter Description]
devHandle
Device Handle
[Return Value]
0 Succeeded
Others See the error code description.
[Note]
3.1.5 SetParameters
[Function]
public static int SetParameters(long devHandle, int code, byte[]
paramValue, int size)
[Purpose]
This function is used to set a parameter.
[Parameter Description]
devHandle
Device handle
code
Parameter code (See the Appendixes.)
paramValue
Parameter value
size
Parameter data length
[Return Value]
0 Succeeded
Others See the error code description.
[Note]
[Example]
byte[] value = new byte[4];
3.1.6 GetParameters
[Function]
public static int GetParameters(long devHandle, int code, byte[]
paramValue, int[] size)
[Purpose]
This function is used to acquire a parameter.
[Parameter Description]
devHandle
Device handle
code
Parameter code (See the Appendixes.)
paramValue
Parameter value
size
Parameter data length
[Return Value]
0 Succeeded
Others See the error code description.
[Note]
[Example]
byte[] value = new byte[4];
int[] len = new int[1];
len[0] = 4;
int ret = GetParameter(1, value, len); //image width
if (0 == ret)
3.1.7 AcquireFingerprint
[Function]
public static int AcquireFingerprint(long devHandle, byte[] imgBuffer,
byte[] template, int[] size)
[Purpose]
This function is used to extract a fingerprint image and template .
[Parameter Description]
devHandle
Device handle
imgBuffer
Image data(width * height bytes)
template
Template data(2048 Bytes)
size
Length of the returned fingerprint template
[Return Value]
0 Succeeded
Others See the error code description.
[Note]
3.1.8 AcquireFingerprintImage
[Function]
public static int AcquireFingerprintImage(long devHandle, byte[]
imgBuffer)
[Purpose]
This function is used to extract a fingerprint image
3.1.9 DBInit
[Function]
public static long DBInit()
[Purpose]
This function is used to Initialize algorithm library.
[Parameter Description]
[Return Value]
Catch handle
[Note]
3.1.10 DBFree
[Function]
public static int DBFree(long dbHandle)
[Purpose]
This function is used to release algorithm library.
[Parameter Description]
dbHandle
Catch handle
[Return Value]
Catch handle success
0 fail
[Note]
[Function]
public int DBAdd(long dbHandle , int fid, byte[] regTemplate)
[Purpose]
This function is used to add a registered template to the memory.
[Parameter Description]
dbHandle
Catch handle
Fid
Fingerprint ID
regTemplate
Registered template
[Return Value]
0 Succeeded
Others See the error code description.
[Note]
3.1.12 DBDel
[Function]
public int DBDel (long dbHandle , int fid)
[Purpose]
This function is used to delete a registered template from the memory.
[Parameter Description]
dbHandle
Catch handle
Fid
Fingerprint ID
[Return Value]
0 Succeeded
Others See the error code description.
[Note]
[Function]
public int DBCount (long dbHandle )
[Purpose]
This function is used to acquire the number of fingerprint images in the memory.
[Parameter Description]
dbHandle
Catch handle
[Return Value]
>=0 Fingerprint template count
<0 See the error code description.
[Note]
3.1.14 DBMatch
[Function]
public int DBMatch(long dbHandle , byte[] temp1, byte[] temp2)
[Purpose]
This function is used to compare two fingerprint templates.
[Parameter Description]
dbHandle
Catch handle
temp1
Fingerprint template 1
temp2
Fingerprint template 2
[Return Value]
The comparison score is returned.
<0 See the error code description.
[Note]
[Function]
public int DBIdentify(long dbHandle , byte[] template, int[] fid, int[] socre)
[Purpose]
This function is used to conduct 1:N comparison.
[Parameter Description]
dbHandle
Catch handle
template
Fingerprint template
Fid
Returned fingerprint ID
Score
Returned comparison score
[Return Value]
0 Succeeded
Others See the error code description.
[Note]
3.1.16 DBMerge
[Function]
public int DBMerge(long dbHandle , byte[] temp1, byte[] temp2, byte[]
temp3, byte[] regTemp, int[] regTempLen)
[Purpose]
This function is used to combine registered fingerprint templates.
[Parameter Description]
dbHandle
Catch handle
temp1
Preregistered template 1
temp2
Preregistered template 2
temp3
3.1.17 ExtractFromImage
[Function]
public int ExtractFromImage(long dbHandle , String filePath, int DPI,
byte[] template, int[] size)
[Purpose]
This function is used to extract a fingerprint template from a BMP or JPG file.
[Parameter Description]
dbHandle
Catch handle
FilePath
Full path of a picture file
DPI
Image DPI
Template
Returned fingerprint template
Size
Length of the returned fingerprint template
[Return Value]
0 Succeeded
Others See the error code description.
[Note]
Only the SDK of the standard version supports this function.
[Function]
public static String BlobToBase64(byte[] buf, int cbBuf)
[Purpose]
This function is used to convert byte[] to Base64 string.
[Parameter Description]
buf
Blob data
cbBuf
Data length
[Return Value]
Base64 string
[Note]
3.1.19 Base64ToBlob
[Function]
public static int Base64ToBlob(String strBase64, byte[] buf, int cbBuf)
[Purpose]
This function is used to convert Base64 string to byte[]
[Parameter Description]
strBase64
Base64 string
buf
Returned blob data
cbBuf
The length of buf
[Return Value]
0 fail
the length of binary data success
0 Succeeded
1 Initialized
-1001 Failed
-3 No device connected
-5 Invalid parameter
-7 Invalid handle