L_Doc2UpdatePageExt

#include "ltdoc2.h"

L_LTDOC2_API L_INT L_Doc2UpdatePageExt(hDoc, nDocId, pBitmap, nPageIndex)

Updates the current page with a new bitmap.

Parameters

L_HDOC2 hDoc

Handle to the OCR document.

L_INT nDocId

Document ID created by calling L_Doc2CreateDocument.

pBITMAPHANDLE pBitmap

Pointer to the bitmap handle that references the new page to be updated into the internal OCR list of pages.

L_INT nPageIndex

Zero-based index of the page to be updated.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

Use this function to update the content of a page after performing image processing on it.

For example, after a page is flipped using the L_FlipBitmap function, this function should then be called to update the OCR page.

✅ IMPORTANT

Before using this function it is necessary to lock the page for updating by calling the L_Doc2LockPage / L_Doc2LockPageExt function, and after the update is completed, and then unlock the page by calling the L_Doc2UnlockPage / L_Doc2UnlockPageExt function.

Required DLLs and Libraries

See Also

Functions

Topics

Example

L_INT Doc2UpdatePageExampleExt(L_HDOC2 hDoc, L_INT nDocId, L_INT nPageIndex, pBITMAPHANDLE pBitmap) 
{ 
   L_INT nRet; 
   nRet = L_Doc2LockPageExt (hDoc, nDocId, nPageIndex); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   nRet = L_Doc2UpdatePageExt(hDoc, nDocId, pBitmap, nPageIndex); 
   if (nRet != SUCCESS) 
   { 
      MessageBox(NULL, TEXT("An error occurred during L_Doc2UpdatePage."), TEXT("Error!"), MB_OK); 
      return nRet; 
   } 
   else 
      MessageBox(NULL, TEXT("The specified page is updated."), TEXT("Notice!"), MB_OK); 
 
   nRet = L_Doc2UnlockPageExt (hDoc, nDocId, nPageIndex); 
   if(nRet != SUCCESS) 
      return nRet; 
   return SUCCESS; 
} 
Help Version 20.0.2020.4.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS OCR Module - OmniPage Engine C API Help