L_DocUpdatePage

#include "ltdoc.h"

L_INT EXT_FUNCTION L_DocUpdatePage(hDoc, pBitmap, nPageIndex)

L_HDOC hDoc;

/* handle to the OCR document */

pBITMAPHANDLE pBitmap;

/* pointer to the bitmap handle*/

L_INT nPageIndex;

/* page position */

Updates the current page with a new bitmap.

Parameter

Description

hDoc

Handle to the OCR document.

pBitmap

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

nPageIndex

Index of the page to be updated. This is a zero-based index.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

Use this function to update a page’s content after applying any image processing function(s).

For Example, if you flip your page using L_FlipBitmap, then you should update the OCR page by calling this function.

You must lock the page to be updated by calling L_DocLockPage before calling this function, and should unlock the page by calling L_DocUnlockPage after the update is complete.

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_DocAddPage, L_DocGetPageCount, L_DocRemovePage, L_DocExportPage, L_DocGetPageInfo, L_DocLockPage, L_DocUnlockPage, L_DocCleanUpPages

Topics:

OCR Functions: Pages

 

Working with Pages

Example

void TestUpdatePage(L_HDOC hDoc, L_INT nPageIndex, pBITMAPHANDLE pBitmap)
{
   L_DocLockPage (hDoc, nPageIndex);

   L_INT nRet = L_DocUpdatePage(hDoc, pBitmap, nPageIndex);
   if (nRet != SUCCESS)
      MessageBox(NULL, TEXT("An error occurred during L_DocUpdatePage."), TEXT("Error!"), MB_OK);
   else
      MessageBox(NULL, TEXT("The specified page is updated."), TEXT("Notice!"), MB_OK);

   L_DocUnlockPage (hDoc, nPageIndex);
}