LibWebFXScan.h File Reference

The SDK interface of LibWebFXScan is used to develop the client application. More...

Go to the source code of this file.

Macros

#define  LIBWFX_API
#define  LIBWFX_DLLNAME   _T("LibWebFXScan.dll")
#define  LIBWFX_API_INIT   "LibWFX_Init"
#define  LIBWFX_API_DEINIT   "LibWFX_DeInit"
#define  LIBWFX_API_GET_DEVICESLIST   "LibWFX_GetDeviesList"
#define  LIBWFX_API_GET_FILELIST   "LibWFX_GetFileList"
#define  LIBWFX_API_REMOVE_FILE   "LibWFX_RemoveFile"
#define  LIBWFX_API_SET_PROPERTY   "LibWFX_SetProperty"
#define  LIBWFX_API_START_SCAN   "LibWFX_StartScan"
#define  LIBWFX_API_CALIBRATE   "LibWFX_Calibrate"
#define  LIBWFX_API_ECOCONTROL   "LibWFX_ECOControl"
#define  LIBWFX_API_PAPER_READY   "LibWFX_PaperReady"
#define  LIBWFX_API_CLOSE_DEVICE   "LibWFX_CloseDevice"

Typedefs

typedef enum _ENUM_LIBWFX_ERRCODE  ENUM_LIBWFX_ERRCODE
  The error code of LibWebFXScan. More...
typedef enum _ENUM_LIBWFX_EVENT_CODE  ENUM_LIBWFX_EVENT_CODE
  The feedback of event from LIBWFXEVENTCB callback function. More...
typedef enum _ENUM_LIBWFX_EXCEPTION_CODE  ENUM_LIBWFX_EXCEPTION_CODE
  If the feedback of exception from LIBWFXCB callback function and _ENUM_LIBWFX_NOTIFY_CODE is , then pParam1 will return ENUM_LIBWFX_EXCEPTION_CODE type. More...
typedef enum _ENUM_LIBWFX_NOTIFY_CODE  ENUM_LIBWFX_NOTIFY_CODE
  The feedback of notify from LIBWFXCB callback function after scanning. More...
typedef void(*  LIBWFXEVENTCB) (ENUM_LIBWFX_EVENT_CODE enEventCode, int nParam, void *pUserDef)
  The LIBWFXEVENTCB() type defines a pointer to this callback function. LIBWFX_SETPROPERTY() is a placeholder for the application-defined function name. More...
typedef void(*  LIBWFXCB) (ENUM_LIBWFX_NOTIFY_CODE enNotifyCode, void *pUserDef, void *pParam1, void *pParam2)
  The LIBWFXCB() type defines a pointer to this callback function. LIBWFX_STARTSCAN() is a placeholder for the application-defined function name. More...
typedef ENUM_LIBWFX_ERRCODE(LIBWFX_API LIBWFX_INIT) (void)
  Init the LibWebFXScan SDK . More...
typedef ENUM_LIBWFX_ERRCODE(LIBWFX_API LIBWFX_DEINIT) (void)
  Deinit the LibWebFXScan SDK . More...
typedef ENUM_LIBWFX_ERRCODE(LIBWFX_API LIBWFX_GETDEVICESLIST) (const char **szDevicesListOut)
  Get devices list. More...
typedef ENUM_LIBWFX_ERRCODE(LIBWFX_API LIBWFX_GETFILELIST) (const char **szFileListOut)
  Get the imagefile list, but no including tif and pdf. More...
typedef ENUM_LIBWFX_ERRCODE(LIBWFX_API LIBWFX_REMOVEFILE) (char *szFileNameIn)
  Remove the specified file by filename, e.g. "IMG_1.jpg", "*"(delete all file) More...
typedef ENUM_LIBWFX_ERRCODE(LIBWFX_API LIBWFX_SETPROPERTY) (char *szRequestCmdIn, LIBWFXEVENTCB pfnLibWFXEVENTCBIn, void *pUserDefIn)
  Set the property of SDK, LibWebFXScan must do LIBWFX_SETPROPERTY before LIBWFX_STARTSCAN. More...
