L_DocGetPageInfo

#include "ltdoc.h"

L_INT EXT_FUNCTION L_DocGetPageInfo(hDoc, nPageIndex, pPageInfo, uStructSize)

L_HDOC hDoc;

/* handle to the OCR document */

L_INT nPageIndex;

/* page index */

pPAGEINFO pPageInfo;

/* pointer to PAGEINFO structure */

L_UINT uStructSize;

/* size of the structure */

Gets the information about the specified page in the OCR document.

Parameter

Description

hDoc

Handle to the OCR document.

nPageIndex

Specifies index of the page for which information will be retrieved.

pPageInfo

Pointer to a PAGEINFO structure to be updated with the page information.

uStructSize

Specifies the size of the structure pointed to by pPageInfo, use sizeof(PAGEINFO) to calculate this value.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

To get the number of pages of the OCR document, call L_DocGetPageCount.

To recognize a page, call L_DocRecognize.

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_DocUpdatePage, L_DocRemovePage, L_DocExportPage, L_DocCleanUpPages

Topics:

OCR Functions: Pages

 

Working with Pages

Example

void TestPageInfo(L_HDOC hDoc, L_INT nPageIndex)
{
   PAGEINFO PageInfo;
   L_INT nPageCount = 0;
   L_TCHAR szBuffer[100];

   memset(szBuffer, 0, sizeof(szBuffer));

   memset(&PageInfo, 0, sizeof(PAGEINFO));
   L_INT nRet = L_DocGetPageInfo(hDoc, nPageIndex, &PageInfo, sizeof(PAGEINFO));
   if (nRet != SUCCESS)
      MessageBox(NULL, TEXT("An error occurred during L_DocGetPageInfo."), TEXT("Error!"), MB_OK);
   else
   {
      wsprintf(szBuffer, TEXT("Page Width = %d\nPage Height = %d\nPage Bits Per Pixel = %d\n"), PageInfo.nWidth, PageInfo.nHeight, PageInfo.nBitsPerPixel);
      MessageBox(NULL, szBuffer, TEXT("Page Info!"), MB_OK);
   }
}