Published using Google Docs
SDK 2.0 Technical Reference Manual (Release Version).docx
Updated automatically every 5 minutes

Plustek Inc.                                            

Subject:

SDK Technical Reference Manual

Part. No.

Rev.: 2.0.6

Project:

Model Name:

Page    of       

SDK

Technical

Reference Manual

Version:

2.0.6

Create:

2025/10/28


Content

1. Introduction        4

1.1 Installation        4

1.2 Windows Desktop SDK 2.0        6

1.3 Web Based SDK 2.0        7

1.4 Supported Scanners        7

1.5 Official Website Reference        7

2. LibFXScan SDK 2.0        8

2.1 Basic Knowledge        8

2.2 Demo UI Introduction        8

2.2.1 Set and Scan        9

2.2.2 Refresh        11

2.2.3 Command and Edit        11

2.2.4 FileList        14

2.2.5 RemoveFile        14

2.2.6 Calibration        15

2.2.7 ECO        17

2.2.8 PaperReady        18

2.2.9 EjectPaper        18

2.2.10 PaperStatus        19

2.3 Non-UI Introduction        19

2.3.1 ini File Setting        20

2.3.2 Scan        20

2.3.3 Calibrate        21

2.3.4 VTM300        22

2.4 API Introduction        24

2.4.1 Lib API        25

2.4.2 CallBack Function        32

2.4.3 AutoCaptureDemo        34

2.4.4 Helpful Tips        35

2.5 Command Introduction        35

2.5.1 Key and Value        35

2.5.2 Recognize Type        57

3. WebFXScan SDK 2.0        59

3.1 Basic Knowledge        59

3.2 Demo UI Introduction        61

3.2.1 Scan Page        61

3.2.2 ini File Setting        63

3.2.3 Change Command        64

3.3 API Introduction        65

3.3.1 Web API        65

3.3.2 Calibration        65

3.4 Command Introduction        66

3.5 Http/Https demo using IIS        67

3.5.1 IIS Installation & Setting        67

3.5.2 Save Path Setting        71

4. Support Reference        72

4.1  Basic Knowledge        73

4.1.1 General FAQ        73

4.1.2 IssueDetector Tool        79

4.2 Common Issue        83

4.2.1 Init Fail        83

4.2.2 Connection Error        83

4.2.3 No Device        83

4.2.4 OCR Mismatch        87

4.2.5 No Recognize Result        88

4.2.6 Visual Studio Debug        89

4.2.7 Can’t get RFID information of SecureScan X200        90

4.3 Return Message        91

4.3.1 Error Code        91

4.3.2 Event Code        101

4.3.3 Web2.0 Error/Event Code        102

4.3.4 IP Code        102

4.4 Register        108

4.4.1 License Key Registration        108

4.4.2 Register with Scanner Serial Number        118


1. Introduction

Plustek SDK is available in two versions, we shall walk you through how to use both SDKs step by step in this manual.

1.1 Installation

https://github.com/aviswpm/PlustekSDK

Important Note

Installation Steps


Silent Installation

If you need a silent installation version, please contact us to download the offline installation version SDK. The GitHub version does not support silent installation.

  1. Open the Offline SDK package, depending on which platform need install.

  1. Configuration setup.ini

  1. Run setup.exe

1.2 Windows Desktop SDK 2.0

The LibFXScan SDK provides a friendly integrated development environment for programmers.  It is available in C++, C#, VB and Java interfaces, with a demo application and corresponding source codes individually for each interface. Please refer to the following steps to demonstrate demo application flow:

1) Run SDK package LDSetup.exe to install WebFXScan server agent and SDK.

2) Connect to the scanner and run LibWFXDemo.exe. 

 


1.3 Web Based SDK 2.0

The WebFXScan uses the WebSocket to connect with Plustek scanners. Please refer to the following steps to demonstrate demo application flow:

1) Run SDK package LDSetup.exe to install WebFXScan server agent and SDK.

2) Connect to the scanner and run WebScan2.exe.

3) From the Web Client demo folder, open the index.html with Google Chrome or Microsoft Edge browser.

1.4 Supported Scanners

Plustek SDK supports various types of scanners such as ADF, flatbed, document, photo, card, passport scanner, etc. For more information on the supported scanner list, please open IssueDetector tool and then select DeviceList tab > ProductName.dat tab to check for it.

 

Please note that our SDK does not support switching between two SecureScan scanners.

1.5 Official Website Reference

For more online technical information please visit www.adview.com.tw and watch the introduction video on AVI Youtube.


2. LibFXScan SDK 2.0

2.1 Basic Knowledge

  1. Download the scanner driver from Plustek official website.

The scanner drivers of SecureScan X Series (except X200) are already included in the SDK Package. Please do NOT download and install.

For X200, RFID module driver:

https://plustek.com/us/products/customized-scan-modules/securescan-x200/support.php          

For Plustek Other Scanner driver:  

https://plustek.com/us/support/drivers-and-downloads.php

For VTM 300, please download the latest version V.4.0.1.X (or later).

https://plustek.com/us/products/customized-scan-modules/vtm300/support.php

  1. Install OCR engine package (Non-compulsory, according to the needs of recognize type)

  1. Download & install Microsoft Visual C++ Redistributable for Visual Studio 2015.

Microsoft Download Center:

https://support.microsoft.com/en-us/topic/the-latest-supported-visual-c-downloads-2647da03-1eea-4433-9aff-95f26a218cc0

or

For x86:

https://aka.ms/vs/16/release/vc_redist.x86.exe

For x64:

https://aka.ms/vs/16/release/vc_redist.x64.exe

  1. License Register (Please refer to Chapter 4.4 Register)

* LibFXScan SDK introduction video on AVI Youtube

 

2.2 Demo UI Introduction

Please build “LibWFXDemo.sln” and run the corresponding platform demo application.  

Java Demo execute command: (Only support in SDK 1.0)

2.2.1 Set and Scan

Starting from v1.1.17.22273, the demo program supports two operation methods (Dual Mode): synchronous operation and asynchronous operation. You can set the switching method in LibWebFxScan.ini. For the changes to take effect, you need to restart the LibWFXDemo.exe.

LibWebFxScan.ini Path :

If the version is earlier than v1.1.17.22273, the demo program only supports the asynchronous operation.

UseModeBlock

Operation Method

UseModeBlock=0

Asynchronous operation.

UseModeBlock=1 (Default)

Synchronous operation.

  1. Asynchronous Operation:

The callback event needs to be registered.  The asynchronous method is used to wait for the event to be reported from the bottom layer.

Please check the command string before clicking the Set button. If the set property is successful, you can see “Device Ready!” in the log message box.  

Make sure you wait for the set property success message to show up before you select the Scan button.

  1. Synchronous Operation:

Each scan is regarded as an independent single action, and the relevant information is obtained immediately after the scan completes.

After you click the Scan button, the scan will be immediately executed and the image file path, recognition result, exception error information and event error information are returned.

2.2.2 Refresh

To ensure the scanner is connected properly, please DO click the Refresh button every time when you have changed the scanner or re-plugging the scanner cable. The demo application will automatically record the last SET successful command in different scanners for each computer.

2.2.3 Command and Edit

If the scanner hasn't been set with the command before, the application will automatically set the default command for Set property; otherwise, the command will be set as the record of “the last set success”.

For the more detailed Command table definitions, please refer to  Chapter 2.5 Command Introduction.

Command.txt will save up to 5 commands which are set successfully. You can find Command.txt in : C:\ProgramData\Plustek\Modul_ID\Command.txt

ex: X-Cube = A65


The SDK demo comes with a Command Editor which can help you avoid manual typing errors.  You can use this editor interface to automatically generate commands with great ease and convenience. (Two Tabs: Normal and Other)

2.2.4 FileList

List all files under the path of the default temporary folder. %USERPROFILE%\AppData\Local\Temp\WebFXScan

2.2.5 RemoveFile

Remove file under the path of the default temporary folder.


2.2.6 Calibration

This SDK supports the calibration of SecureScan X-Mini and SecureScan X-Cube only.

Note:

  1. When running Calibrate, the Command cannot be set to uv or ir or other image related settings.
  2. Do remove the protective film on the calibration sheet before you execute the scanner calibration, as shown in the picture below; otherwise, the film will result in the calibration error.

  1. The calibration sheet  needs to be oriented with the lettering facing up, as shown in the picture below:

  1. The calibration process is only necessary when running the program on a new computer for the first time. It only needs to be calibrated once, and after that, no further calibration is required.

Steps:

  1. Place the calibration sheet on the scanner.
  2. Select Set and then select Calibrate (Asynchronous Mode) or select Calibrate (Synchronous Mode)
  3. If the calibration successfully completes, the message “Status:[WFX_Calibare Success]” will show up.

(ShadingG.SHD will be saved in C:\ProgramData\Plustek\Model_ID\)

2.2.7 ECO

Enter the time (minutes) to configure the device when to enter sleep mode. Enter the number 0 (zero) to turn off sleep mode.

Steps:

  1. Select the Set button. Proceed to Step 2 after the message “Device Ready!” shows up.
  2. Select ECO.
  3. Enter ECO time in the box and select Set.

Note:

Starting from v1.1.18.22495, the sleep mode is turned off by default.

To modify the default value of sleep mode, please go to the LibWebFxScan.ini under the release folder.

2.2.8 PaperReady

If the paper is detected, the message "Paper is ready!" appears; otherwise, the message "Paper is NOT ready" appears.

Steps:

  1. Select the Set button.  Proceed to Step 2 after the message “Device Ready!” shows up.
  2. Select PaperReady.

2.2.9 EjectPaper

Only applicable to VTM 300. VTM 300 will hold the paper in place when it finishes scanning until you choose the eject direction. Select the EjectPaper button to eject paper.

Steps:

  1. Select the Set button. Proceed to Step 2 after the message “Device Ready!” shows up.
  2. Select EjectPaper. The Back checkbox is unticked by default, and the scanned paper will be sent forward and then ejected out of the scanner. (If you want to return the paper back to you after it is scanned, please tick the Back checkbox. The paper will be moved backward to you after it is scanned.)

2.2.10 PaperStatus

Steps:

  1. Select “Set” button when it success
  2. Select PaperStatus

PaperStatus Result

Message

Success

"Status:[LibWFX_GetPaperStatus Success[LIBWFX_EVENT%d]]"

Fail

"Status:[LibWFX_GetPaperStatus Fail

[LIBWFX_ERRCODE%d][LIBWFX_EVENT%d]]"

2.3 Non-UI Introduction

Non-UI mode is an extended version based on UI mode. It is mainly provided for customers who do not need UI to operate, and it is done by commands directly.

The dll required for Non-UI mode is nearly the same as UI mode, except that the settings of WebScan.exe and LibWebFxScan.ini, those are added to support server-side operation.

There is AviScanCMD.exe in the release folder. The operation is the same as LibWFXDemo.exe, which can be used to duplicate the command and make sure the command function is normal.

2.3.1 ini File Setting

There is LibWebFxScan.ini in the release folder which is only for Non-UI mode.

[RemoteModeNetEnv]

IP=“127.0.0.1”                 

Port=625                        

Account=“admin“                 

Password=“admin“                          

[Style]        

UseModeRemote = 1

2.3.2 Scan

Steps:

  1. Open WebScan.exe

  1. Open AviScanCMD.exe and copy default command

path: C:\Program Files (x86)\Plustek\WebFXScan\AviScanCMD.exe

        

  1. Search ”cmd”, select “Command Prompt

  1. Enter command as follows

cd  exe file folder path

ex:cd C:\Program Files (x86)\Plustek\WebFXScan\

  1. Enter command as follows

exe file name  copied command(need to add \ in front of “)  log saving path