typedef ENUM_LIBWFX_ERRCODE(LIBWFX_API LIBWFX_STARTSCAN) (LIBWFXCB pfnLibWFXCBIn, void *pUserDefIn)
  To start do scan. More...
typedef ENUM_LIBWFX_ERRCODE(LIBWFX_API LIBWFX_CALIBRATE) (void)
  To do calibrate. More...
typedef ENUM_LIBWFX_ERRCODE(LIBWFX_API LIBWFX_ECOCONTROL) (unsigned long *pulTime, int nSetIn)
  To set or get ECO time. More...
typedef ENUM_LIBWFX_ERRCODE(LIBWFX_API LIBWFX_PAPERREADY) (void)
  To check whether the device feed the paper. More...
typedef ENUM_LIBWFX_ERRCODE(LIBWFX_API LIBWFX_CLOSEDEVICE) (void)
  To close device currently. More...

Enumerations

enum   _ENUM_LIBWFX_ERRCODE {
  LIBWFX_ERRCODE_SUCCESS = 0, LIBWFX_ERRCODE_FAIL, LIBWFX_ERRCODE_NO_INIT, LIBWFX_ERRCODE_NO_RECOGNIZE_TOOL,
  LIBWFX_ERRCODE_NO_DEVICES, LIBWFX_ERRCODE_FORMAT_ERROR, LIBWFX_ERRCODE_NO_DEVICE_NAME, LIBWFX_ERRCODE_NO_SOURCE,
  LIBWFX_ERRCODE_FILE_NO_EXIST, LIBWFX_ERRCODE_PAPER_NOT_READY, LIBWFX_ERRCODE_INVALID_SERIALNUM
}
  The error code of LibWebFXScan. More...
enum   _ENUM_LIBWFX_EVENT_CODE {
  LIBWFX_EVENT_PAPER_DETECTED = 0, LIBWFX_EVENT_NO_PAPER, LIBWFX_EVENT_PAPER_JAM, LIBWFX_EVENT_MULTIFEED,
  LIBWFX_EVENT_NO_CALIBRATION_DATA, LIBWFX_EVENT_WARMUP_COUNTDOWN
}
  The feedback of event from LIBWFXEVENTCB callback function. More...
enum   _ENUM_LIBWFX_EXCEPTION_CODE { LIBWFX_EXC_OTHER = 0, LIBWFX_EXC_TIFF_SAVE_FINSIHED, LIBWFX_EXC_PDF_SAVE_FINSIHED }
  If the feedback of exception from LIBWFXCB callback function and _ENUM_LIBWFX_NOTIFY_CODE is , then pParam1 will return ENUM_LIBWFX_EXCEPTION_CODE type. More...
enum   _ENUM_LIBWFX_NOTIFY_CODE { LIBWFX_NOTIFY_IMAGE_DONE = 0, LIBWFX_NOTIFY_END, LIBWFX_NOTIFY_EXCEPTION }
  The feedback of notify from LIBWFXCB callback function after scanning. More...

Detailed Description

The SDK interface of LibWebFXScan is used to develop the client application.

Date
2017-06-09
Author
Jack Chen

Definition in file LibWebFXScan.h.

Macro Definition Documentation

 LIBWFX_API

#define LIBWFX_API

Definition at line 16 of file LibWebFXScan.h.

 LIBWFX_API_CALIBRATE

#define LIBWFX_API_CALIBRATE   "LibWFX_Calibrate"

Reference LIBWFX_CALIBRATE

Definition at line 28 of file LibWebFXScan.h.

 LIBWFX_API_CLOSE_DEVICE

#define LIBWFX_API_CLOSE_DEVICE   "LibWFX_CloseDevice"

Reference LIBWFX_CLOSEDEVICE

Definition at line 31 of file LibWebFXScan.h.

 LIBWFX_API_DEINIT

#define LIBWFX_API_DEINIT   "LibWFX_DeInit"

Reference LIBWFX_DEINIT

