L_DocSaveResultsToMemory

#include "ltdoc.h"

L_INT EXT_FUNCTION L_DocSaveResultsToMemory(hDoc, ppBuffer, plSize)

L_HDOC hDoc;

/* handle to the OCR document */

L_UCHAR L_FAR ** ppBuffer;

/* address to buffer to be updated */

L_INT32 L_FAR * plSize;

/* pointer to be updated */

Saves the last recognition process result to memory.

Parameter

Description

hDoc

Handle to the OCR document.

ppBuffer

Address of a pointer to be filled with the address of the final output document in memory.

plSize

Address of a variable to be updated with the length of the final output document.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

Saves the results of the last recognition process to memory.

To free the memory associated with the recognition results, call L_DocFreeMemoryResults.

Call L_DocSaveResultsToMemory after the recognition process is complete to save the results to memory.

To recognize a page(s), call L_DocRecognize.

To save the recognition results to a file, call L_DocSaveResultsToFile.

Required DLLs and Libraries

LTDOC

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_DocGetStatus, L_DocRecognize, L_DocFreeMemoryResults, L_DocSetRecognitionResultOptions, L_DocGetRecognitionResultOptions, L_DocEnumOutputFileFormats, L_DocGetTextFormatInfo, L_DocSaveResultsToFile, L_DocSetSpecialChar, L_DocGetSpecialChar, L_DocGetRecognizedCharacters, L_DocSetRecognizedCharacters, L_DocFreeRecognizedCharacters, L_DocGetRecognizedWords, L_DocFreeRecognizedWords

Topics:

OCR Functions: Recognition

 

Recognizing Document Pages

Example

void TestSaveResultsToMemory(L_HDOC hDoc, L_INT nPageIndex)
{
   RECOGNIZEOPTS RecogOpts;
   RecogOpts.uStructSize = sizeof(RECOGNIZEOPTS);
   RecogOpts.nPageIndexStart = nPageIndex;
   RecogOpts.nPagesCount = 1;
   RecogOpts.SpellLangId = LANG_ID_ENGLISH;
   RecogOpts.pszFileName = TEXT("c:\\testrdf.rdf");

   L_INT nRet = L_DocRecognize (hDoc, &RecogOpts, NULL, NULL);
   if (nRet == SUCCESS)
   {
      L_UCHAR * pResult = NULL;
      L_INT32 lResultSize = 0;
      nRet = L_DocSaveResultsToMemory(hDoc, &pResult, &lResultSize);
      if (nRet == SUCCESS)
      {
         //...
         //... process the results that available in pResult
         //...

         L_DocFreeMemoryResults(hDoc, &pResult);
      }
   }
}