ex: AviScanCMD.exe {\"device-name\":\"A64\",\"source\":\"Camera\",\"recognize-type\":\"barcode\",\"barcode-type\":true}  D:\\123.txt

PS:Not support “autoscan”

  1.  Open the txt file to see the result

2.3.3 Calibrate

This SDK supports the calibration of SecureScan X-Mini and SecureScan X-Cube only.

Steps:

      1 ~ 4 Please refer to section 2.3.2 Scan.

  1. Enter command as follows:

exe file name  copied command(need to add \ in front of “)  log saving path

ex:AviScanCMD.exe{\"device-name\":\"A64\",\"source\":\"Camera\",\”calibrate\”:true}  D:\\123.txt

 

  1.  Open the txt file to see the result

2.3.4 VTM300

The following commands support only VTM300 with SDK v1.1.14.22074 and later versions. 

Non-UI Command Only for VTM300

Description

Command

Examples

Hold the paper in the output slot of the scanner after the scan finishes.

Refer to 2.3.2 Scan.

AviScanCMD.exe {\“device-name\”:\“776U\”,\“source\”:\“Sheetfed-Duplex\"} D:\\123.txt

Move the paper backward and eject it out of the page feed slot of the scanner after the scan finishes.

\"backward-eject-afterscan\":true

AviScanCMD.exe {\“device-name\”:\“776U\”,\“source\”:\“Sheetfed-Duplex\",\"backward-eject-afterscan\":true}  D:\\123.txt

Move the paper forward and eject it out of the output slot of the scanner after the scan finishes.

\"frontward-eject-afterscan\":true

AviScanCMD.exe {\“device-name\”:\“776U\”,\“source\”:\“Sheetfed-Duplex\",\”frontward-eject-afterscan\":true} D:\\123.txt

Move the paper that is held in the output slot of the scanner backward to the page feed slot. (To use this command, you need to execute the scan first.)

\"do-backward-eject\":true

AviScanCMD.exe {\“device-name\”:\“776U\”,\“source\”:\“Sheetfed-Duplex\",\"do-backward-eject\":true} D:\\123.txt

Move the paper from the page feed slot forward and hold the paper in the output slot of the scanner.

\"do-frontward-eject\":true

AviScanCMD.exe {\“device-name\”:\“776U\”,\“source\”:\“Sheetfed-Duplex\",\"do-frontward-eject\":true} D:\\123.txt


2.4 API Introduction

This chapter will introduce SDK API definition and provide corresponding examples. To use the SDK, please ensure the following process flow:

1.

If you use asynchronous AsychronizeScan (with Callback), please do integrate Device Control and Callback process into the Main Form (Main Thread) of the main window, which can ensure Callback to work normally when it returns.

2.

If only Device Control can be integrated into the Sub Form (Sub Thread) in your process, please do use the SynchronizeScan (without Callback), which can ensure to obtain the correct relevant image data synchronously after scanning.


2.4.1 Lib API

We will use C# to introduce the following section. If the developing program is in other languages please refer to …\Inc\LibWebFXScan\ LibWebFXScan.h (C/C++) or DeviceWrapper.cs in other language folders.

LibWFX_InitEx(ENUM_LIBWFX_INIT_MODE enInitMode)

The parameter ENUM_LIBWFX_INIT_MODE has two types, LIBWFX_INIT_MODE_NORMAL (use OCR) and LIBWFX_INIT_MODE_NOOCR (not

use OCR).

If you want to trace code on VS, you need to select  LIBWFX_INIT_MODE_NOOCR or use the Attach to Process  method to trace when the setting parameter is LIBWFX_INIT_MODE_NORMAL.

Example

DeviceWrapper.LibWFX_InitEx(ENUM_LIBWFX_INIT_MODE.LIBWFX_INIT_MODE_NORMAL);

LibWFX_GetDeviesList(out IntPtr szDevicesListOut)

Get the list of module names of the connected scanners.

Example 

IntPtr pstr;

List<String> m_szlistDevice;

DeviceWrapper.LibWFX_GetDeviesList(out pstr);

String json = Marshal.PtrToStringUni(pstr);

M_szlistDevice = JsonConvert.DeserializeObject<List<string>>(json);

LibWFX_GetFileList(out IntPtr szFileListOut)

Get all the file names under the temporary storage folder.

Example

IntPtr pstr;

DeviceWrapper.LibWFX_GetFileList(out pstr);

String json = Marshal.PtrToStringUni(pstr);

LibWFX_GetDeviesListWithSerial(out IntPtr szDevicesListOut, out IntPtr szSerialListOut)

Return the module name and serial number of the current connected machine.

Example

IntPtr pstr1, pstr2;

m_enErrCode = DeviceWrapper.LibWFX_GetDeviesListWithSerial(out pstr1, out pstr2);

List<String> m_szlistDevice, m_szSerialNum;

String json1 = Marshal.PtrToStringUni(pstr1);

string json2 = Marshal.PtrToStringUni(pstr2);

M_szlistDevice = JsonConvert.DeserializeObject<List<string>>(json1);

m_szSerialNum = JsonConvert.DeserializeObject<List<string>>(json2);

LibWFX_RemoveFile(String szFileNameIn)

Remove specific files in the temporary folder.

Example  

DeviceWrapper.LibWFX_RemoveFile("IMG_347111453_00001.jpg");

LibWFX_SetProperty(String szRequestCmdIn, [MarshalAs(UnmanagedType.FunctionPtr)] LIBWFXEVENTCB pfnLibWFXEVENTCBIn, IntPtr pUserDefIn)

Setting the command to the kernel layer to configure, most operations need to set this item. It only needs to be set once if the command is not changed.

Example 

ENUM_LIBWFX_ERRCODE m_enErrCode;

string command = "{\"device-name\":\"A61\", \"source\":\"Camera\",\"autoscan\":true}";

Static DeviceWrapper.LIBWFXEVENTCB m_CBEvent;

m_enErrCode = LibWFX_SetProperty(command, m_CBEvent, this.Handle);

LibWFX_StartScan([MarshalAs(UnmanagedType.FunctionPtr)] LIBWFXCB pfnLibWFXCBIn, IntPtr pUserDefIn)

Perform a scan.

Example

static DeviceWrapper.LIBWFXCB m_CBNotify;

ENUM_LIBWFX_ERRCODE m_enErrCode;

m_enErrCode = DeviceWrapper.LibWFX_StartScan(m_CBNotify, this.Handle);

LibWFX_Calibrate()

Execute the calibration function, only supports X-mini and x-cube .

Example

ENUM_LIBWFX_ERRCODE m_enErrCode;

m_enErrCode = DeviceWrapper.LibWFX_Calibrate();

LibWFX_ECOControl(out uint pulTime, int nSetIn)

Set how long the machine will enter to standby mode, the setting unit is minute.

Example

ENUM_LIBWFX_ERRCODE m_enErrCode;

unit ulTime = 5; //minute

m_enErrCode = DeviceWrapper.LibWFX_ECOControl(out ulTime, 1);

LibWFX_PaperReady()

Read the paper status.

Example

m_enErrCode = DeviceWrapper.LibWFX_PaperReady();

if (m_enErrCode == ENUM_LIBWFX_ERRCODE.LIBWFX_ERRCODE_SUCCESS)

{

//Paper is ready!

}

else if (m_enErrCode == ENUM_LIBWFX_ERRCODE.LIBWFX_ERRCODE_PAPER_NOT_READY)

{

//Paper is NOT ready!

}

else

{

//LibWFX_PaperReady() Fail!

}

LibWFX_EjectPaperControl(ENUM_LIBWFX_EJECT_DIRECTION enEjectDirectIn)

Only applicable to VTM300, which will hold the paper in place after scanning, and then the paper eject will be executed.

The parameters are LIBWFX_EJECT_FORWARDING (front side ejection) and LIBWFX_EJECT_BACKWARDING (rear side ejection).

It is recommended to use LibWFX_EjectPaperControlWithMsg() to get the machine status when ejecting paper.

Example

ENUM_LIBWFX_ERRCODE m_enErrCode;

m_enErrCode = DeviceWrapper.LibWFX_EjectPaperControl(ENUM_LIBWFX_EJECT_DIRECTION.LIBWFX_EJECT_FORWARDING);

LibWFX_EjectPaperControlWithMsg(ENUM_LIBWFX_EJECT_DIRECTION enEjectDirectIn, out IntPtr szErrorMsg)

Only applicable to VTM300, which will hold the paper in place after scanning, and then the paper eject will be executed.

The parameters are LIBWFX_EJECT_FORWARDING (front side ejection) and LIBWFX_EJECT_BACKWARDING (rear side ejection).

The szErrorMsg parameter will return the current machine status when eject paper, if it is normal, it will return an empty string, if not, it will display the corresponding error message:

LIBWFX_EVENT_DEVICE_OFFLINE: The machine lost connection

LIBWFX_EVENT_NO_PAPER: No paper detected

LIBWFX_EVENT_PAPER_JAM: paper jam

LIBWFX_EVENT_FEEDING_ERROR: Paper feed error

LIBWFX_EVENT_COVER_OPEN: The cover of the machine is not closed properly

LIBWFX_EVENT_MULTIFEED: Feed multiple sheets of paper at the same time

LIBWFX_EVENT_WRONG_HANDLER: AP cannot recognize

LIBWFX_EVENT_UNKNOWN_SCANNER: Unrecognized machine

LIBWFX_EVENT_STATUS_SCANNING: still in the SCAN process

Example

IntPtr pstr;

ENUM_LIBWFX_ERRCODE m_enErrCode;

m_enErrCode = DeviceWrapper.LibWFX_EjectPaperControl(ENUM_LIBWFX_EJECT_DIRECTION.LIBWFX_EJECT_FORWARDING, out pstr);

string szErrorMsg = Marshal.PtrToStringUni(pstr);

if (szErrorMsg.Length> 0)

WriteLog(szErrorMsg);

else if (m_enErrCode == ENUM_LIBWFX_ERRCODE.LIBWFX_ERRCODE_SUCCESS)

WriteLog(@"Status:[LibWFX_EjectPaperControl Success]");

else

              WriteLog(@"Status:[LibWFX_EjectPaperControl Fail [" + ((int)m_enErrCode).ToString() + "]]");

LibWFX_IsWindowExist(String szWindowNameIn)

Determine whether the SecureScan software has been launched on or not. An error message will show up if it has been launched.

This API is not used any more, starting from v1.1.17.22315.  Instead, settings and modifications are all set by ini.

Version

Example

versions before 1.1.17.22315

if(DeviceWrapper.LibWFX_IsWindowExist("SecureScan") == true)

MessageBox.Show("Please close the SecureScan.exe!!", "Warning");

1.1.17.22315 and later versions

Under the release folder of LibWebFxScan.ini, add CheckWindowTitle=XXX,XXX and separate items with ”,”.

The following message will show up if a specific program is detected:

LibWFX_GetLastErrorCode(ENUM_LIBWFX_ERRCODE enErrorCode, out IntPtr szErrorMsg)

Obtain the details of the error message for the current error code.

Example

IntPtr pstr;

m_enErrCode = DeviceWrapper.LibWFX_SetProperty(COMBO_COMMAND.Text, m_CBEvent, this.Handle);

DeviceWrapper.LibWFX_GetLastErrorCode(m_enErrCode, out pstr);

string szErrorMsg = Marshal.PtrToStringUni(pstr);

WriteLog(@"Status:[LibWFX_SetProperty Fail [" + ((int)m_enErrCode).ToString() + "]] "+ szErrorMsg.ToString());

LibWFX_GetPaperStatus(out ENUM_LIBWFX_EVENT_CODE penStatusOut)

To obtain the paper status.

Example

ENUM_LIBWFX_EVENT_CODE enPaperStatus;

m_enErrCode = DeviceWrapper.LibWFX_GetPaperStatus(out enPaperStatus);

if (m_enErrCode == ENUM_LIBWFX_ERRCODE.LIBWFX_ERRCODE_SUCCESS)

{

// LibWFX_GetPaperStatus() Success

}

else

{

// LibWFX_GetPaperStatus() Fail

}

The return value please refer to the table below:

(If the result does not show in the table below, please check 2.2.10 PaperStatus to get more error code messages.)

m_enErrCode

enPaperStatus

Description

0

-

Paper on the front

1

1

There is paper in the middle (scan process)

1

0

Paper at the back end

0

1

Paper on the front

LibWFX_MergeToPdf(String szFileListIn)

Combine multiple images into a pdf file.

Example

string strImgList = @"d:\pic.jpg*d:\pic2.jpg";

m_enErrCode = DeviceWrapper.LibWFX_MergeToPdf(strImgList);

LibWFX_IsOCRVerMatch()

Determine whether the installed OCR version matches with the current program version.

If you use x86 SDK to do integration, the installed OCR will be x86.

Example:

if (DeviceWrapper.LibWFX_IsOCRVerMatch() == false)

 MessageBox.Show("OCR Version Mismatch!!", "Warning");

LibWFX_CloseDevice()

Close the connection with the machine, usually executed at the end of the program.

Example

LibWFX_CloseDevice();

LibWFX_DeInit()

Used when ending the program.

Example

DeviceWrapper.LibWFX_DeInit( );

LIBWFX_SynchronizeScan(String szRequestCmdIn, out IntPtr szScanImageList, out IntPtr szOCRResultList, out IntPtr szExceptionRet, out IntPtr szEventRet)

Perform scanning and return the image file path, identification result, exception error information, and event error information.

Example

IntPtr pScanImageList, pOCRResultList, pExceptionRet, pEventRet;

string Command = "{\"device-name\":\"A64\",\"source\":\"Camera\"}";

m_enErrCode = DeviceWrapper.LibWFX_SynchronizeScan(Command, out pScanImageList, out pOCRResultList, out pExceptionRet, out pEventRet);

string szExceptionRet = Marshal.PtrToStringUni(pExceptionRet);

string szEventRet = Marshal.PtrToStringUni(pEventRet);

if (m_enErrCode! = ENUM_LIBWFX_ERRCODE.LIBWFX_ERRCODE_SUCCESS && m_enErrCode! = ENUM_LIBWFX_ERRCODE.LIBWFX_ERRCODE_COMMAND_KEY_MISMATCH)

{

// SynchronizeScan Fail

}

else if (szExceptionRet.Length > 1)

{

// exception  happen

}

else if (szEventRet.Length > 1)

{

// event  happen

}

else

{

string szScanImageList = Marshal.PtrToStringUni(pScanImageList);

string szOCRResultList = Marshal.PtrToStringUni(pOCRResultList);

string[] ScanImageWords = szScanImageList.Split(']');

string[] OCRResultWords = szOCRResultList.Split(']');

for (int idx = 0; idx < ScanImageWords.Length - 1; idx++)

{

System.Console.Write(ScanImageWords[idx].Trim());  //get each image path

                   System.Console.Write(OCRResultWords[idx].Trim());  //get each OCR result

}

 }

LibWFX_GetCertificatePermission(out IntPtr szPermissionTypeList, ENUM_PERMISSION_DATA_TYPE enDataType)

Output current registration information.

Example

IntPtr pstr;

ENUM_LIBWFX_ERRCODE enErrCode = DeviceWrapper.LibWFX_GetCertificatePermission(out pstr, ENUM_PERMISSION_DATA_TYPE.LIBWFX_DATA_TYPE_REGINFO);

if (enErrCode == ENUM_LIBWFX_ERRCODE.LIBWFX_ERRCODE_SUCCESS)

{

string szPermission = Marshal.PtrToStringUni(pstr);

if (szPermission != "")

WriteLog("License: "+ szPermission);

else

WriteLog("License: none");}

else  

{

WriteLog("Status:[LibWFX_GetCertificatePermission Fail [" + ((int)enErrCode).ToString() + "]]");

}

}

2.4.2 CallBack Function

Relevant information is returned from the SDK callback, including: image file path, OCR data, exception information and scan end information, etc.

LibWFXEVENTCB()

Event callback, mainly return the status information on the machine, including:

LIBWFX_EVENT_PAPER_DETECTED

LIBWFX_EVENT_NO_PAPER

LIBWFX_EVENT_PAPER_JAM

LIBWFX_EVENT_MULTIFEED

LIBWFX_EVENT_NO_CALIBRATION_DATA

LIBWFX_EVENT_WARMUP_COUNTDOWN

LIBWFX_EVENT_SCAN_PROGRESS

LIBWFX_EVENT_BUTTON_DETECTED

LIBWFX_EVENT_SCANNING

LIBWFX_EVENT_PAPER_FEEDING_ERROR

LIBWFX_EVENT_COVER_OPEN

LIBWFX_EVENT_LEFT_SENSOR_DETECTED

LIBWFX_EVENT_RIGHT_SENSOR_DETECTED

LIBWFX_EVENT_ALL_SENSOR_DETECTED

LIBWFX_EVENT_UVSECURITY_DETECTED

LIBWFX_EVENT_PLUG_UNPLUG

LIBWFX_EVENT_OVER_TIME_SCAN

LIBWFX_EVENT_CANCEL_SCAN

LIBWFX_EVENT_CAMERA_RGB_DISLOCATION

LIBWFX_EVENT_CAMERA_TIMEOUT

More detailed definition please refer to 4.3.2 LibFXScan Event table.

LibWFXCB ()

Notify callback, mainly returns the status message of the scan process, including:

LIBWFX_NOTIFY_IMAGE_DONE

The main return image file related content (pParam1), OCR data (pParam2)

Determine if there is a raw data command, if so, execute DrawImage () to display the returned image structure on the window, if not, execute ShowImage () to display the image file path, and display the image file on the window.

LIBWFX_NOTIFY_SHOWPATHONLY

If the set property command includes "photo":true, this callback will be returned. Only show the path of the photo.

LIBWFX_NOTIFY_END

The ending message returned by Scan at the end indicates that all actions have been completed.

LIBWFX_NOTIFY_EXCEPTION

The error message returned by the image processing will appear when performing recognition. The received message will be displayed directly on the window. The format of the error message: error:something's wrong(%d). For more details, please refer to the Image Processing Error code Table.

LIBWFX_EVENT_CAMERA_TIMEOUT

This can only happen with Camera models. When this event callback occurs, it means there is a problem with the machine firmware. Please contact us as soon as possible.

2.4.3 AutoCaptureDemo

Our common standard scan: LibWFX_StartScan(asynchronous) is a callback API, If need to use without callback scan API, please use LIBWFX_SynchronizeScan which is not support autoscan command, so we provide AutoCaptureDemo() to achieve the auto scan function.

1) Firstly, edit the .bat file., In this section, we will use C#   (AutoCaptureDemo-CSharp.bat) as an example.

     The format : ExeFileName command.

     Example command:

     "{\"device-name\":\"A64\",\"source\":\"Camera\",\"recognize-type\":\"passport\"}";

2) Select the .bat file to run AutoCaptureDemo-CSharp.exe according to the input command.

2.4.4 Helpful Tips

1) When using C# or VB to write an application, please make sure the version of Newtonsoft.Json in the development environment Build is aligned with the version of Newtonsoft.Json.dll in the SDK package; otherwise, error will happen when you run the .exe executable file.

2.5 Command Introduction

This chapter describes the complete command settings in detail. Please follow the JSON format when configuring the commands.

2.5.1 Key and Value

Format: {"device-name":"A61","source":"Camera“,….}  ( Case sensitive, json format )

Key

Type

Description                  [ ]: default value

device-name

string

Scanner model name (SmartOffice, MobileOffice, ePhoto, VTM, SecureScan, OpticPro, OpticBook, OpticSlim, OpticPro, etc.)

example: "device-name":"K81U"

source

string

Fill in the corresponding type according to device-name. If you fill in Auto, this SDK will search and automatically fill in the default source type of the device.

ADF-Front, ADF-Back, ADF-Duplex, Flatbed, Sheetfed-Front, Sheetfed-Back, Sheetfed-Duplex, Camera

example: "source":"ADF-Duplex"

paper-size

string

The default value is auto.

A3, A4, A5, A6, B5, B6, Letter, LongPaper, Custom-left-top-right-bottom.

(unit : inch)

example: "paper-size":"A4"

td2

boolean

Use this setting for TD2 size paper.

true, [false]

example: "td2":true

recognize-type

string

If recognition is needed, the corresponding key must be applied for. Some types of recognition require additional installation of PlustekOCR or DocOCR.

* You don’t need the key only if the scanner is any of the following SecureScan series and this is set as recognize-type=passport:

A61(X150), A62(X50), A63(X100), A64(X-Mini), A65(X-Cube) and A66(X200)

Please refer to 2.5.2 Recognize Type for more info.

example: "recognize-type":"fulltext"

fulltext-ocr

string

Select the OCR engine for fulltext recognition. The recognize-type must be set to fulltext.

If you want to use plus_ocr or doc_ocr, Plustek OCR or DocOCR must be installed. AVINN is already bundled within the SDK package and does not require separate installation.


[plustek_ocr], doc_ocr, avinn
example:
“fulltext-ocr”:”avinn”

recognize-lang

string

The recognize-type must be set to fulltext.

Different recognize languages are supported respectively:

  • Recognize languages supported by PlustekOCR and DocOCR:
    en:English

[zh-tw+en]:ChineseTaiwan,English

zh-cn+en:ChinesePRC,English

de+en:German,English

jp:Japanese

kp:Korean

es:Spanish

vn+en:Vietnamese,English

ae+en:Arabic,English

pt:PortugueseStandard

br:PortugueseBrazilian

hu: Hungarian

  • Recognize languages supported by AVINN:
    [en]:English
    zh-tw:ChineseTaiwan
    zh-cn:ChinesePRC
    de:German
    ae:Arabic
    vn:Vietnamese
    es:Spanish
    fr:French
    jp:Japanese

example: "recognize-lang":"en"

fulltext-type

string

To set the output file format for the recognition result, the recognize-type must be set to fulltext.

 Different output formats are supported respectively:

  • Output formats supported by Plustek OCR: [rtf], txt, xls, pdf, xml, docx, xlsx, pptx
  • Output formats supported by DocOCR: [txt], pdf
  • Output formats supported by AVINN: [txt], pdf, sofd

example: "fulltext-type":"txt"

threadcount

integer

The recognize-type must be set to fulltext to avoid full text recognition error. You can use this parameter to adjust the thread value. It is recommended to fill in 1~3.

autoscan

boolean

Detect the paper with the hardware sensor.

The default is false. If the value is true, the scanner will scan automatically after detecting the paper.

true, [false]

example: "autoscan": false

autorotate

boolean

The default is false. If the value is true, the scanner will automatically identify the direction of the image and rotate it to the correct direction.

true, [false]

example: "autorotate":true

rotate

integer

Customize the image rotation angle.

[0], 90, 180, 270

example: "rotate":90

frontrotate

integer

Customize the front-side image rotation angle.

[0], 90, 180, 270

example: "frontrotate":90

rearrotate

integer

Customize the rear-side image rotation angle.

[0], 90, 180, 270

example: "rearrotate":90

autoenhance

boolean

The default is false. If the value is true, the scanned image will be applied with auto enhancement.

true, [false]

example: "autoenhance":true

mode

string

Select from these options: Color, Gray (grayscale) and Lineart (black and white). The default is color.

lineart, gray, [color]

sensor-align

string

Detect if the paper or identity card is aligned to the left or right. You can specify the setting as left or right.   If this command is set to align to the left, the paper or identity card will not be scanned if it is placed in the upper right corner.

[left], right

example: "sensor-align":"left"

paperdetectfreq

integer

Set the frequency of paper detection, available only in the autoscan mode.

The value can be set to 100~1000 (0.1s~1s). The default value is 1000.

example: "paperdetectfreq":1000

scancount

integer

Set the number of sheets scanned at one time. If the command enables autoscan, it will continue to scan when the paper is detected.

>=0, default=0

example: "ScanCount":1

ext-capturetype

string

This is used for setting UV and IR features of the SecureScan series.

IR: all models (except X50)

UV: only X150 / X200 / X-Cube

uv, ir

example: "ext-capturetype":"uv,ir"

uvsecurity

boolean

This variable is only for the reference of Taiwan ID card, please adjust the “uvsecurity-sensitivity” parameter for other ID cards, and with the human eye to assist in the judgment, the SDK does not provide the function of determining the authenticity.

To be set along with “ext-capturetype”:”uv” to detect whether the scan target has the UV anti-counterfeiting function.

If it is detected, the message  "LIBWFX_EVENT_UVSECURITY_DETECTED[1]" will appear on the screen.

Support customizable sensitivity

UV support is available only with SecureScan X150 / X200 / X-Cube.

true, [false]

example: "uvsecurity":true

uvsecurity-sensitivity

double

To be set along with “ext-capturetype”:”uv” and “uvsecurity”:true.

The higher the sensitivity value is, the easier it is to detect UV (uvsecurity true). The lower the sensitivity value is, the more UV reflected light is needed to obtain the return value of LIBWFX_EVENT_UVSECURITY_DETECTED[1].

0.0 to 100.0, default: 20.0

example: "uvsecurity-sensitivity":25.2

calibrate

boolean

Use this command for calibrating the scanner through command approach, only available in non-UI mode.

[false], true

example: "calibrate":true

imagefmt

string

This is the file format to save the scanned images. When imagefmt is set to spdf, it must be used with recognize-lang.

bmp, [jpg], png, tif, multi-tif, pdf, multi-pdf, pnm, spdf, txt, rtf, xls, xml, docx, xlsx, pptx, epub, ofd, sofd

example: "imagefmt":"jpg"

imagecustominfo

boolean

To write information to the saved image file.

true, [false]

Example:

{“device-name”:“A61”,“source”:“Camera”,“imagecustominfo”:true, “imgsoftware”:“sw”, "imgartist":"artist"}

imgsoftware

string

The software name.

To be used along with “imagecustominfo”: true.

example: "imgsoftware":"JXZHZY"

Migrationist

string

The author’s name.

To be used along with “imagecustominfo”: true.

example: "imgartist":"Plustek_PS456U Plus"

filename-format

string

The file name format is filename-format-digitalcount.

Default:"IMG-tick-5"

filename: Prefix of the file name, customizable.

format: Tick or datetime.

Example: 330626250 or 2020-05-22-12-12-59-187

If it is set to other values, this value will be displayed as a string (Example 3).

If this value is void, nothing will be displayed (Example 4).

digitalcount: The number of digits for consecutive numbers as the suffix. If you enter 0, nothing will be displayed.

Example:

1."PIC-tick-5" -> PIC_330707984_00000.jpg

2."PIC2-datetime-3"->PIC2_2020-05-22-12-19-20-701_000.jpg

3."PIC-myfile-5" -> PIC_myfile_00000.jpg

4."PIC-5" ->PIC_00000.jpg

filename-beginindex

integer

Use this command along with filename-format. The digital count of the first image will start from this value.

1 to 10, default : 0

Example:

"filename-format": "PIC-datetime-3", "filename-beginindex": 2 generated.

PIC_2020-05-22-14-11-24-147_002.jpg

PIC_2020-05-22-14-11-24-147_003.jpg

photo

boolean

Use this command to capture and save the photo on specific identity documents (twid, insurance, passport, usdl).

Used along with recognize-type.

the photo filename is “filename_PHOTO.jpg”

Note : When using this photo command, you can not set recognize-type as auto.

   

true, [false]

example: "photo":true

If the device supports RFID, it will retrieve RFID information (if the document contains an RFID chip), including the passport photo. The file name will adhere to the naming convention specified by the filename-format and ending as “'_RFID.jpg”.

supported by Lib_1.1.19.24012 and later.

watermark

string

Set the watermark.  The format is:

imagepath-center[top,bottom,left,right]-Transparency

Imagepath: The file path of the watermark image.

center: The position to place the watermark.

Transparency: The transparency of the watermark.

The watermark DOES NOT support transparent backgrounds.

Example:

"watermark":"d:\\logo.bmp-top-80"

     "watermark":"d:\\logo.bmp-left-30"

savepath

string

Define the path of the storage folder for scanned files.

Example:  "savepath":"d:\\doc“

Default %USERPROFILE%\AppData\Local\Temp\WebFXScan\

The support for environment variables "savepath":“<APPDATA>\\doc“ is added to SDK v1.1.15 and later versions. Please refer to CSIDL Table for more information on < APPDATA >.

Example:  “savepath”:“<CSIDL_COMMON_DOCUMENTS>\\doc”

remove-punchhole

boolean

The default is false. To enable the punch hole removal, set the value as true.

true, [false]

example: "remove-punchhole":true

remove-blackedges

boolean

The default is false. To enable the removal of black edges, set the value as true.

true, [false]

example: "remove-blackedges":true

remove-blankpage

boolean

The default is false. To enable the blank page removal, set the value as true.

true, [false]

example: "remove-blankpage":true

remove-blankpage-sensitivity

integer

Use this command along with “remove-blankpage”:true to adjust the coefficient to decide whether this page is a blank page that needs to be removed. The higher the value, the more probable it is to determine it is a blank page. It is recommended not to adjust it at will.

[1] to 15

example: "remove-blankpage-sensitivity":1

remove-background

boolean

Available only for grayscale and color mode.

The default is false. To enable the background removal, set the value as true.

true, [false]

example: "remove-background":true

remove-background-fillcolor

integer

Replace the background with the specified color.

0 to [255]

example: "remove-background-fillcolor":0

remove-background-weight

integer

Sensitivity of judging the background.

0 to 255, default : 30

example: "remove-background-weight":30

remove-background-radius

integer

The larger the value is, the bigger the reference range is.

1 to 255, default : 100

example: "remove-background-radius":100

resolution

integer

Set the DPI value.

To do full text recognition, it is recommended to set the resolution as 300.

100,150, 200, 250, 300, 500

This is available to scanner models whose dpi is configurable. If you want to convert the DPI, it is recommended to use resizedpi to adjust the resolution.

example: "resolution":300

resizedpi

integer

Use image processing to modify the dpi of the scanned image file.

The example below shows how to convert from default 300 dpi to 200 dpi.

{"device-name":"K71U","source":"ADF-Front","resizedpi":200}

brightness

integer

Use this command to set the exposure. The higher the brightness value is, the more there is the amount of white in an image, making it appear more washed out. Lowering the brightness may help you read light or faint text.  

-100 to [0] to 100

example: "brightness": 10

contrast

integer

Use this command to set the sharpness. The higher the contrast value, the sharper the image. The lower the contrast value, the more blurry an image will be.  

 

-100 to [0] to 100

example: "contrast": -20

quality

integer

Use this command to adjust the image quality. The higher the value, the better the quality.

Available only for jpg format.

0 to 100, default : 75

example: "quality": 75

bgsensitivity

integer

Use this command along with swdeskew or swcrop to adjust the detection sensitivity. If the value is too high or too low, the possibility of misjudging is increased.

0 to 255, default : 90

example: "bgsensitivity":100

gamma

double

0.0 to 4.0, default : -1.0

example: "gamma":0.8

gridarea

integer

Set the range of recognition.

Unit : pixel.

left-top-right-bottom, default:"0-0-0-0"

example: "gridarea":"20-20-100-100"

grid-sensitivity

double

Used with gridarea to detect the sensitivity of gridarea

0.0 to 100.0, default: 2.5

example: "grid-sensitivity":2.5

colordropout

string

This Color Dropout command allows you to remove a color channel (Red, Green or Blue). This feature is available only with the Black & White or Grayscale image.  For example, if your original document contains blue texts or a blue stamp (e.g., a bill or invoice) and you want to discard it from your image, you may select blue channel for color dropout.

r, [g], b

example: "colordropout":"r"

filledgecolor

string

Paint white around the image. The value refers to the width.

Unit : inch.

left-top-right-bottom

Example: "filledgecolor": "0.1-0.1-0.1-0.1"            

"filledgecolor": "0.5-0.5-0.5-0.5"

swdeskew

boolean

The default is true, except for SecureScan X series whose default is false. Setting the value as true enables the software deskew.

true, [false]

example: "swdeskew": false

swcrop

boolean

The default is true, except for SecureScan X series whose default is false. Setting the value as true enables the software cropping.

true, [false]

example: "swcrop": true

sharpen

boolean

The default is false. Setting the value as true enables the automatic sharpening.

true, [false]

example: "sharpen": false

crop

string

Use this command to set the crop area. If the specified range exceeds the size of the image, an error will be reported Status:[LibWFX_SetProperty Fail [12]]

Unit : pixel.

The format is "left-top-right-bottom", default:"0-0-0-0".

example: "crop":"0-0-100-100"

barcodeareas

string

Use this command to define the barcode area. Must be used along with "recognize-type": "barcode".

 The format is "left1-top1-right1-bottom1, left2-top2-right2-bottom2..."

example: "barcodeareas":"0-0-300-200,500-0-600-300"

barcode-type

boolean

Use this command to define whether the "Type" field is included in the result output of the barcode recognition.

ture, [false]

Example: "barcode-type": true

 -> {"Barcode1": [{"Type": "CODE128", "Text": "12250E19102500901"}, {"Type": "PDF417", "Text": "@ANSI "}]}

"barcode-type": false -> {"Barcode1": [{"12250E19102500901"}, {"@ANSI "}]}

denoise

boolean

Use this command to remove noises from the image.

true, [false]

example: "denoise": false

backward-eject

boolean

Determine the direction to eject the paper from the scanner.

The following-listed scanner models support backward-eject:

  • A4: S410 Plus, D430 (only its A8 size supports this feature), VTM300 (supported with only v1.1.15.22113 and later versions)
  • A6: D600 Plus, D620
  • VTM300:

For versions earlier than 1.1.15.22113, please refer to API EjectPaperControlWithMsg for more info.
For v1.1.15.2213 and later versions, you can use either commands or APIEjectPaperControlWithMsg. Using commands will have a complete process with the paper being ejected right after the scanning.  If you would like to eject the paper a little while after the scanning, please use APIEjectPaperControlWithMsg to operate.

Example: “backward-eject”:true :  Eject the paper from the page feeding position after scanning.

true, [false]

example: "backward-eject":true

thumbnail

boolean

Generate the thumbnails after the scan is completed and successful, suitable for scans of A4 or larger sizes.

true, [false]

example: "thumbnail":false

multifeed

boolean

Use this command to enable or disable the multifeed detection for scanning. The default is false (disabled). If the value is set as true (enable) and more than one page of paper is fed into the scanner at the same time, the error message "LIBWFX_EVENT_MULTIFEED" will be displayed and the paper feeding will be interrupted.

true, [false]

example: "multifeed":true

bottomup

boolean

This is only supported in select models as follows:

SecureScan x50, SecureScan x150, SecureScan x100 and SecureScan x200.

Enabling this command will automatically detect the page orientation and rotate the page upright. The default is false. If the value is true and the page is detected as upside down, the page will be automatically rotated by 180 degrees.

true, [false]

example: "bottomup":true

rawdata

boolean

The default is false.

true : The image is not saved.

false : The image is saved.

true, [false]

example: "rawdata":true

borderfill

boolean

Fill the border in white.

true, [false]

example: "borderfill":true

apautoscan

boolean

Only in Asynchronous Mode (UseModeBlock=0)

Similar to "autoscan", in case of “apautoscan”: true, Lib event callback will be triggered when paper is detected.

The default setting is true for SecureScan series models and false for other models.

example: "apautoscan": false

softwaresensor

boolean

Use software to determine if the paper is detected. If so, a message will be sent, but it will not perform a scan proactively. (Only SecureScan X-Mini & X-Cube models are supported.)

true, [false]

example: "softwaresensor": false

jpegxfer

true

Scan jpeg files directly to expedite the scanning speed. This command is supported by SmartOffice PS3180 and PT2160 scanners only, and the scanned file format must be jpeg.

true, [false]

example: "jpegxfer":true

density

boolean

Setting true means enable auto density.

true, [false]

example: "density": false

saturationshift

integer

Adjust the saturation of the color of the image according to the HSL color space. Increase or decrease the saturation based on the current saturation of each pixel.

 -100 to [0] to 100.

example: "saturationshift":10

applycolorprofile

string

Use this command to specify the scan profile.

If the scan profile does not exist, an error will be reported:

     Status:[LibWFX_SetProperty Fail [13]]

Available only for 24bit/48bit color image.

Example: "applycolorprofile":"d:\\profile.icm"

colorprofilegamma

double

Specify the gamma value of the scan profile, which must be used with applycolorprofile.

The range of gamma value is 0.1 to 4.0.

Default : 0.0

Example:

"applycolorprofile":"d:\\profile.icm" ,"colorprofilegamma":2.0

convertimgmode

string

Convert the image file format to the specific format. Choose from the following:

lineart, gray_4bit, gray_8bit, gray_16bit, color_4bit, color_8bit.color_16bit, color_24bit, color_48bit

Note: Converting from color to lineart is not supported.

Example: "convertimgmode":"gray_8bit"

charehance

boolean

This is customized character enhancement image processing which can increase the legibility of characters and is usually used with other IP's.

true, [false]

example: "charenhance": false

omr-parm

string

Used with recognize-type : omr.  Available with custom-made projects. Please contact your Plustek sales representative for more information.

multicrop

integer

When you scan two or more small items (such as business cards) at the same time, the software will identify each individual item and generate separate scanned image files. The scanned items must be placed separately on the scanner glass with no two items sticking together. For best scanning results, place all small items on the scanner glass with a slight gap between them.

It is turned off by default.  When it is enabled, you can select Auto or Setting mode.

[0], 1, 2

0: unable  1:auto multi crop  2: multi crop by setting

example: "multicrop":1

hashblackimage

boolean

Used when multicrop is set as Auto.

It is turned off by default. For business cards with a black background, please turn on this setting to ensure best auto cropping results.

true, [false]

example: "hasblackimage":true

uirectnum

integer

Use this key to specify the number of crops when multicrop is set as Setting.

>0, default : 1

example: "uirectnum":2

multicroprect

string

Use this key to set the position of uirectnum frames when multicrop is set as Setting and uirectnum is also used. It should be consistent with the number of uirectnum settings, unit : pixel.

"left1-top1-right1-bottom1, left2-top2-right2-bottom2...", default:"0-0-0-0".

example: "multicroprect":"0-0-300-200,500-0-600-300"

duplexbackflip

boolean

It is suitable for use when the angles of the front and back sides of the scan result are different.  The default is false. If duplexbackflip is set to true, be sure to also adjust the rotate parameter.

true, [false]

Example:

If the front and back sides of your scanned pages are as shown below (without rotate and duplexbackflip commands):

you need to add the command "rotate":90, "duplexbackflip":true to rotate the images right-side up before executing the recognition.

innercutted

integer

"x-y" When using it, the inner cropped area will be set.

>0, "x-y", default : 5-5

For example, "innercutted":"2-3". (1 unit:0.1mm)

passport-viz

boolean

It's required to be used with the installation of Plustek OCR Lite. When "recognize-type" set to "passport" and "passport-viz" set to true, the Taiwanese passport will display additional information apart from the MRZ data, including the Chinese name - "NativeName".

 

true, [false]

example: "passport-viz":true

duplexmergetype

integer

Only for duplex scan

0:Left Front Right Rear

1:Left Rear Right Front

2:Top Front Down Rear

3:Top Rear Down Front

0, 1, 2, 3

example: "duplexmergetype":1

redtypeenhance

boolean

Image pre-processing only for special documents.

true, [false]

example: "redtypeenhance": false

orig

boolean

Get the raw images

Default saving path:

%USERPROFILE%\AppData\Local\Temp\WebFXScan\

true, [false]

example: "orig": true

swcropbgmin

integer

It needs to be used in conjunction with “swcrop”:true.

If the background color is black, the color range will be set by default,so you only need to set “swcrop”:true.

The minimum value of the RGB primary color range

default:0

example:background color is white

“swcrop”:true,

“swcropbgmin”:210,

“swcropbgmax”: 255

swcropbgmax

integer

It needs to be used in conjunction with “swcrop”:true.

If the background color is black, the color range will be set by default,so you only need to set “swcrop”:true.

The maximum value of the RGB primary color range

default:90

example:background color is white

“swcrop”:true,

“swcropbgmin”:210,

“scropbgmax”: 255

paper-orientation

string

Set the orientation of the paper, whether portrait or landscape, to be used in conjunction with paper-size.

default:”portrait”

example: “paper-orientation”:“landscape

scan-speed

string

Use this key to adjust the scan speed.

fastest, fast, quick , standard, slow, slowest

example: “scan-speed”:”fastest”

feject-speed

string

Use this key to adjust the speed of ejecting paper to the back from the paper feeding position.You can use it with another key “backward-eject”.

fastest, fast, quick , standard, slow, slowest

example: “feject-speed”:”fastest”

beject-speed

string

Use this key to adjust the speed of ejecting paper from the paper feeding position. You can use it with another key “backward-eject”.

fastest, fast, quick , standard, slow, slowest

example: “beject-speed”:”fastest”

 

2.5.2 Recognize Type

Listed as follows are the identity documents and forms we currently support. If you can not find what you need in this table or need a license to apply / install extra OCR, please contact our sales representatives for customization project evaluation.

Recognize-Type

Description

Extra OCR Installation

License Fee

SecureScan

series

Others Plustek

scanner

passport

For Original Passport and ID Card with MRZ

N/A

Free

Required

auto

For Taiwan ID, Taiwan Healthcare Insurance, MRZ and U.S. Driver's License

N/A

Required

usdl

U.S. Driver's License

N/A

E13B

E13B Magnetic Ink Character Recognition

N/A

barcode

Barcode Recognition

N/A

receipt

Taiwan Receipt

N/A

check

Taiwan Check (E13B)

N/A

insurance

Taiwan Healthcare Insurance Card

N/A

twid

Taiwan ID Card (Include Front and Rear Images)

N/A

hkid

HongKong ID Card

N/A

DEID0

Germany ID Card and Driver's License

PlustekOCR v7

MXID1

Mexico ID Card

N/A

cnid

China ID Card

N/A

fulltext

Full Text

DocOCR v6/PlustekOCR v6, v7

vnid

Vietnam ID Card

PlustekOCR v7

TWPermit1

Taiwan Immigration Form for China, Hong Kong and Macao visitors

PlustekOCR v7

twrc

Taiwan Resident Certificate

PlustekOCR v7

mxid

Mexico ID Card

PlustekOCR v7

JPDL

Japan Driver's License

PlustekOCR v7

idid

Indonesia ID Card

PlustekOCR v7

AUID0

Australia Driver's License (Only WA, VIC, QLD 3 State)

PlustekOCR v7

ARID0

Argentina ID

PlustekOCR v7

RWID0

Rwanda Foreigner’s ID, Local National ID, Rwanda Driving License

PlustekOCR v7

SSDL0

South Sudan Driving License

PlustekOCR v7

UGDL0

Uganda Driving License

PlustekOCR v7

UNID0

United Nation ID

PlustekOCR v7

ESID

Spain ID Card

PlustekOCR v7

COID

Colombia ID Card

PlustekOCR v7

EUDL

European Economic Area 30 countries + UK Driver's License(Version 23335 and above are supported)

PlustekOCR v7

EGID1

Egypt ID Card

PlustekOCR v7


3. WebFXScan SDK 2.0

3.1 Basic Knowledge

  1. Download scanner driver from Plustek official website.

The scanner drivers of SecureScan X Series (except X200) are already included in the SDK Package. Please do NOT download and install.

For X200, RFID module driver:

https://plustek.com/us/products/customized-scan-modules/securescan-x200/support.php          

For Plustek Other Scanner driver:  

https://plustek.com/us/support/drivers-and-downloads.php

  1. Install OCR engine package (Non-compulsory, according to the needs of recognize type)

  1. Download & install Microsoft Visual C++ Redistributable for Visual Studio 2015.

Microsoft Download Center:

https://support.microsoft.com/en-us/topic/the-latest-supported-visual-c-downloads-2647da03-1eea-4433-9aff-95f26a218cc0

or

For x86:

https://aka.ms/vs/16/release/vc_redist.x86.exe

For x64:

https://aka.ms/vs/16/release/vc_redist.x64.exe

  1. Installation WebFXScan SDK 2.0 Package LDSetup.exe.

After the installation is completed, the dll and related files required by the server will be decompressed to a specific location, and the server can be started by running :  

  1. From the WebFXScan Client demo folder, open the index.html WebFXScan.html with Google Chrome or Microsoft Edge browser.

  1. License Register (Please refer to Chapter 4.4 Register)

* WebFXScan SDK introduction video on AVI Youtube.

      7)Enable startup settings for WebScan2

        (Support from SDK Version 24344 and After)

During the installation process, you can choose whether to enable WebScan2 at startup. After installation, you can also change your settings in Windows -> Settings -> Apps -> Startup, or by right-clicking the WebScan2 icon in the bottom-right corner and selecting the Open menu to modify your settings.


3.2 Demo UI Introduction

The Client package includes the following:

main.js

All the demo codes that reference the server-side API are here as an example, which provide the API required by the demo page.

scan.js

Set the initial options corresponding

to the web language and machine. If you want to add a new machine, you need to add the corresponding content here.

index.html

Support web control menu.

3.2.1 Scan Page

Device Name

Display the machines connected to this computer

Recognizer Type 

Recognition type,including:passport, barcode and fulltext, etc.

Auto Crop

Crop automatically, check the box means to crop automatically; Uncheck means not to crop automatically.

Auto Deskew

Automatic skew correction, check the box means dynamic skew correction, unchecked means not to automatically do skew correction.

Click recognize button to get the recognize data

 

3.2.2 ini File Setting

There is LibWebFxScan.ini in the release folder from the server-package.

LibWebFxScan.ini Path :

[Style]

UseModeBlock = 1

CheckWindowTitle=SecureScan,IssueDetector

;EnableLog = 0

;EnableOrig = 0

;SavePath="D:\test"

;LogPath=D:\test

[WebSetting]

;Port = 17778

;Certificate=server.pfx

;Password=password

;WSS=0

EnableLog

1: A log file will be generated under the release folder  0: Not generated

The default is 0

EnableOrig

1: Generate original image file  0: Do not generate  

The default is 0

SavePath

Set the storage location of the image file.

The default Path %USERPROFILE%\AppData\Local\Temp\WebFXScan

LogPath

Set the storage location of the Log file.

The default Path %USERPROFILE%\AppData\Local\Plustek\LibWFXScan

The support for environment variables SavePath = “<APPDATA>\test\“ is added to SDK v1.1.13 and later versions.

Please refer to CSIDL Table for more information on < APPDATA > .

SSL

Certificate , Password and WSS are for HTTPS settings.

WebSetting

Default WebSocket port is 17778, could be modified if needed.

3.2.3 Change Command

In Demo UI want to change command need to change in main.js

Please refer to 3.4 Command Introduction for more information on command.


 3.3 API Introduction

This chapter will introduce the definition of SDK API and provide corresponding examples.

If port 17778 is already occupied, it could be supported by other ports.
Relevant ini files should also be modified, please check
3.2.2 ini File Setting [WebSetting].

3.3.1 Web API

WebFXScan JS Library (aviswpm.github.io)

3.3.2 Calibration

To do calibration for SecureScan X-Mini and X-Cube, you can also use the Calibration Tool application, in addition to DoCalibrate API.  This Calibration Tool application is available in Web Web SDK v1.1.13 or later versions.

Please follow the steps as follows:

  1. Open the Web SDK installation folder path and run the CalibrationTool.exe or go to the installation folder, run Webscan2.exe and right click the Webscan icon and click “calibrate”.

  1. Place the calibration sheet on the scanner.
  2. Click the Calibration button.  If the calibration successfully completes, the corresponding message will show up.

3.4 Command Introduction

Please refer to WebFXScan JS Library (aviswpm.github.io) -> Scan Params Section.

If you want to change Command need to change in main.js

3.5 Http/Https demo using IIS

For more detailed operations please refer to the introduction video on AVI Youtube.

3.5.1 IIS Installation & Setting

  1.  Open “Programs and Features” and then select “Turn Windows features on or off

  1. Select the setting as follows and then select OK to begin installation.

  1. After the installation, you will see the directory as follows. Put the client files under this directory.

  1. Open “Internet Information Services (IIS) Manager and then select

Application Pools > DefaultAppPool > Advanced Settings..  >

General > Enable 32-Bit Applications : “True”

  1. Select the  “Default Web Site” > “ASP” >

Enable Parent Paths : “True”

Send Errors To Browser : “True”

3.5.2 Save Path Setting

  1. Right-click the“Default Web Site” > Add Virtual Directory >

Alias : “SavePath”(for example)

Physical path :  “C:\Users\SaveDir”(for example)

  1. Select “DESKTOP-…” > “Authentication

        

  1. Select “Anonymous Authentication” > “Edit” > “Application pool identity” > OK

  1. Setting SaveDirectory,Right-click your Save Directory

(ie. SaveDir)  > Properties  > Security > Everyone  > Full control  > Apply

4. Support Reference

4.1  Basic Knowledge

If problems occur during the development integration phase, regardless of the development version and language of the SDK under development, use our standard demo application to verify whether the same problems occur (e.g.,  LibWFXDemo.exe). If the demo application is working properly, this means it is an integration problem. An additional consulting fee for debugging may be charged after evaluation.

4.1.1 General FAQ

  1. How to get a version of SDK ?

After Installation SDK Package

Check with LDSetup.exe version

Setting -> Applications -> search AviScanProcess

Setting -> Applications -> search WebFXScan2

  1. How to enable the Log ?

The default storage path for both Lib and Web SDK is: %USERPROFILE%\AppData\Local\plustek\LibWFXScan\

 - Method 1

Set Command add “log”:true

Be sure to reset the SET property until it succeeds. (The Device Ready! message is displayed.)

Method 1 Only could record the actions after Set Property. If the error occurs in the init stage, please use method 2 to enable Log:

         - Method 2

                LibWebFxScan.ini default Path :

Open LibWebFxScan.ini file, and then add the following content into the file :

[Style]

EnableLog = 1

After modify the LibWebFxScan.ini

  1. How to get a raw image for RD debug ? (Analyze unrecognizable images)

GET THE RECOGNIZE IMAGE

 - AVIRecognize.ini default Path :

Open AVIRecognize.ini file, and then add the following content to the file :

(It only works when recognize-type is set)

[DebugMode]

Enable=1            

After modify the AVIRecognize.ini

Please provide us with “AVIRecognize” folders.

The folder path : %USERPROFILE%\Documents\Plustek\AVIRecognize

        

GET THE ORIG IMAGE

 - Method 1

Set Command add “orig”:true

         - Method 2

LibWebFxScan.ini default Path :

Open LibWebFxScan.ini file, and then add the following content to the file :

[Style]

EnableOrig = 1

After modify the LibWebFxScan.ini

Please provide us “ORIG”  and “ORIG_PUSHQUEUE” folders.

The folder path : %USERPROFILE%\AppData\Local\Temp\WebFXScan\

  1. Where is the scan image default save path ? How to change it ?

Lib and Web SDK both default stored path is:

%USERPROFILE%\AppData\Local\Temp\WebFXScan\

If you need to change the default path to D:\\test folder, please follow the instruction below:

        - Method 1

Set Command add "savepath":"d:\\test"

The support for environment variables "savepath":“<APPDATA>\\test“ is added to SDK v1.1.15 and later versions. Please refer to the CSIDL Table for more information on < APPDATA > .

         - Method 2

LibWebFxScan.ini default Path :

Open LibWebFxScan.ini file, and then add the following content to the file :

[Style]

SavePath="D:\test\"

The support for environment variables SavePath = “<APPDATA>\test\“ is added to SDK v1.1.13 and later versions.    Please refer to CSIDL Table for more information on < APPDATA > .

After modify the LibWebFxScan.ini

  1. How to scan an image without saving ?

Set Command add "rawdata":true

The default is false.

true : not save the image, false : save the image.

  1. How to correctly place the ID/Passport on the SecureScan scanner for recognition? How to set the recognize command?

Set Command : "recognize-type":”xxxx”

Be sure to confirm that you have the corresponding xxxx key permission.

For more recognize-type details, please refer to 2.5.2 Recognize Type.


  1. How to scan a full screen image with SecureScan Scanner ?

 (full image DO NOT Support Recognize)

Set Command : {"device-name":"AXX","source":"Camera","autoscan":false,"paper-size":"A6"}

 

  1. I use SecureScan scanner to scan documents/cards which are 105mm * 75mm in size and are correctly aligned on the upper left corner of the scanner. Why can't I get complete images?  A part of the images is always cut off.

The default crop size of SDK is TD1. If the scan target is TD2 size of identity documents, you need to add an additional command "td2": true.

Set Command : "td2":true

  1. Why can’t I find the SET button in the Lib demo application?

You can set the switching method in LibWebFxScan.ini

UseModeBlock=1 to 0 (Asynchronous mode)

Please refer to 2.2.1 Set and Scan and 2.4 API Introduction for more information.

  1. How to get the json file of the recognized results ?

Lib and Web SDK both default stored path is:

%USERPROFILE%\AppData\Local\Temp\WebFXScan\

Open LibWebFxScan.ini file, and then add the following content to the file:

[Style]

After modify the LibWebFxScan.ini

4.1.2 IssueDetector Tool

Please remember to exit webscan2.exe and then open IssueDetector Tool, if you want to use the SDK demo,  please make sure to close IssueDetector Tool first. It provides the OCR installation status, the Visual C++ Redistributable package installation status, the OCR file reading test, and the connected machine status (PID/VID/Module name/Serial Number).

  1. OCR Engine

Display the installed OCR package.

 

  1. Redistributable  Package

Display the 2008/2010/2012/2013/2015 X86/X64 installation status.

  1. Test Tool

Open the Test Tool page, the connected machine will be automatically read. Select  Recognize, and the sample picture will be read and recognized. If it is successful, ReadImageAndIPProcess [Success] and the recognition result will be displayed.

[Para_0] Test123456.

  1. DeviceList

DiscoverDevice: Display the status of all connected modules.

ProductName.dat List: Display all items in the current ProductName.dat. You can use this to check whether the module is registered or not.

  1. Port Check

Port: Enter the port number to be queried, then select Check. You can see the status inside the Status column or select "Kill Process" to force terminate the process (not recommended).


4.2 Common Issue

Please confirm whether the dll or other files in the release folder have been changed. It is recommended to re-download an integral SDK package to verify the issue.

4.2.1 Init Fail

Generally speaking, the related environment settings might be the main reason to cause init failure.

Please check whether the Redistributable is correctly installed:

(IssueDetector.exe could check installed Redistributable.)

Note: The OCR installation package includes relevant Redistributable.If OCR is installed, you don’t have to install Redistributable again. There’s X86/X64 OCR, make sure you’ve installed the correct bit of Redistributable.

4.2.2 Connection Error

 

Connection Error only appears on WebFXScan SDK, it means Connect with Server agent failed.

Please check WebScan.exe is executed, If not please execute it.

the default installation path is:

C:\Program Files (x86)\Plustek\WebFXScan (Regular version)

C:\Program Files (x86)\WebFXScan (Special version)

4.2.3 No Device

  1. Check Device Manager, make sure the computer is already connected with the scanner(also Not in the sleep/standby mode) and can be recognized.

-Camera scanner could use webcamtests.com to check if the function is working properly.

-Other scanners : please install the corresponding driver from Plustek official website.

Check Properties to view more information about the scanner.

  1. If the device manager could recognize the scanner device, but the LibFXScan SDK shows  NOT_YET_OPEN_DEVICE, please check no other application occupied device.

(securescan, docaction, webscan... cannot be work at the same time)

  1. If device manager could recognize scanner device, but WebFXScan SDK still can’t get device, please check the followings:

  1. Firstly, please check if the installed antivirus is blocking then see if the current .exe file has been included in the Windows Virus & Threat Protection list. If the driver is installed correctly, open the scanner’s bundle application to check if the basic function is working properly.

For example: PS286’s bundle application is DocAction..

Enable Webscan.exe in the ransomware protection control list:

Select "Start" > "Settings" > "Update and Security" > "Windows Security" > "Virus and Threat Protection".

Select Manage ransomware protection:

Select Allow an app through Controlled folder access:

Add an allowed app > Browse all apps:

Select the WebScan.exe file:

  1. In the latest Windows 10 update, there are adjustments to the default options of the camera device, which will disable the camera's reading permission, please follow the steps below to enable it.

Select Start button > Settings > Privacy > Camera

Turn on [Allow the apps to access your camera].

  1. Check the scandata.js have corresponding machine contents in use at present. If not, confirm with RD to add.

(Also could use 4.1.2 IssueDetector Tool to check supports scanner)

4.2.4 OCR Mismatch

  1. Please ignore this warning message if you only use the scanning function or the recognition engine is built in the SDK package.

(SDK built-in recognition type:  twid, insurance, passport, usdl…, check with AVI IP team for more information)

  1. Check if you accidentally installed X64 AVI OCR on X86 program, make sure to install the right bit version of OCR on the corresponding program.

4.2.5 No Recognize Result

When there is no recognize result, please check with the following items:

  1. You can use IssueDetector.exe to check whether OCR is installed.

  1. The recognize-type in the command is correct, and the case sensitive must be the same as the command table.

  1. The success of Set property is usually related to the permissions used.

Please contact our sales representatives to apply for a formal authorized Key.

  1. If the log displays  "something wrong()" exception message, please check with the following:

Use IssueDetector.exe > Test Tool to check whether it is working normally. If SetRecognizeTool [ABBYY][Fail] message appears:

  1. First go to C:\Program Files (x86)\Plustek\Software\AVIOCR\Bin to check if there is anything (dll files, etc.). If the path folder has files, meaning installation is complete, then go to

C:\Program Files (x86)\Plustek\Software\AVIOCR\Data to check if there is anything(dll files, etc.).

  1. Check if the Redistributable package is correctly installed.

  1. If OCR packages and Redistributable packages are installed correctly but the failure still occurs, please remove all the Redistributable packages and OCR files on the computer then reinstall OCR packages. (Sometimes the conflicts happened when too many versions of Redistributable packages are installed)

  1. If all operations listed above and scanning other documents are normal, it might be the failure of image recognition. Please acquire scanning images from customers for the IP team to do further verification. ( Better provide more than one image)

IP team may require the original image, please add “orig”:true to the command to get the original file (have not been processed by IP), the original image files will be stored in the folder named “ORIG”.(Please refer to General FAQ: How to get a raw image for RD debug)

4.2.6 Visual Studio Debug

  1. DllNotFoundException

 

SDK only puts the DLL in bin/Release, if a customer needs build code in the debug folder, please make sure to copy bin/Release all data to bin/Debug and rebuild.

  1. Can’t Trace Code

If you want to trace code in Visual Studio, you need to modify the parameters of initEx() to LIBWFX_INIT_MODE_NOOCR; otherwise, PlustekOCR engine will bounce back the program and interrupt it during trace.

To use LIBWFX_INIT_MODE_NORMAL to trace, you can use the attach method:

Debug > Attach to Process > Select the name of the executable file and press Attach.

4.2.7 Can’t get RFID information of SecureScan X200

  1. Please install RFID module driver:

https://plustek.com/us/products/customized-scan-modules/securescan-x200/support.php   

  1. Set the command “recognize-type”: “passport” and scan for the RFID ID
  2. The RFID information as follows will be shown :

4.3 Return Message

4.3.1 Error Code

Reminder: With the SDK version being updated from 1.0.74 to 1.0.75, the SDK error codes have also been adjusted. Please check the SDK version first and then its corresponding error codes table. To check the SDK version, please refer to 4.1.1 General FAQ .

For SDK Version 1.1.xx.23335 and After

LIBWFX_ERRCODE_Message

%d

Message

Description

0

SUCCESS

There is no error.

1

FAIL

The device is not ready.

Please refer to 4.2.3 No Device for more information.

1) Check the Device Manager and ensure the computer is properly connected to the scanner (NOT in sleep mode as well) and can be recognized.

2) If the scanner can be found in the device manager, but still doesn’t show up in the Lib demo, please check its PID/VID in ProductName.dat List tab in the IssueDetector tool.

3) If the driver is installed correctly, open the scanner’s bundle application to check if the basic function is working properly.