Definition at line 22 of file LibWebFXScan.h.

 LIBWFX_API_ECOCONTROL

#define LIBWFX_API_ECOCONTROL   "LibWFX_ECOControl"

Reference LIBWFX_ECOCONTROL

Definition at line 29 of file LibWebFXScan.h.

 LIBWFX_API_GET_DEVICESLIST

#define LIBWFX_API_GET_DEVICESLIST   "LibWFX_GetDeviesList"

Reference LIBWFX_GETDEVICESLIST

Definition at line 23 of file LibWebFXScan.h.

 LIBWFX_API_GET_FILELIST

#define LIBWFX_API_GET_FILELIST   "LibWFX_GetFileList"

Reference LIBWFX_GETFILELIST

Definition at line 24 of file LibWebFXScan.h.

 LIBWFX_API_INIT

#define LIBWFX_API_INIT   "LibWFX_Init"

Reference LIBWFX_INIT

Definition at line 21 of file LibWebFXScan.h.

 LIBWFX_API_PAPER_READY

#define LIBWFX_API_PAPER_READY   "LibWFX_PaperReady"

Reference LIBWFX_PAPERREADY

Definition at line 30 of file LibWebFXScan.h.

 LIBWFX_API_REMOVE_FILE

#define LIBWFX_API_REMOVE_FILE   "LibWFX_RemoveFile"

Reference LIBWFX_REMOVEFILE

Definition at line 25 of file LibWebFXScan.h.

 LIBWFX_API_SET_PROPERTY

#define LIBWFX_API_SET_PROPERTY   "LibWFX_SetProperty"

Reference LIBWFX_SETPROPERTY

Definition at line 26 of file LibWebFXScan.h.

 LIBWFX_API_START_SCAN

#define LIBWFX_API_START_SCAN   "LibWFX_StartScan"

Reference LIBWFX_STARTSCAN

Definition at line 27 of file LibWebFXScan.h.

 LIBWFX_DLLNAME

#define LIBWFX_DLLNAME   _T("LibWebFXScan.dll")

Definition at line 19 of file LibWebFXScan.h.

Typedef Documentation

 ENUM_LIBWFX_ERRCODE

The error code of LibWebFXScan.

 ENUM_LIBWFX_EVENT_CODE

The feedback of event from LIBWFXEVENTCB callback function.

 ENUM_LIBWFX_EXCEPTION_CODE

If the feedback of exception from LIBWFXCB callback function and _ENUM_LIBWFX_NOTIFY_CODE is , then pParam1 will return ENUM_LIBWFX_EXCEPTION_CODE type.

 ENUM_LIBWFX_NOTIFY_CODE

The feedback of notify from LIBWFXCB callback function after scanning.

 LIBWFX_CALIBRATE

typedef ENUM_LIBWFX_ERRCODE(LIBWFX_API* LIBWFX_CALIBRATE) (void)

To do calibrate.

Return values
LIBWFX_ERRCODE_SUCCESS success
LIBWFX_ERRCODE_XXX failed
Returns
If no error occurs, LIBWFX_CALIBRATE() return LIBWFX_ERRCODE_SUCCESS Otherwise, the specific error code can be retrieved by enum _ENUM_LIBWFX_ERRCODE
Note
none
Date
2017-06-09

Definition at line 201 of file LibWebFXScan.h.

 LIBWFX_CLOSEDEVICE

typedef ENUM_LIBWFX_ERRCODE(LIBWFX_API* LIBWFX_CLOSEDEVICE) (void)

To close device currently.

Return values
LIBWFX_ERRCODE_SUCCESS success
LIBWFX_ERRCODE_XXX failed
Returns
If no error occurs, LIBWFX_CLOSEDEVICE() return LIBWFX_ERRCODE_SUCCESS Otherwise, the specific error code can be retrieved by enum _ENUM_LIBWFX_ERRCODE
Note
none
Date
2017-06-09

Definition at line 236 of file LibWebFXScan.h.

 LIBWFX_DEINIT

