Dynamically suppress orientation detection for full page OCR

The Automatic Rotation option for full text OCR applies to the entire project. It is not possible to switch off orientation at extraction time for single classes. The following script shows a workaround, which enables you to switch off orientation detection for OCR. The script function is only required if you are classifying the document without layout classification or OCR, e.g. by default classification result, classification in script, or manual classification in Document Review.

' Project Script
Private Sub Document_AfterClassifyXDoc(pXDoc As CASCADELib.CscXDocument)
   Dim i As Long
   If pXDoc.ExtractionClass = "MyClass" Then
      ' change orientation for all pages from unknown to NoRotation
      ' this prevents the OCR from doing orientation detection
      For i =  0 To pXDoc.CDoc.Pages.Count - 1
        If pXDoc.CDoc.Pages(i).Rotation = Csc_RT_Unknown Then
            pXDoc.CDoc.Pages(i).Rotation = Csc_RT_NoRotation
        End If
      Next i
   End If
End Sub