Take SmartOffice PS286 for example.  Its bundled application is DocAction. The path is C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Plustek SmartOffice PS286 Plus V6.2.0.0. Open the DocAction, select button 1 to start scanning, and then the scanning result will be displayed directly.

4) Check if there are other Plustek applications opened at the same time in the task manager, such as DocAction, DocAction II, SecureScan...etc.

5) Check if the installed antivirus is blocking, and then check whether the current .exe file has been included in the Windows Virus & Threat Protection list.

6) Check Win10 or later Camera Privacy setting. Select Start button >[Start] button, select Settings > Privacy > Camera

Turn onEnable [Allow the apps to access your camera].

Please refer to 4.2.3 No Device.

2

NO_INIT

For more information, please refer to 4.2.1 Init Fail.

Generally speaking, the related environment settings might be the main reason to cause init failure.

Please check whether the Redistributable is correctly installed.

3

NOT_YET_OPEN_DEVICE

This means failure in opening the device. It may occur when

- performing related operations on the machine but the device has not been successfully opened; or

- failing in executing OpenDevice() api/GetDeviceCapabilityapi

The steps of checking are the same as LIBWFX_ERRCODE 1.

4

DEVICE_ALREADY_OPEN

There is no scanner connected with the computer. It may occur when:

- DiscoverDevices() fails; or