typedef ENUM_LIBWFX_ERRCODE(LIBWFX_API* LIBWFX_DEINIT) (void)

Deinit the LibWebFXScan SDK .

Return values
LIBWFX_ERRCODE_SUCCESS success
LIBWFX_ERRCODE_XXX failed
Returns
If no error occurs, LIBWFX_DEINIT() return LIBWFX_ERRCODE_SUCCESS Otherwise, the specific error code can be retrieved by enum _ENUM_LIBWFX_ERRCODE
Note
none
Date
2017-06-09

Definition at line 127 of file LibWebFXScan.h.

 LIBWFX_ECOCONTROL

typedef ENUM_LIBWFX_ERRCODE(LIBWFX_API* LIBWFX_ECOCONTROL) (unsigned long *pulTime, int nSetIn)

To set or get ECO time.

Parameters
[in] pulTime the ECO time, if the time is 0 in set mode, the device will never go to sleep
[in] nSetIn 0: Get, 1:Set
Return values
LIBWFX_ERRCODE_SUCCESS success
LIBWFX_ERRCODE_XXX failed
Returns
If no error occurs, LIBWFX_ECOCONTROL() return LIBWFX_ERRCODE_SUCCESS Otherwise, the specific error code can be retrieved by enum _ENUM_LIBWFX_ERRCODE
Note
none
Date
2017-06-09

Definition at line 214 of file LibWebFXScan.h.

 LIBWFX_GETDEVICESLIST

typedef ENUM_LIBWFX_ERRCODE(LIBWFX_API* LIBWFX_GETDEVICESLIST) (const char **szDevicesListOut)

Get devices list.

Parameters
[out] szDevicesListOut the json string format that including all devices name, e.g. ["7C1U","65JU",...]
Return values
LIBWFX_ERRCODE_SUCCESS success
LIBWFX_ERRCODE_XXX failed
Returns
If no error occurs, LIBWFX_GETDEVICESLIST() return LIBWFX_ERRCODE_SUCCESS Otherwise, the specific error code can be retrieved by enum _ENUM_LIBWFX_ERRCODE
Note
none
Date
2017-06-09

Definition at line 139 of file LibWebFXScan.h.

 LIBWFX_GETFILELIST

typedef ENUM_LIBWFX_ERRCODE(LIBWFX_API* LIBWFX_GETFILELIST) (const char **szFileListOut)

Get the imagefile list, but no including tif and pdf.

Parameters
[out] szFileListOut the json string format that including all image file name, e.g. ["IMG1.jpg","IMG2.jpg",...]
Return values
LIBWFX_ERRCODE_SUCCESS success
LIBWFX_ERRCODE_XXX failed
Returns
If no error occurs, LIBWFX_GETFILELIST() return LIBWFX_ERRCODE_SUCCESS Otherwise, the specific error code can be retrieved by enum _ENUM_LIBWFX_ERRCODE
Note
none
Date
2017-06-09

Definition at line 151 of file LibWebFXScan.h.

 LIBWFX_INIT

typedef ENUM_LIBWFX_ERRCODE(LIBWFX_API* LIBWFX_INIT) (void)

Init the LibWebFXScan SDK .

Return values
LIBWFX_ERRCODE_SUCCESS success
LIBWFX_ERRCODE_XXX failed
Returns
If no error occurs, LIBWFX_INIT() return LIBWFX_ERRCODE_SUCCESS Otherwise, the specific error code can be retrieved by enum _ENUM_LIBWFX_ERRCODE
Note
none
Date
2017-06-09

Definition at line 116 of file LibWebFXScan.h.

 LIBWFX_PAPERREADY

typedef ENUM_LIBWFX_ERRCODE(LIBWFX_API* LIBWFX_PAPERREADY) (void)

To check whether the device feed the paper.

Return values
LIBWFX_ERRCODE_SUCCESS success
LIBWFX_ERRCODE_XXX failed
Returns
If no error occurs, LIBWFX_PAPERREADY() return LIBWFX_ERRCODE_SUCCESS Otherwise, the specific error code can be retrieved by enum _ENUM_LIBWFX_ERRCODE
Note
none
Date
2017-06-09

