#include "ltdoc2.h"
L_LTDOC2_API L_INT L_Doc2GetPageInfoExt(hDoc, nDocId, nPageIndex, pPageInfo, uStructSize)
Gets the information about the specified page of the OCR document.
Handle to the OCR document.
Document ID created by calling L_Doc2CreateDocument.
Index of the page for which information will be retrieved.
Pointer to a PAGEINFO2 structure to be updated with the page information.
Size in bytes, of the structure pointed to by pPageInfo. Use sizeof(PAGEINFO2) to calculate this value.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
To get the number of pages of the OCR document, call the L_Doc2GetPageCount / L_Doc2GetPageCountExt function.
To recognize a page, call the L_Doc2Recognize / L_Doc2RecognizeExt function.
Required DLLs and Libraries
L_INT Doc2GetPageInfoExampleExt(L_HDOC2 hDoc, L_INT nDocId, L_INT nPageIndex)
{
L_INT nRet;
PAGEINFO2 PageInfo;
L_TCHAR szBuffer[100];
ZeroMemory(szBuffer, sizeof(szBuffer));
ZeroMemory(&PageInfo, sizeof(PAGEINFO2));
nRet = L_Doc2GetPageInfoExt(hDoc, nDocId, nPageIndex, &PageInfo, sizeof(PAGEINFO2));
if (nRet != SUCCESS)
MessageBox(NULL, TEXT("An error occurred during L_Doc2GetPageInfoExt."), 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);
return nRet;
}
return SUCCESS;
}