- the same machine has already been connected during OpenDevice().

The steps of checking are the same as LIBWFX_ERRCODE 1.

5

INVALID_SOURCE

This means the Open Device has failed during the set property stage.

The steps of checking are the same as LIBWFX_ERRCODE 1.

6

NO_ENABLE_THRESHOLD

-

7

NO_SUPPORT_THRESHOLD

-

8

NOT_YET_SET_SCAN_PROPERTY

Execute scan directly without having executed the set property action.

Please execute the set property action first.

9

NO_SET_RECOGNIZE_TOOL

The OCR engine corresponding to the recognition type has not been installed. Please check the installation status of the OCR engine which must meet the requirements of recognize-type.

Please refer to 4.2.4 OCR Mismatch & 4.2.5 No Recognize Result for more information.

10

OCR_NOT_SUPPORT_BOTTOMUP

-

11

READ_IMAGE_FAILED

Only available in the image reading mode of Lib SDK.

12

ONLY_SUPPORT_COLOR_MODE

The applycolorprofile command is set, but mode selection is not Color.

Please Set "mode":"color".

13

ICM_PROFILE_NOT_EXIST

The applycolorprofile command is set, but the profile file does not exist.

Please check if the profile path is correct.

14

NO_SUPPORT_EJECT

The scanner does not support backward-eject, but the backward-eject command is set.