Definition at line 225 of file LibWebFXScan.h.

 LIBWFX_REMOVEFILE

typedef ENUM_LIBWFX_ERRCODE(LIBWFX_API* LIBWFX_REMOVEFILE) (char *szFileNameIn)

Remove the specified file by filename, e.g. "IMG_1.jpg", "*"(delete all file)

Parameters
[in] szFileNameIn the file name or "*"
Return values
LIBWFX_ERRCODE_SUCCESS success
LIBWFX_ERRCODE_XXX failed
Returns
If no error occurs, LIBWFX_REMOVEFILE() return LIBWFX_ERRCODE_SUCCESS Otherwise, the specific error code can be retrieved by enum _ENUM_LIBWFX_ERRCODE
Note
none
Date
2017-06-09

Definition at line 163 of file LibWebFXScan.h.

 LIBWFX_SETPROPERTY

typedef ENUM_LIBWFX_ERRCODE(LIBWFX_API* LIBWFX_SETPROPERTY) (char *szRequestCmdIn, LIBWFXEVENTCB pfnLibWFXEVENTCBIn, void *pUserDefIn)

Set the property of SDK, LibWebFXScan must do LIBWFX_SETPROPERTY before LIBWFX_STARTSCAN.

Parameters
[in] szRequestCmdIn the command is the json string format, please download document json_command_table.xlsx
[in] pfnLibWFXEVENTCBIn the event callback function, LIBWFXEVENTCB()
[in] pUserDefIn the user define date
Return values
LIBWFX_ERRCODE_SUCCESS success
LIBWFX_ERRCODE_XXX failed
Returns
If no error occurs, LIBWFX_SETPROPERTY() return LIBWFX_ERRCODE_SUCCESS Otherwise, the specific error code can be retrieved by enum _ENUM_LIBWFX_ERRCODE
Note
none
Date
2017-06-09

Definition at line 177 of file LibWebFXScan.h.

 LIBWFX_STARTSCAN

typedef ENUM_LIBWFX_ERRCODE(LIBWFX_API* LIBWFX_STARTSCAN) (LIBWFXCB pfnLibWFXCBIn, void *pUserDefIn)

To start do scan.

Parameters
[in] pfnLibWFXCBIn the notify callback function, LIBWFXCB()
[in] pUserDefIn the user define date
Return values
LIBWFX_ERRCODE_SUCCESS success
LIBWFX_ERRCODE_XXX failed
Returns
If no error occurs, LIBWFX_STARTSCAN() return LIBWFX_ERRCODE_SUCCESS Otherwise, the specific error code can be retrieved by enum _ENUM_LIBWFX_ERRCODE
Note
none
Date
2017-06-09

Definition at line 190 of file LibWebFXScan.h.

 LIBWFXCB

typedef void(* LIBWFXCB) (ENUM_LIBWFX_NOTIFY_CODE enNotifyCode, void *pUserDef, void *pParam1, void *pParam2)

The LIBWFXCB() type defines a pointer to this callback function. LIBWFX_STARTSCAN() is a placeholder for the application-defined function name.

Parameters
[out] enNotifyCode the notify code, please reference enum _ENUM_LIBWFX_NOTIFY_CODE
[out] pUserDef the user define data
[out] pParam1 case 1: the enNotifyCode is LIBWFX_NOTIFY_IMAGE_DONE, pParam1: image path string(ANSI char *), pParam2: the result of recognize((char *)UTF8 json string)
case 2: the enNotifyCode is LIBWFX_NOTIFY_EXCEPTION, pParam1: _ENUM_LIBWFX_EXCEPTION_CODE, pParam2: image filename string((char *)ANSI string)
case 3: the enNotifyCode is LIBWFX_NOTIFY_END, pParam1: NULL, pParam2: NULL
[out] pParam2 please reference pParam1 description
Date
2017-06-09

Definition at line 105 of file LibWebFXScan.h.

 LIBWFXEVENTCB

