<< Click to Display Table of Contents >> Navigation: OCR Module > Input List Handling > OCR_GetPageByIndex |
OCR_GetPageByIndex returns the specified input document page number from the PXO_Pagelist structure. Please note that all elements are case-sensitive:
HRESULT OCR_GetPagesByIndex(
PXO_Pagelist PageList,
DWORD nIndex,
DWORD *nPage
);
PageList
The PXO_Pagelist variable that OCR_NewPagelist created.
nIndex
The zero-indexed position (similar to an array index) of the input document page number to return from PXO_Pagelist. It must not exceed the value that OCR_NumPages returns.
nPage
This parameter is a pointer to a DWORD and receives the specified page number stored in PXO_Pagelist.
If the function succeeds then the return value is OCR_OK
If the function fails then the return value is an error code.
PXO_Pagelist inPages;
HRESULT hr;
DWORD nPages;
DWORD nPage;
hr = OCR_NewPagelist(&inPages);
OCR_AddPage(inPages, 1);
OCR_AddPage(inPages, 12);
OCR_AddPage(inPages, 17);
OCR_NumPages(inPages, &nPages);
for (DWORD i=0; i < nPages; i++)
{
OCR_GetPageByIndex(PageList, i, &nPage);
std::cout << "Index: " << i << ", Page number: " << nPage << std::endl;
}
// OUTPUT:
// Index: 0, Page number: 1
// Index: 1, Page number: 12
// Index: 2, Page number: 17
OCR_ReleasePagelist(&inPages);