Please check the module.

Backward-eject is supported in the following scanner models:

A4: S410 Plus , D430(only support for A8 size)

A6: D600 Plus, D620 .

15

NO_SUPPORT_JPEGXFER

The scanner is not PS3180 or PT2160, but the jpegxfer command is set.

Please confirm if the machine is PS3180 or PT2160 or not.

16

PAPER_NOT_READY

This message appears when the position of the ID card or passport is not aligned with the sensor.  Please make sure the edge of the ID card or passport is placed on the upper left or upper right corner of the scanner glass.

Note: The scanner shown in this illustration is only an example.  Your scanner may be a different model.

17

INVALID_SERIALNUM

This error might occur when the registration MAC Address is different from the actual MAC Address. Please run StarRegister.bat to check the MAC Address is still the same (no need to re-activate). If it is not the same, please unregister first and then reinsert license and register again to add the new MAC Address.

NOTE: To unregister, you need to do it on the same computer that you have registered successfully. The system will check the UUID. If it is not the same UUID, the unregister action will fail.

Next, check the Serial Number. This error happens when the registration is verified by the machine serial number, and the shipped machine doesn’t burn the serial number required for the corresponding identification type.

Please check the serial number of the machine and provide us with related information  . You can open the IssueDetector in the release folder and select DeviceList to view the machine serial number..              