typedef void(* LIBWFXEVENTCB) (ENUM_LIBWFX_EVENT_CODE enEventCode, int nParam, void *pUserDef)

The LIBWFXEVENTCB() type defines a pointer to this callback function. LIBWFX_SETPROPERTY() is a placeholder for the application-defined function name.

Parameters
[out] enEventCode the event code, please reference enum _ENUM_LIBWFX_EVENT_CODE
[out] nParam none
[out] pUserDef the user define data
Date
2017-06-09

Definition at line 92 of file LibWebFXScan.h.

Enumeration Type Documentation

 _ENUM_LIBWFX_ERRCODE

The error code of LibWebFXScan.

Enumerator
LIBWFX_ERRCODE_SUCCESS 

The function is performed successfully

LIBWFX_ERRCODE_FAIL 

The function performed to failure

LIBWFX_ERRCODE_NO_INIT 

The SDK is not yet do initialize

LIBWFX_ERRCODE_NO_RECOGNIZE_TOOL 

The SDK can not set OCR engine, please install OCR engine

LIBWFX_ERRCODE_NO_DEVICES 

No devices are connecting

LIBWFX_ERRCODE_FORMAT_ERROR 

The format of json string is invalid

LIBWFX_ERRCODE_NO_DEVICE_NAME 

The json string command must include "device-name" item

LIBWFX_ERRCODE_NO_SOURCE 

The json string command must include "source" item

LIBWFX_ERRCODE_FILE_NO_EXIST 

The specified file name is not exist when removing files

LIBWFX_ERRCODE_PAPER_NOT_READY 

The device is not detecting the paper

LIBWFX_ERRCODE_INVALID_SERIALNUM 

The serial number is invalid, it will get fail when doing ocr recognize

Definition at line 36 of file LibWebFXScan.h.

 _ENUM_LIBWFX_EVENT_CODE

The feedback of event from LIBWFXEVENTCB callback function.

Enumerator
LIBWFX_EVENT_PAPER_DETECTED 

The event of paper detected

LIBWFX_EVENT_NO_PAPER 

The event of no paper event, please feed the paper

LIBWFX_EVENT_PAPER_JAM 

The event of paper jam, please check the device status

LIBWFX_EVENT_MULTIFEED 

The event of multiple paper feed, please check device status

LIBWFX_EVENT_NO_CALIBRATION_DATA 

The event of no calibration, please do calibration first

LIBWFX_EVENT_WARMUP_COUNTDOWN 

The device should warmup before scanning, and user will get count down timer

Definition at line 54 of file LibWebFXScan.h.

 _ENUM_LIBWFX_EXCEPTION_CODE

If the feedback of exception from LIBWFXCB callback function and _ENUM_LIBWFX_NOTIFY_CODE is , then pParam1 will return ENUM_LIBWFX_EXCEPTION_CODE type.

Enumerator
LIBWFX_EXC_OTHER 

The pParam2 will return other exception code, e.g. "error:something's wrong(x)"

LIBWFX_EXC_TIFF_SAVE_FINSIHED 

If the type of saving is pdf or multi-pdf, then LIBWFXCB will callback this expection code in pParam1 (pParam2 is the filename of pdf.)

LIBWFX_EXC_PDF_SAVE_FINSIHED 

If the type of saving is tif or multi-tif, then LIBWFXCB will callback this expection code in pParam1 (pParam2 is the filename of tif.)

Definition at line 67 of file LibWebFXScan.h.

 _ENUM_LIBWFX_NOTIFY_CODE

The feedback of notify from LIBWFXCB callback function after scanning.

Enumerator
LIBWFX_NOTIFY_IMAGE_DONE 

One image save successfully in the specific storage path

LIBWFX_NOTIFY_END 

All image processing have finished

LIBWFX_NOTIFY_EXCEPTION 

Please reference _ENUM_LIBWFX_EXCEPTION_CODE in pParam1, and pParam2 will get different value

Definition at line 77 of file LibWebFXScan.h.