Determines the angle by which the specified page needs to be oriented.
Handle to the OCR document.
Index of the page for which to get the orientation angle. This index is zero-based.
Pointer to a variable to be updated with the orientation angle, in degrees. Possible values are: +90, +180, and +270. The rotation is clockwise.
|SUCCESS||The function was successful.|
|< 1||An error occurred. Refer to Return Codes.|
The purpose of orientation is to make the page more readable during recognition by making sure the top of the page is positioned properly. That is, a page that is oriented correctly like this:
is much more readable than the same page oriented like this:
This function just provides the angle of orientation that is needed. It does not actually orient the page. To automatically orient the page, call the L_Doc2AutoOrientPage / L_Doc2AutoOrientPageExt function.
If the specified page does not need to be oriented the pnRotate parameter is updated with 0.
Required DLLs and Libraries
L_INT Doc2DetectOrientationDegreeExample(L_HDOC2 hDoc,L_INT nPageIndex)
L_INT nRotate = 0;
nRet = L_Doc2DetectOrientationDegree(hDoc, nPageIndex, &nRotate);
if (nRet == SUCCESS)
wsprintf(szBuffer, TEXT("Orientation degree = %d"), nRotate);
MessageBox(NULL, szBuffer, TEXT("Notice!"), MB_OK);