18

DISCONNECT

This means the device switches from connected to disconnected status.

Check the scanner status in the device manager.

19

FORMAT_NOT_SUPPORT

This means the command format is wrong.

Please refer to the command table and ensure it’s a legal json format.

{"device-name":"656U","source":"ADF-Duplex", …}

(device-name, source are necessary fields)

20

NO_CALIBRATION_DATA

There is no calibration file.

Please check where the calibration file exists. Take A64 (SecureScan X-Mini) for example. Please go to

C:\ProgramData\Plustek\A64 to find the calibration files

*.SHD.

If the calibration file doesn't exist, please execute Calibrate again by using the API or the Calibration Wizard software bundled with the scanner.

Please refer to Lib Calibration for more information.

21

OCR_TOOL_NOT_SUPPORT

No recognition tool has been set.

Please check whether the parameter of initEx() is LIBWFX_INIT_MODE_NORMAL

(C++ is used as an example herein.)

22

RECOGNIZE_TYPE_NOT_SUPPORT

The recognition type is not supported.

1) Please refer to the command table to check whether the name is typed correctly, and the case must be consistent.

2) If it is a special profile, please refer to the file name under Release/Profile. The case must be the same.

23

INVALID_CERTICATE

The identification type is not authorized. Please contact our sales representative for the product authorization Key.

