L_LTDOC2_API L_INT L_Doc2DetectOrientationDegreeExt(hDoc, nDocId, nPageIndex, pnRotate)
Determines the angle by which the specified page needs to be oriented. No rotation is performed.
Handle to the OCR document.
Document ID created by calling L_Doc2CreateDocument.
Zero-based index of the page for which to get the orientation angle.
Pointer to a variable to be updated with the orientation angle, in degrees. Possible values are: +90, +180, and +270. Rrotation is clockwise.
|SUCCESS||The function was successful.|
|< 1||An error occurred. Refer to Return Codes.|
If the specified page does not need to be oriented, the pnRotate parameter is updated with 0.
Orienting the page makes it 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:
Required DLLs and Libraries
L_INT Doc2DetectOrientationDegreeExampleExt(L_HDOC2 hDoc, L_INT nDocId, L_INT nPageIndex)
L_INT nRotate = 0;
nRet = L_Doc2DetectOrientationDegreeExt(hDoc, nDocId, nPageIndex, &nRotate);
if (nRet == SUCCESS)
wsprintf(szBuffer, TEXT("Orientation degree = %d"), nRotate);
MessageBox(NULL, szBuffer, TEXT("Notice!"), MB_OK);