RecAPI
|
One step functions. RecAPIPlus level of CSDK is supported on: Windows, Linux, Embedded Linux, Mac OS X. More...
Functions | |
RECERR RECAPIPLS | RecProcessPagesEx (int sid, LPCTSTR pDocFile, LPCTSTR *pImageFiles, LPONETOUCH_CB pCallback, void *pContext) |
Load, Preprocess, Recognize, Format, Export input images. | |
RECERR RECAPIPLS | RecGetRPPErrorList (RPPERRORS **rppErrs) |
Getting errors from last RecProcessPagesEx. | |
RECERR RECAPIPLS | RecExecuteWorkflow (int sid, LPCTSTR pWFfilename) |
Execute a predefined workflow. |
One step functions. RecAPIPlus level of CSDK is supported on: Windows, Linux, Embedded Linux, Mac OS X.
RecAPIPlus has two one-step functions. The RecProcessPagesEx function uses the 1-2-3 workflow from OmniPage 20. It can process multiple image files with multiple pages or it can work from scanner. During the process, it uses all settings as previously set by the application. It does the following in one step: loading, image preprocessing, recognition, page/document formatting, exporting. RecExecuteWorkflow function executes workflow files created by OmniPage 20 and ITest.
One-step functions manage their works in more than one threads trying to achieve the best possible synchronization of the parts. For more information about multi-threading see the topic Multi-threading in RecAPI.
Multi-threading is supported on: Windows only. Thus on other platforms RecExecuteWorkflow
is not supported, and RecProcessPagesEx
performs a sequential workflow.
See also the details about support of different output formats on different platforms.
RECERR RECAPIPLS RecExecuteWorkflow | ( | int | sid, |
LPCTSTR | pWFfilename | ||
) |
Execute a predefined workflow.
Workflows can be created using the Workflow Assistant application (AssistantApp.exe) or using the same interface through OmniPage 20 or ITest.
[in] | sid | Settings Collection ID. |
[in] | pWFfilename | Full path to the workflow file. |
RECERR |
HSETTING hSts; HWND hWnd = Application main HWND or GetDesktopWindow(); kRecSettingGetHandle(NULL, "APIPlus.HWND", &hSts, NULL); kRecSettingSetInt(0, hSts, (int)hWnd);
RECERR RecExecuteWorkflow(int sid, string workflowFilename);
Getting errors from last RecProcessPagesEx.
The RecGetRPPErrorList function returns the error list of last RecProcessPagesEx call.
[out] | rppErrs | Pointer of a variable to store a pointer of an internal array. This array contains data for the errors happened. |
RECERR |
RPPERRORS *rppErrs; RecGetRPPErrorList(&rppErrs); while (rppErrs != NULL) { LPCSTR p = NULL; kRecGetErrorInfo(rppErrs->rc, &p); printf("RC:%d/%s, obj:%S - page:%d\n", rppErrs->rc, p, rppErrs->obj, rppErrs->page); rppErrs = rppErrs->next; }
RECERR RECAPIPLS RecProcessPagesEx | ( | int | sid, |
LPCTSTR | pDocFile, | ||
LPCTSTR * | pImageFiles, | ||
LPONETOUCH_CB | pCallback, | ||
void * | pContext | ||
) |
Load, Preprocess, Recognize, Format, Export input images.
This is a high-level function. It loads, preprocesses, recognizes, formats and exports every input image to a single document file.
[in] | sid | Settings Collection ID. |
[in] | pDocFile | Full path of the final output document. |
[in] | pImageFiles | Pointer to an array of string pointers that define a set of image files with full path. Wildcard symbols can be used, e.g. *.tif . The last element must be NULL . If a single empty string is specified, the image file open dialog will appear. If pImageFiles is NULL the images come from scanner. |
[in] | pCallback | One-touch callback function for calling back by the Engine page-by-page. |
[in] | pContext | User data passed to the callback function by the Engine. |
RECERR |
TRUE
. notused
of the ONETOUCH_CB is not considered at all. // ONETOUCH_CB INTBOOL __declspec(dllexport) RECKRNCALL onetouch_cb(INTBOOL bMore, void *pContext, LPCSTR *notused) { INTBOOL r = FALSE; //bMore is FALSE return (Abort) ? FALSE : TRUE; } ... { RECERR rc = REC_OK; RecSetOutputFormat(0, "converters.text.rtf2000"); RecSetOutputLevel(0, OL_RFP); #ifdef INPUT_FROM_FILES LPCSTR ifiles[6] = { NULL, NULL, NULL }; ifiles[0] = "path/test1.tif"; ifiles[1] = "path/test2.tif"; // or ifiles[0] = "path/test*.*"; // all test image files will be processed // or ifiles[0] = ""; // the workflow will ask for input files rc = RecProcessPagesEx(0, "test.rtf", ifiles, NULL, NULL); // or #else // NULL is used, the function will scan from the default scanner. // The function will scan until the ADF becomes empty. rc = RecProcessPagesEx(0, "test.rtf", NULL, onetouch_cb, NULL); #endif ... }
RECERR RecProcessPagesEx(int sid, string pDocFile, string[] pImageFiles, ONETOUCH_CB callback);