Please refer to 4.4 Register for more info.

24

AP_ALREADY_EXISIT

-

25

OPENs_REGISTRY_KEY_FAILED

-

26

LOAD_MRTD_FAILED

Connecting X200 to the computer after init caused an error (the init action of X200 was not performed).

Please restart the app, and make sure that the machine is connected before opening the app.

27

COVER_OPENED

The cover of the machine is not properly closed.

Check if the cover of the machine is tightly closed.

28

CERTIFICATE_EXPIRED

The checking flow of this error is the same as that of INVALID_CERTICATE.(LIBWFX_ERRCODE 23)

29

ALREADY_INIT

-

30

LIBWFX_ERRCODE_NO_SUPPORT_DUPLEX

Duplex is not supported as the source.

1001

NO_AVI_OCR

AVI OCR is not installed. (AVI is not mandatory but needs to be installed depending on the requirements.)

Please refer to OCR Mismatch & No Recognize Result for more info.

1002

NO_DOC_OCR

No DocOCR has been installed. (DocOCR is not mandatory but needs to be installed depending on the requirements.)

If DocOCR is needed, you may download and install DocOCR(Basic). If your language is not supported by DocOCR(Basic), please download and install both DocOCR(Basic) and DocOCR(Extend)  

DocOCR(Basic) support language: EN , DE , FR , PL , RU , pt_BR , IT , ES , zh_TW , zn_CN , JA ,  KOR , TR , ar_SA , etc…

1003

NO_OCR

Neither AVI OCR nor DOC OCR is installed. (Either is not mandatory but needs to be installed depending on the requirements.)

Please refer to OCR Mismatch & No Recognize Result for more info.

1004

NO_DEVICES

No machine is loaded. This error occurs when no machine is found when calling GetDevicesList() or GetDevicesListWithSerial().

This wrong Code will only return Message “Status:[No Devices Connected]”.The checking flow is the same as LIBWFX_ERRCODE 1.

1005

NO_DEVICE_NAME

The machine is found when calling GetDeviceList(), but the device-name value in the command is incorrect. Please make sure that the device-name field exists and the value is correct.

1006

NO_SOURCE

No value in source value command.

Add the “source” field to the command.

1007

FILE_NO_EXIST

When the RemoveFile action is executed, the file to be deleted does not exist.

Please make sure the file you want to delete exists.

1008

PATH_TOO_LONG

