### C++ Example for Initialization Mode Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index_h.nar29bwssk4n Illustrates the C++ syntax for setting the initialization mode parameter in the initEx() function, specifically referencing LIBWFX_INIT_MODE_NORMAL. This is relevant for resolving OCR tool not supported errors. ```cpp initEx(LIBWFX_INIT_MODE_NORMAL); ``` -------------------------------- ### SDK API Introduction Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index This section introduces the SDK API definition and provides corresponding examples. It outlines the process flow for using the SDK, emphasizing considerations for asynchronous (with Callback) and synchronous scanning to ensure proper functioning. ```APIDOC ## SDK API Introduction ### Description This chapter introduces the SDK API definition and provides corresponding examples. To use the SDK, please ensure the following process flow: ### Asynchronous Scan (with Callback) If you use asynchronous AsychronizeScan (with Callback), please 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. ### Synchronous Scan (without Callback) If only Device Control can be integrated into the Sub Form (Sub Thread) in your process, please use the SynchronizeScan (without Callback), which can ensure to obtain the correct relevant image data synchronously after scanning. ``` -------------------------------- ### Error Code: OCR_TOOL_NOT_SUPPORT Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index Occurs when no recognition tool has been configured. Verify that the `initEx()` parameter is set to `LIBWFX_INIT_MODE_NORMAL` (using C++ as an example). ```APIDOC ## OCR_TOOL_NOT_SUPPORT ### Description 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). ### Method N/A (Error Code) ### Endpoint N/A (Error Code) ### Parameters N/A ### Request Example N/A ### Response #### Error Response - **code**: `21` - **message**: `OCR_TOOL_NOT_SUPPORT` - **details**: Human-readable explanation of the error and troubleshooting steps. ``` -------------------------------- ### Resolve OCR_TOOL_NOT_SUPPORT Error by Setting Recognition Parameters Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index The OCR_TOOL_NOT_SUPPORT error means no recognition tool has been configured. Ensure that the parameter 'LIBWFX_INIT_MODE_NORMAL' is correctly set in the 'initEx()' function, as demonstrated in the C++ example. ```c++ // Example for C++ // Ensure initEx() is called with LIBWFX_INIT_MODE_NORMAL ``` -------------------------------- ### Error Code: NO_DOC_OCR Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index The DocOCR module is not installed. DocOCR is optional. You can download and install DocOCR(Basic) or both DocOCR(Basic) and DocOCR(Extend) if your language is not supported by the basic version. Supported languages include EN, DE, FR, PL, RU, pt_BR, IT, ES, zh_TW, zn_CN, JA, KOR, TR, ar_SA, etc. ```APIDOC ## NO_DOC_OCR ### Description 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… ### Method N/A (Error Code) ### Endpoint N/A (Error Code) ### Parameters N/A ### Request Example N/A ### Response #### Error Response - **code**: `1002` - **message**: `NO_DOC_OCR` - **details**: Human-readable explanation of the error and troubleshooting steps. ``` -------------------------------- ### Get Certificate Permission Info Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index_h.nar29bwssk4n Retrieves registration information, specifically permissions related to data types. It outputs a string containing the permission details if the operation is successful. ```csharp 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 != "") ``` -------------------------------- ### Start Scan Operation with Callback (C#) Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index Initiates a scanning operation. This function requires a callback function pointer and a user-defined handle to process scan results or notifications. ```csharp static DeviceWrapper.LIBWFXCB m_CBNotify; ENUM_LIBWFX_ERRCODE m_enErrCode; m_enErrCode = DeviceWrapper.LibWFX_StartScan(m_CBNotify, this.Handle); ``` -------------------------------- ### Error Code: NO_AVI_OCR Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index The AVI OCR module is not installed. AVI OCR is optional but may be required based on your needs. Refer to OCR Mismatch & No Recognize Result for more information. ```APIDOC ## NO_AVI_OCR ### Description 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. ### Method N/A (Error Code) ### Endpoint N/A (Error Code) ### Parameters N/A ### Request Example N/A ### Response #### Error Response - **code**: `1001` - **message**: `NO_AVI_OCR` - **details**: Human-readable explanation of the error and troubleshooting steps. ``` -------------------------------- ### Check OCR Version Match Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index Verifies if the installed Optical Character Recognition (OCR) version is compatible with the current program version. Displays a warning if there is a mismatch. Assumes x86 SDK uses x86 OCR. ```csharp if (DeviceWrapper.LibWFX_IsOCRVerMatch() == false) MessageBox.Show("OCR Version Mismatch!!", "Warning"); ``` -------------------------------- ### Get Devices and Serial Numbers (C#) Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index Fetches both the module names and serial numbers of connected scanning devices. The results are returned as two separate JSON strings, which are then deserialized into C# List objects. ```csharp IntPtr pstr1, pstr2; m_enErrCode = DeviceWrapper.LibWFX_GetDeviesListWithSerial(out pstr1, out pstr2); List m_szlistDevice, m_szSerialNum; String json1 = Marshal.PtrToStringUni(pstr1); string json2 = Marshal.PtrToStringUni(pstr2); M_szlistDevice = JsonConvert.DeserializeObject>(json1); m_szSerialNum = JsonConvert.DeserializeObject>(json2); ``` -------------------------------- ### Configure Filename Format and Index Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index Defines the naming convention for saved files, allowing customization of prefixes, date/time or tick formats, and the number of digits for sequential numbering. The starting index for numbering can also be specified. ```json { "filename-format": "PIC-datetime-3", "filename-beginindex": 2 } ``` -------------------------------- ### Error Code 1002: NO_DOC_OCR Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index_h.nar29bwssk4n Indicates that DocOCR has not been installed. DocOCR is optional; users may need to install DocOCR(Basic) or DocOCR(Extend) depending on language support requirements. ```APIDOC ## NO_DOC_OCR ### Description 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… ### Method N/A (Error Code) ### Endpoint N/A (Error Code) ### Parameters N/A (Error Code) ### Request Example N/A (Error Code) ### Response #### Success Response (N/A) N/A #### Response Example N/A ``` -------------------------------- ### LibWFX_IsOCRVerMatch Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index_h.nar29bwssk4n Checks if the installed OCR (Optical Character Recognition) version matches the current program version. ```APIDOC ## LibWFX_IsOCRVerMatch ### Description Determine whether the installed OCR version matches with the current program version. ### Method `DeviceWrapper.LibWFX_IsOCRVerMatch()` ### Parameters None ### Request Example ```csharp if (DeviceWrapper.LibWFX_IsOCRVerMatch() == false) MessageBox.Show("OCR Version Mismatch!!", "Warning"); ``` ### Response #### Success Response (200) Returns `true` if the OCR version matches, `false` otherwise. #### Response Example ``` // Returns a boolean value. ``` -------------------------------- ### Enable Logging in Plustek SDK Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index_h.nar29bwssk4n This describes how to enable logging for both Lib and Web SDKs. Method 1 involves setting a command-line argument, while Method 2 requires modifying the 'LibWebFxScan.ini' file. Logging is crucial for debugging initialization errors. Method 1 only records actions after setting properties, whereas Method 2 enables logging from the init stage. ```INI [Style] EnableLog = 1 ``` -------------------------------- ### LibWFX_StartScan Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index Initiates a scan operation. ```APIDOC ## LibWFX_StartScan ### Description Performs a scan operation. A callback function can be provided to receive scan results or notifications. ### Method `LibWFX_StartScan([MarshalAs(UnmanagedType.FunctionPtr)] LIBWFXCB pfnLibWFXCBIn, IntPtr pUserDefIn)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **pfnLibWFXCBIn** (LIBWFXCB) - Optional - A callback function pointer to handle scan events and results. - **pUserDefIn** (IntPtr) - Optional - A user-defined pointer for the callback context. ### Request Example ```csharp static DeviceWrapper.LIBWFXCB m_CBNotify; ENUM_LIBWFX_ERRCODE m_enErrCode; m_enErrCode = DeviceWrapper.LibWFX_StartScan(m_CBNotify, this.Handle); ``` ### Response #### Success Response (0) Scan initiated successfully. Results will be handled by the callback. #### Response Example N/A ``` -------------------------------- ### Error Code 1001: NO_AVI_OCR Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index_h.nar29bwssk4n This error occurs when AVI OCR is not installed. AVI OCR is optional but may be required depending on specific needs. ```APIDOC ## NO_AVI_OCR ### Description 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. ### Method N/A (Error Code) ### Endpoint N/A (Error Code) ### Parameters N/A (Error Code) ### Request Example N/A (Error Code) ### Response #### Success Response (N/A) N/A #### Response Example N/A ``` -------------------------------- ### LibWFX_InitEx Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index Initializes the LibWFX library. It supports normal initialization (with OCR) and a mode without OCR, which is recommended for debugging. ```APIDOC ## LibWFX_InitEx ### Description Initializes the LibWFX library. The `enInitMode` parameter determines whether OCR is used during initialization. ### Method `LibWFX_InitEx(ENUM_LIBWFX_INIT_MODE enInitMode)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **enInitMode** (ENUM_LIBWFX_INIT_MODE) - Required - Specifies the initialization mode. Can be `LIBWFX_INIT_MODE_NORMAL` (use OCR) or `LIBWFX_INIT_MODE_NOOCR` (do not use OCR). ### Request Example ```csharp DeviceWrapper.LibWFX_InitEx(ENUM_LIBWFX_INIT_MODE.LIBWFX_INIT_MODE_NORMAL); ``` ### Response None directly returned, but the library is initialized. #### Success Response (0) Library initialized successfully. #### Response Example N/A ``` -------------------------------- ### Error Code: NO_OCR Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index Neither AVI OCR nor DocOCR is installed. Both are optional but may be required. Refer to OCR Mismatch & No Recognize Result for more information. ```APIDOC ## NO_OCR ### Description 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. ### Method N/A (Error Code) ### Endpoint N/A (Error Code) ### Parameters N/A ### Request Example N/A ### Response #### Error Response - **code**: `1003` - **message**: `NO_OCR` - **details**: Human-readable explanation of the error and troubleshooting steps. ``` -------------------------------- ### Initialize Lib API with Different Modes (C#) Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index Initializes the Lib API with specified modes. LIBWFX_INIT_MODE_NORMAL enables OCR, while LIBWFX_INIT_MODE_NOOCR disables it, useful for debugging in VS. Attaching to a process is an alternative for tracing when OCR is enabled. ```csharp DeviceWrapper.LibWFX_InitEx(ENUM_LIBWFX_INIT_MODE.LIBWFX_INIT_MODE_NORMAL); DeviceWrapper.LibWFX_InitEx(ENUM_LIBWFX_INIT_MODE.LIBWFX_INIT_MODE_NOOCR); ``` -------------------------------- ### Logging License and Status Information Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index_h.nar29bwssk4n This snippet demonstrates how to log license information and status messages, including error codes, using the WriteLog function. It handles cases where license information is available or not, and logs specific error details when LibWFX_GetCertificatePermission fails. ```csharp WriteLog("License: " + szPermission); } else WriteLog("License: none");} else { WriteLog("Status:[LibWFX_GetCertificatePermission Fail [" + ((int)enErrCode).ToString() + "]]"); } ``` -------------------------------- ### Get Certificate Permission Information Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index Retrieves current registration information or permission types. It takes an output pointer for the permission data and a data type enum. ```csharp 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 != "") // Process permission info ``` -------------------------------- ### Error Code: ALREADY_INIT Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index This error code is returned when the device has already been initialized. ```APIDOC ## ALREADY_INIT ### Description This error code indicates that the device has already been initialized. ### Method N/A (Error Code) ### Endpoint N/A (Error Code) ### Parameters N/A ### Request Example N/A ### Response #### Error Response - **code**: `29` - **message**: `ALREADY_INIT` - **details**: Human-readable explanation of the error. ``` -------------------------------- ### Execute Calibration Function (C#) Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index Triggers the calibration function for compatible devices (X-mini and x-cube). This function does not require any parameters. ```csharp ENUM_LIBWFX_ERRCODE m_enErrCode; m_enErrCode = DeviceWrapper.LibWFX_Calibrate(); ``` -------------------------------- ### Configure Asynchronous Mode in Lib demo Application Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index_h.nar29bwssk4n To resolve the issue of not finding the 'SET' button in the Lib demo application, modify the 'LibWebFxScan.ini' file. Change the 'UseModeBlock' value from 1 to 0 to enable asynchronous mode. Refer to sections 2.2.1 and 2.4 for further details on Set and Scan operations and API. ```INI UseModeBlock=0 ``` -------------------------------- ### Get Connected Devices List (C#) Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index Retrieves a JSON string containing the names of connected scanner modules. This string is then deserialized into a C# List for use in the application. ```csharp IntPtr pstr; List m_szlistDevice; DeviceWrapper.LibWFX_GetDeviesList(out pstr); String json = Marshal.PtrToStringUni(pstr); M_szlistDevice = JsonConvert.DeserializeObject>(json); ``` -------------------------------- ### Error Code 1003: NO_OCR Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index_h.nar29bwssk4n This error occurs when neither AVI OCR nor DocOCR is installed. Either OCR tool is optional but may be required based on specific application needs. ```APIDOC ## NO_OCR ### Description 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. ### Method N/A (Error Code) ### Endpoint N/A (Error Code) ### Parameters N/A (Error Code) ### Request Example N/A (Error Code) ### Response #### Success Response (N/A) N/A #### Response Example N/A ``` -------------------------------- ### Logging License Information in C# Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index This snippet demonstrates logging license information, including permission status and error codes, using the WriteLog function. It handles cases where permission is granted and when an error occurs during the retrieval of certificate permission. ```csharp WriteLog("License: " + szPermission); else WriteLog("License: none");} else { WriteLog("Status:[LibWFX_GetCertificatePermission Fail [" + ((int)enErrCode).ToString() + "]]"); } ``` -------------------------------- ### AutoCaptureDemo Batch File Configuration in C# Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index This demonstrates how to configure a batch file for the AutoCaptureDemo in C#. The format specifies the executable file and its command-line arguments, which are provided in JSON format to define scan parameters like device name, source, and recognition type. ```batch AutoCaptureDemo-CSharp.bat "{\"device-name\":\"A64\",\"source\":\"Camera\",\"recognize-type\":\"passport\"}" ``` -------------------------------- ### Error Code: LOAD_MRTD_FAILED Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index Occurs if connecting the X200 to the computer after initialization fails. Ensure the machine is connected before launching the application. ```APIDOC ## LOAD_MRTD_FAILED ### Description 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. ### Method N/A (Error Code) ### Endpoint N/A (Error Code) ### Parameters N/A ### Request Example N/A ### Response #### Error Response - **code**: `26` - **message**: `LOAD_MRTD_FAILED` - **details**: Human-readable explanation of the error and troubleshooting steps. ``` -------------------------------- ### Set Device Properties (C#) Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index_h.nar29bwssk4n Configures device properties by sending a JSON command string to the kernel layer. This typically needs to be set only once if the command remains unchanged. It requires a callback function and a user-defined handle. ```csharp 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); ``` -------------------------------- ### Get File List from Temporary Storage (C#) Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index Retrieves a JSON string listing all file names within the temporary storage folder. The JSON string is converted to a C# String for further processing. ```csharp IntPtr pstr; DeviceWrapper.LibWFX_GetFileList(out pstr); String json = Marshal.PtrToStringUni(pstr); ``` -------------------------------- ### Image Format and Information Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index_h.nar29bwssk4n Configure image format, custom information, software name, and author. ```APIDOC ## Image Format and Information ### Description Configure image format, custom information, software name, and author for saved images. ### Method SET ### Endpoint scanner/config #### Query Parameters - **imagefmt** (string) - Optional - This is the file format to save the scanned images. Supported formats: bmp, jpg, png, tif, multi-tif, pdf, multi-pdf, pnm, spdf, txt, rtf, xls, xml, docx, xlsx, pptx, epub, ofd, sofd. Default: jpg. - **imagecustominfo** (boolean) - Optional - To write information to the saved image file. Default: false. - **imgsoftware** (string) - Optional - The software name. To be used along with “imagecustominfo”: true. - **imgartist** (string) - Optional - The author’s name. To be used along with “imagecustominfo”: true. ### Request Example ```json { "imagefmt": "jpg", "imagecustominfo": true, "imgsoftware": "JXZHZY", "imgartist": "Plustek_PS456U Plus" } ``` ``` -------------------------------- ### Get Paper Status Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index Retrieves the current paper status from the device. It returns an enum value indicating the paper's position (front, middle, or back). Error codes are also returned for failure scenarios. ```csharp 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 } ``` -------------------------------- ### LibWFX_ECOControl Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index Controls the time before the machine enters standby mode. ```APIDOC ## LibWFX_ECOControl ### Description Sets the duration, in minutes, after which the machine will enter standby mode to save power. ### Method `LibWFX_ECOControl(out uint pulTime, int nSetIn)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **pulTime** (out uint) - Output parameter that will contain the set time in minutes. - **nSetIn** (int) - Required - The setting to control ECO mode. `1` typically enables or sets the timer. ### Request Example ```csharp ENUM_LIBWFX_ERRCODE m_enErrCode; unit ulTime = 5; // Set standby time to 5 minutes m_enErrCode = DeviceWrapper.LibWFX_ECOControl(out ulTime, 1); ``` ### Response #### Success Response (0) ECO mode setting applied successfully. ``` -------------------------------- ### LibWFX_PaperReady Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index Checks the status of paper readiness for scanning. ```APIDOC ## LibWFX_PaperReady ### Description Checks if paper is ready in the scanner for a scanning operation. ### Method `LibWFX_PaperReady()` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```csharp 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! } ``` ### Response #### Success Response (0) - Returns `LIBWFX_ERRCODE_SUCCESS` if paper is ready. #### Error Responses - `LIBWFX_ERRCODE_PAPER_NOT_READY`: Indicates that paper is not ready. - Other error codes indicate failure of the function call. ``` -------------------------------- ### Fill Image Edges with White Color Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index Paints white color around the edges of the image. The value specifies the width for each edge (left, top, right, bottom) in inches. Example shows a 0.1-inch border on all sides. ```json { "filledgecolor": "0.1-0.1-0.1-0.1" } ``` -------------------------------- ### Customizable Background Cropping Settings Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index Settings for `swcrop` functionality, which requires `swcrop` to be true. `swcropbgmin` and `swcropbgmax` define the minimum and maximum RGB values for the background color range, useful for white backgrounds. ```json { "swcrop": true, "swcropbgmin": 210, "swcropbgmax": 255 } ``` -------------------------------- ### Enable Color Dropout Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index Removes a specific color channel (Red, Green, or Blue) from the image. This feature is applicable to Black & White or Grayscale images. For example, removing 'r' (red) can be useful for documents with red stamps. ```json { "colordropout": "r" } ``` -------------------------------- ### Enable Raw Image Capture for Debugging Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index_h.nar29bwssk4n To obtain a raw image for debugging unrecognizable images, modify the 'AVIRecognize.ini' file. This setting is only effective when 'recognize-type' is configured. After modification, restart the relevant SDK demo or executable. The 'AVIRecognize' folders containing debug information will be located at '%USERPROFILE%\Documents\Plustek\AVIRecognize'. ```INI [DebugMode] Enable=1 ``` -------------------------------- ### LibWFX_GetCertificatePermission Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index_h.nar29bwssk4n Retrieves current registration information or permission details. ```APIDOC ## LibWFX_GetCertificatePermission ### Description Output current registration information. ### Method `DeviceWrapper.LibWFX_GetCertificatePermission(out IntPtr szPermissionTypeList, ENUM_PERMISSION_DATA_TYPE enDataType)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **szPermissionTypeList** (out IntPtr) - Required - An output parameter to hold the permission data as a string. - **enDataType** (ENUM_PERMISSION_DATA_TYPE) - Required - Specifies the type of data to retrieve (e.g., `LIBWFX_DATA_TYPE_REGINFO`). ### Request Example ```csharp 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 != "") { // Process permission information } } ``` ### Response #### Success Response (200) Populates the `szPermissionTypeList` output parameter with registration or permission data as a string. #### Response Example ```json { "szPermissionTypeList": "RegistrationInfo: { Key: XYZ, ValidUntil: 2024-12-31 }" } ``` ``` -------------------------------- ### LibWFX_ECOControl Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index_h.nar29bwssk4n Sets the duration before the machine enters standby mode. ```APIDOC ## LibWFX_ECOControl ### Description Sets the time, in minutes, after which the machine will automatically enter standby mode to conserve power. ### Method **LibWFX_ECOControl** ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body * **pulTime** (out uint) - Output - A variable that will receive the current standby time setting (in minutes). * **nSetIn** (int) - Required - The desired standby time in minutes. Set to `1` to use the provided `pulTime` value. ### Request Example ```csharp ENUM_LIBWFX_ERRCODE m_enErrCode; uint ulTime = 5; // Set desired standby time to 5 minutes m_enErrCode = DeviceWrapper.LibWFX_ECOControl(out ulTime, 1); // The '1' indicates we are setting the time ``` ### Response #### Success Response (ENUM_LIBWFX_ERRCODE) Returns an `ENUM_LIBWFX_ERRCODE` indicating the success or failure of the operation. #### Response Example ```csharp // On success: ENUM_LIBWFX_ERRCODE.LIBWFX_ERRCODE_SUCCESS // On failure: Other ENUM_LIBWFX_ERRCODE values ``` ``` -------------------------------- ### Resize Image DPI Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index Modifies the DPI of a scanned image file using image processing techniques. This is useful for adjusting resolution when the scanner's native DPI is not ideal. Example shows conversion from 300 DPI to 200 DPI. ```json { "device-name": "K71U", "source": "ADF-Front", "resizedpi": 200 } ``` -------------------------------- ### Configure ECO Sleep Mode (INI File) Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index Configures the device's sleep mode settings by modifying the LibWebFxScan.ini file. Setting the ECO time to 0 disables sleep mode. Sleep mode is off by default starting from v1.1.18.22495. ```ini [RemoteModeNetEnv] IP=“127.0.0.1” Port=625 Account=“admin“ Password=“admin“ [Style] UseModeRemote = 1 ``` -------------------------------- ### Configure Image Processing for Black Backgrounds Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index_h.nar29bwssk4n The 'hashblackimage' setting is used when 'multicrop' is set to 'Auto'. Enable this for business cards with black backgrounds to improve auto-cropping. It is off by default. ```json { "hasblackimage": true } ``` -------------------------------- ### Check OCR Version Compatibility Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index_h.nar29bwssk4n Verifies if the installed Optical Character Recognition (OCR) version matches the current program's requirements. It's crucial for ensuring proper OCR functionality, especially when integrating with different SDK architectures (x86). ```csharp if (DeviceWrapper.LibWFX_IsOCRVerMatch() == false) MessageBox.Show("OCR Version Mismatch!!", "Warning"); ``` -------------------------------- ### Error Code: FORMAT_NOT_SUPPORT Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index Signals that the command format being used is incorrect. Ensure the JSON format is legal and includes necessary fields like 'device-name' and 'source'. ```APIDOC ## FORMAT_NOT_SUPPORT ### Description This means the command format is wrong. Please refer to the command table and ensure it’s a legal json format. Example: `{"device-name":"656U","source":"ADF-Duplex"}` (device-name, source are necessary fields). ### Method N/A (Error Code) ### Endpoint N/A (Error Code) ### Parameters N/A ### Request Example ```json { "device-name": "656U", "source": "ADF-Duplex" } ``` ### Response #### Error Response - **code**: `19` - **message**: `FORMAT_NOT_SUPPORT` - **details**: Human-readable explanation of the error and troubleshooting steps. ``` -------------------------------- ### Error Code: NO_DEVICES Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index Returned when no machine is found after calling `GetDevicesList()` or `GetDevicesListWithSerial()`. The checking process is the same as for `LIBWFX_ERRCODE 1`. ```APIDOC ## NO_DEVICES ### Description 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. ### Method N/A (Error Code) ### Endpoint N/A (Error Code) ### Parameters N/A ### Request Example N/A ### Response #### Error Response - **code**: `1004` - **message**: `NO_DEVICES` - **details**: Human-readable explanation of the error and troubleshooting steps. ``` -------------------------------- ### LibWFX_GetFileList Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index Retrieves a list of all file names within the temporary storage folder. ```APIDOC ## LibWFX_GetFileList ### Description Retrieves a JSON-formatted string containing the names of all files in the temporary storage folder. ### Method `LibWFX_GetFileList(out IntPtr szFileListOut)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```csharp IntPtr pstr; DeviceWrapper.LibWFX_GetFileList(out pstr); String json = Marshal.PtrToStringUni(pstr); ``` ### Response #### Success Response (200) - **szFileListOut** (IntPtr) - A pointer to a Unicode string containing a JSON array of file names. #### Response Example ```json ["file1.jpg", "file2.png"] ``` ``` -------------------------------- ### Enable JSON Output for Recognized Results Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index_h.nar29bwssk4n To obtain a JSON file containing the recognized results, modify the 'LibWebFxScan.ini' file and add the '[Style]' section. After saving the changes, restart the respective SDK application (Lib demo.exe or WebScan2.exe) for the setting to take effect. ```INI [Style] ``` -------------------------------- ### LibWFX_GetDeviesList Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index Retrieves a list of connected scanner module names. ```APIDOC ## LibWFX_GetDeviesList ### Description Retrieves a JSON-formatted string containing the names of all connected scanner modules. ### Method `LibWFX_GetDeviesList(out IntPtr szDevicesListOut)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```csharp IntPtr pstr; List m_szlistDevice; DeviceWrapper.LibWFX_GetDeviesList(out pstr); String json = Marshal.PtrToStringUni(pstr); M_szlistDevice = JsonConvert.DeserializeObject>(json); ``` ### Response #### Success Response (200) - **szDevicesListOut** (IntPtr) - A pointer to a Unicode string containing a JSON array of device names. #### Response Example ```json ["Scanner1", "Scanner2"] ``` ``` -------------------------------- ### Enable Original Image Capture in Plustek SDK Source: https://docs.google.com/document/d/e/2PACX-1vQ3M0KV9am29GTKFGmb0dwSFyQAZVFmwDmYA6846pvDPTC3yhN0ZGlBWs-yRjyVYg/pub/index_h.nar29bwssk4n This section details how to capture the original scanned image. Method 1 uses a command-line argument, and Method 2 involves editing the 'LibWebFxScan.ini' file. After modifying the INI file, ensure to restart the respective SDK application. The original image data will be stored in 'ORIG' and 'ORIG_PUSHQUEUE' folders. ```INI [Style] EnableOrig = 1 ```