The executable file path exceeds the default value (ex: C:\Users\User\Desktop\123\MFC&C#&VB\Bin\Release\LibWFXDemo.exe), the default value is less than 130 characters

Please try to move the release folder to an appropriate path to reduce the number of folder layers.

1009

COMMAND_KEY_MISMATCH

Undefined command appears in command. Please modify the command, more detailed command please refer to Command Introduction

1010

SCANNING

Scan in progress.

Please wait for the end of the scan to perform other actions.

1011

FILE_OCCUPIED

When the RecycleSaveFolder is executed, the file or folder is occupied

1012

SAVEPATH_ERROR

When the RecycleSaveFolder is executed, the save path format error

1013

TIMEOUT

Timeout error

1014

SERVER_OCCUPIED

Server is occupied by other client

1015

SPECIFIC_AP_OPENING

The specific ap  under 'checkwindowtitle' in the LibWebFxscan.ini file have already been opened

1016

PARM_VALUE_MISMATCH

Undefined parameter value appears in command. Please modify the command, more detailed command please refer to Command Introduction.

1017

LIBWFX_ERRCODE_INVALID_FILE_FORMAT

Only image files(JPG, BMP, PNG) are allowed when using "MergePdf".

1018

INIT_DLL_NOT_FOUND

Failed to load DLL because the file was not found.

1019

INIT_DLL_LOAD_FA

ILED

DLL file exists but failed to load (may be corrupted or incompatible).

4.3.2 Event Code

When asynchronous is used and any of the following commands is enabled, Lib event callback will be triggered. (Synchronous will not have event callback notification.)

LIBWFX_EVENT_Message

%d

Message

Description

0

PAPER_DETECTED

Paper is detected.

1

NO_PAPER

No paper is detected.

2

PAPER_JAM

Paper jam.

3

MULTIFEED

Multiple sheets of paper stacked together are detected at the same time.

4

NO_CALIBRATION_DATA

There is no calibration data.

5

WARMUP_COUNTDOWN

The machine's standby time is up.

6

SCAN_PROGRESS

Returns the % value of the current SCAN Progress bar

7

BUTTON_DETECTED

Set the scan number from the machine, and press the button on the machine.

8

SCANNING

Scanning is in progress.

9

PAPER_FEEDING_ERROR

Paper feeding problem.

10

COVER_OPEN

The machine cover is not closed properly.

11

LEFT_SENSOR_DETECTED

The left sensor detects the paper.

12

RIGHT_SENSOR_DETECTED

The right sensor detects the paper.

13

ALL_SENSOR_DETECTED

All sensors detect paper.

14

UVSECURITY_DETECTED

UV is detected.

15

PLUG_UNPLUG

The machine lost connection.

16

OVER_TIME_SCAN

Paper timeout scan.

17

CANCEL_SCAN

The scanning process was interrupted abnormally.

18

CAMERA_RGB_DISLOCATION

The temperature is abnormal, resulting in abnormal image acquisition.

Only available to SecureScan X-Mini and X-Cube models.

19

CAMERA_TIMEOUT

This postback event is supported by v1.1.16.22403 and later versions. Available with Camera models only. It occurs when the program calls the machine but the machine does not respond.

4.3.3 Web2.0 Error/Event Code

Table

URL

Error Code

WebFXScan JS Library (aviswpm.github.io) -> ErrorCode Section

Event Code

WebFXScan JS Library (aviswpm.github.io) -> EventCode Section

4.3.4 IP Code

For the convenience of description, IP is referred to as Image Processing below.

Something wrong (%d)

Description

AVIIP_EXC_CODE_NONE (0)

index = 0, meaningless.  * The index is incremented next

AVIIP_EXC_CODE_IP_FINSIHED (1)

The IP action is completed and can be ignored.

AVIIP_EXC_CODE_TIFF_SAVE_FINISHED (2)

The tiff file is save complete and can be ignored.

AVIIP_EXC_CODE_SAVE_FILE_FINISHED (3)

The scanned file is save complete and can be ignored.

AVIIP_EXC_CODE_RECOGNIZE_TEXT_FINISHED (4)

The recognition file is save complete and can be ignored.

AVIIP_EXC_CODE_PDF_SAVE_FINISHED (5)

The pdf file is save complete and can be ignored.

AVIIP_EXC_CODE_IP_QUEUE_FULL (6)

The IP queue is full, usually when full text recognition is enabled. The scanner is still being scanned for new paper during the recognition process which causes the queue to be full. If you want to avoid this error you can edit the .ini file, but do not suggest editing by yourself, please connect us for more detailed parameters.

AVIIP_EXC_CODE_RENAME (7)

Debug message which can be ignored

AVIIP_EXC_CODE_RECOGNIZE_RESULT_OUTPUT (8)

The recognized result has been generated and can be ignored.

AVIIP_EXC_CODE_OUT_OF_MEM (9)

Out of memory

AVIIP_EXC_CODE_OVER_DIGITAL_LIMIT (10)

The set digits number of the file name exceeds.

AVIIP_EXC_CODE_DETECT_BLANK_PAGE (11)

A blank page is detected and can be ignored.

AVIIP_EXC_CODE_APPLY_CROP_FAILED (12)

Failed to crop manually

AVIIP_EXC_CODE_APPLY_AUTOCROP_FAILED (13)

Failed to  crop automatically

AVIIP_EXC_CODE_APPLY_AUTODESKEW_FAILED (14)

Auto-deskew failed

AVIIP_EXC_CODE_APPLY_COLOR_MATCH_FAILED (15)

Failed to apply color matching function

AVIIP_EXC_CODE_APPLY_DESCREEN_FAILED (16)

Failed to descreen

AVIIP_EXC_CODE_APPLY_REMOVE_PUNCH_HOLE_FAILED (17)

Failed to remove the punch hole

AVIIP_EXC_CODE_APPLY_DETECT_BLANK_PAGE_FAILED (18)

Failed to remove the detected blank page

AVIIP_EXC_CODE_APPLY_AUTOROTATE_FAILED (19)

Failed to auto rotate

AVIIP_EXC_CODE_APPLY_OCR_RECOGNIZE_TEXT_FAILED (20)

The full text recognition failed

AVIIP_EXC_CODE_APPLY_OCR_RECOGNIZE_TEXT_OUTPUT_FAILED (21)

Failed to generate the recognition file for full text recognition

AVIIP_EXC_CODE_APPLY_DOC_AREA_RECOGNIZE_FAILED (22)

Failed to zonal recognize and analyze

AVIIP_EXC_CODE_APPLY_BARCODE_FAILED (23)

Failed to recognize barcode

AVIIP_EXC_CODE_APPLY_AUTODENSITY_FAILED (24)

Failed to increase the image contrast

AVIIP_EXC_CODE_APPLY_REMOVE_BACKGROUND_FAILED (25)

Failed to remove the background

AVIIP_EXC_CODE_APPLY_DENOISE_FAILED (26)

Noise reduction failed

AVIIP_EXC_CODE_APPLY_SHARPEN_FAILED (27)

Image sharpening failed

AVIIP_EXC_CODE_APPLY_ROTATE_FAILED (28)

Rotation Angle adjustment failed

AVIIP_EXC_CODE_APPLY_RESIZE_FAILED (29)

An error occurred while adjusting scale IP

AVIIP_EXC_CODE_APPLY_HISTOGRAM_FAILED (30)

Failed to process the histogram

AVIIP_EXC_CODE_APPLY_BIRGHTNESS_FAILED (31)

Failed to adjust brightness

AVIIP_EXC_CODE_APPLY_CONTRAST_FAILED (32)

Failed to adjust the contrast

AVIIP_EXC_CODE_APPLY_GAMMA_FAILED (33)

Failed to adjust the gamma value

AVIIP_EXC_CODE_APPLY_REDTYPE_ENHANCE_FAILED (34)

Failed to enhance the red header of the file (the image would only have red, black and white, this is the demand from China market)

AVIIP_EXC_CODE_APPLY_THRESHOLD_FAILED (35)

Failed to threshold

AVIIP_EXC_CODE_APPLY_FILLEDGECOLOR_FAILED (36)

Failed to fill in the specified color in the inner ring

AVIIP_EXC_CODE_APPLY_FROEGROUND_BOLDNESS_FAILED (37)

The foreground enhancement failed.

AVIIP_EXC_CODE_APPLY_RECOGNIZE_FAILED (38)

Recognition failed.

AVIIP_EXC_CODE_APPLY_WATERMARK_FAILED (39)

Failed to embed the watermark.

AVIIP_EXC_CODE_APPLY_BORDER_FILL_FAILED (40)

Failed to find complementary color in inner circle

AVIIP_EXC_CODE_APPLY_AUTOENHANCE_FAILED (41)

Automatic enhancement failed.

AVIIP_EXC_CODE_APPLY_DETECT_UVSECURITY_FAILED (42)

UV detection failed.

AVIIP_EXC_CODE_APPLY_PHOTOZONE_FORM_FAILED (43)

Failed to capture a specific ID portrait photo.

AVIIP_EXC_CODE_APPLY_CHROMA_SUBSAMPLING_FAILED (44)

Failed to remove color pattern (Moiré pattern).

AVIIP_EXC_CODE_APPLY_DOCUMENT_ANALYSIS_FAILED (45)

File analysis (ABBYY) failed.

AVIIP_EXC_CODE_APPLY_SMOOTH_BACKGROUND_FAILED (46)

Failed to smooth the background.

AVIIP_EXC_CODE_APPLY_DESKEW_CROP_BY_BORDER_FAILED (47)

(This is to test the IFDA function without parameters and not used).

AVIIP_EXC_CODE_APPLY_AUTO_ORIENTATION_FAILED (48)

(This is to test the IFDA function without parameters and not used).

AVIIP_EXC_CODE_APPLY_COLOR_DROPPEDOUT_FAILED (49)

Failed to execute color dropped out.

AVIIP_EXC_CODE_APPLY_COLOR_ONLY_FAILED (50)

(This is to test the IFDA function without parameters and not used).

AVIIP_EXC_CODE_APPLY_OPTIMIAZTION_FAILED (51)

Failed to perform image optimization.

AVIIP_EXC_CODE_APPLY_ANTI_RED_EYE_FAILED (52)

No actual correspondence can be ignored.

AVIIP_EXC_CODE_APPLY_DUST_SCRATCH_FAILED (53)

No actual correspondence can be ignored.

AVIIP_EXC_CODE_APPLY_ZONE_RECOGNIZE_FAILED (54)

Fail to zone recognize.The zonal recognition will find the anchor point first according to the parameters. Search for the specific area corresponding to the anchor point

AVIIP_EXC_CODE_SAVE_FILE_FAILED (55)

Fail to save the file, you can first confirm whether the storage folder exists. If so, it is usually related to the error of the saving identification result.

AVIIP_EXC_CODE_RESIZE_FAILED (56)

An error occurred when Resize was used in other IPs.

AVIIP_EXC_CODE_CONVERT_GRAY_FAILED (57)

Failed to convert gray scale.

AVIIP_EXC_CODE_CONVERT_BW_FAILED (58)

Failed to convert to black and white.

AVIIP_EXC_CODE_IP_NO_IMAGE (59)

No image.

AVIIP_EXC_CODE_FILE_EXISTED (60)

Debug message which can be ignored

AVIIP_EXC_CODE_LIGHT_TYPE_G (61)

Debug message which can be ignored

AVIIP_EXC_CODE_LIGHT_TYPE_IR (62)

Debug message which can be ignored

AVIIP_EXC_CODE_LIGHT_TYPE_UV (63)

Debug message which can be ignored

AVIIP_EXC_CODE_UVSECURITY (64)

UV is detected. Debug message which can be ignored

AVIIP_EXC_CODE_NO_UVSECURITY (65)

UV is not detected. Debug message which can be ignored

AVIIP_EXC_CODE_CAMERACALIBRATE_FAILED (66)

Camera calibration failed

AVIIP_EXC_CODE_APPLY_SHADING_DATA_FALIED (67)

Failed to execute calibration file

AVIIP_EXC_CODE_APPLY_EXTENDBORDER_FAILED (68)

When AddBorder is executed, it fails to extend the edge outward.

AVIIP_EXC_CODE_AVIRECOGNIZE_DLL_LOAD_FAILED (69)

Failed to load AviRecognize.dll.

AVIIP_EXC_CODE_APPLY_REMAINBLACKWHITE_FAILED (70)

Only the black and white and the close part of the color fail.

AVIIP_EXC_CODE_APPLY_COLORREMOVEREMAIN_FAILED (71)

Failed to remove/retain the specified color.

AVIIP_EXC_CODE_APPLY_DUPLEXMERGE_FAILED (72)

Merging of the front and rear scan images failed.

AVIIP_EXC_CODE_APPLY_BORDER_AUTO_FILL_FAILED (73)

(This is to test the IFDA function, no parameters, no use)

AVIIP_EXC_CODE_APPLY_OCR_RECOGNIZE_TEXT_OUTPUT_MULTIPAGEMODE_FAILED (74)

An error occurred during full-text recognition and output of multi-page files.

AVIIP_EXC_CODE_OCR_RECOGNIZE_TEXT_OUTPUT_FINISHED (75)

Debug message which can be ignored

AVIIP_EXC_CODE_APPLY_CONVERTTOHSL_FAILED (76)

Failed to convert to HSL color image.

AVIIP_EXC_CODE_APPLY_SMOOTH_FAILED (77)

Smoothing failed.

AVIIP_EXC_CODE_APPLY_VALUEINVERT_FAILED (78)

The image value inversion (example 0 --->255 255 ---> 0) failed.

AVIIP_EXC_CODE_APPLY_FLIP_FAILED (79)

Failed to flip image in vertical or horizontal.

AVIIP_EXC_CODE_APPLY_MATCHIMAGETOSIZE_FAILED (80)

Failed to fill the offset of the image pair to the set size according to the parameters.

AVIIP_EXC_CODE_APPLY_STREAKCOMPENSATE_FAILED (81)

Failed to remove straight lines.

AVIIP_EXC_CODE_APPLY_MULTICROP_FAILED (82)

Multiple cropping failed.

AVIIP_EXC_CODE_APPLY_SPLIT_FAILED (83)

Splitting failed.

AVIIP_EXC_CODE_APPLY_NORMALIZE_FAILED (84)

The image normalization failed.

AVIIP_EXC_CODE_APPLY_CONVERTIMAGEBUFFER_FAILED (85)

Failed to adjust the arrangement of the data in the temporary image storage according to the parameters.

AVIIP_EXC_CODE_APPLY_CUSTOMPHOTOZONE_FAILED (86)

Failed to capture portrait photo.It usually happens when "photo":true is executed. This action can only be supported with specific cards. If you execute an unsupported card, this error message will pop up.

AVIIP_EXC_CODE_APPLY_IMAGESMATCH_FAILED (87)

The image matching failed.

4.4 Register

You can choose either of the following to register:  

 

  1. License Key Registration 

 

  1. Register with Scanner Serial Number 

If you have any problems about the Register key, please contact our local sales staff.

4.4.1 License Key Registration

The methods of registering License Key online (via the internet) for Lib SDK and Web SDK are different, but their methods are the same for offline registration.  Details will be explained as follows.

Please note the Mac and UUID of the computer will be bound in case of the License Key (xxx.lic) registration.  If you want to change the computer, you need to first unbind the license key from the original computer, and then re-bind it on another computer.

Each License Key can only be used on one computer at the same time.  There is no restriction on the scanner to be used with, as long as it is a Plustek scanner.

Please make sure that “Random hardware addresses” is turned off.

Otherwise, Lic registration may not be available.

Online Registration for Lib SDK

  1. Run LibWFXDemo.exe and click the register icon on the upper right corner

  1. Select License Key and click Register

  1. Import license and select Register

Note:Each license can only be used on one computer. Please ensure to unregister from the original computer first, if you need to change the computer. To unregister the license, you need to do it on the same computer that was successfully registered. The system will check the UUID. If it is not the same UUID, the unregistered action will fail.

  1. If the online registration is successful, you can check the license expiration date on this tool.

Online Registration for Web SDK

  1. Starting from v1.1.16.22403, the Web SDK registration is available in two ways:
  1. Go to the installation folder,

Right click the Webscan icon and click “activate”

  1. Double click the StartRegister.bat.

  1. Select License Key and click Register

  1. Import the License file and click Register.

Note: Each license file can only be used on one computer. Please ensure to unregister from the original computer first, if you need to change the computer. To unregister the license, you need to do it on the same computer that was successfully registered. The system will check the UUID. If it is not the same, the unregistered operation will fail.

  1. If the online registration is successful, you can check the license expiration date in this tool.

Online UnRegistration for Lib SDK

  1. Run LibWFXDemo.exe and click the register icon on the upper right corner

  1. Select License Key and click Register


  1.  Click UnRegister

  1. If the online unregister is successful, you can check the license expiration date in this tool.

Note:If you want to unregister, you need to do it on the same computer that was successfully registered. The system will check the UUID. If it is not the same UUID, the unregistered action will fail.

Offline Registration (For Lib SDK and Web SDK)

  1. Copy the Plustek Offline Register Tool to a USB flash drive.

Please unplug the network cable directly to ensure that the device cannot be connected to the Internet.

  1. Run Plustek Offline Register Tool on flash drive at an internet offline PC. This tool needs to "Save" the MAC Address , Host UUID and License for offline Register or UnRegister.

  1. Move USB DISK to another network available PC and run Register Tool again.  

This step is to register for the offline PC.

Select the “Register” URL and when register is done will see the following windows. It means the register is OK.

  1. Move the USB DISK back to the offline PC to install, then run the Plustek Offline Register Tool again. If this License is already registered, the Action will display UnRegister. The process of the Unregisgter and registration is the same, if you want to unregister please select the UnRegister..

Note: If you want to unregister, you need to do it on the same computer that was successfully registered. The system will check the UUID. If it is not the same UUID, the unregister action will fail.

  1. Run the Offline Register Tool on offline PC see follow windows and select install   

to install the certificate.

  1. See the message box “Action Completed”, the offline registration is done.


4.4.2 Register with Scanner Serial Number

Besides the aforementioned License Key registration method, the SDK also provides registration by machine serial number.  The MAC and UUID of the computer are not bound if you register by machine serial number. When you change the computers, you only need to re-register for authorization.

When using the SDK, please ensure the registered machine is properly connected to the computer, and only the machine that has been registered can be used.

Before using this method to register, please confirm with your Plustek account manager that the serial number of the machine must have been activated on the Plustek registration server.

Online Registration

Using Demo UI

  1. Run LibWFXDemo.exe and click the register icon on the upper right corner

  1. Select Serial Number and click Register

  1. Click “Yes” to unregister the previous key(if any)

Using Command Line

  1. Enter the command as follows:

cd LicenseRegister.exe file folder path

Example:  

  1. Enter the following command to start the registration:

LicenseRegister.exe AVISDK serial_number machine serial number

Example:  LicenseRegister.exe AVISDK serial_number 15A61A4000167

The machine Serial Number can be obtained by the following API:

  1. To check if the registration is successful or not, you can view the registration application program interface or API:

Offline Registration

If you need to register offline, please contact us.

To query the serial number burned into the scanner, you can use the IssueDetector tool to view the scanner serial number(s) listed under DeviceList. If the INVALID_CERTICATE error occurs, it is usually because the machine has not been burned with the serial number.

For Lib SDK  v1.1.14.22074 and later versions, the Demo program has been added with the relevant information of the scanner serial number(s).  You can also query by this method.


Plustek Inc. Confidential