Classification
The sequence of events for classification depends on how a project is configured.
The events for layout classification and content classification are executed depending on whether or not the two classification algorithms are activated. If content classification is activated, recognition is executed for the document. If recognition is not restricted to the first page, recognition is performed for the whole document.
It is possible to limit the BeforeClassifyText/BeforeClassifyImage and AfterClassifyText/AfterClassifyImage events to the first page. If these events are not limited to the first page, they are executed for each page of the document based on the classification settings.
The XDocRotated event occurs only when the Layout Classifier or the Content Classifier are active and are allowed to rotate a document page.
Document_XDocPageRotated( _
ByVal RotationBy As CASCADELib.CscAutoRotation, _
ByVal pXDoc As CASCADELib.CscXDocument, _
ByVal PageNr As Long, _
ByVal Rotation As CASCADELib.CscXDocRotationTypeEnum, _
ByRef bCancel As Boolean
)
If it is not possible to classify a page based on the layout, that page is rotated stepwise by 90° clockwise and classification is attempted again. If classification is successful for a rotation step the rotation event is fired. If this is canceled from script by setting bCancel to TRUE, the remaining rotation directions are applied and classification is executed for the page. This is done for all rotation directions then the page cannot be classified or the rotation is canceled by script. The RotationBy parameter is set to CscAutoRotationByDocumentClassifier.
When a page is not classified by the layout classifier, it is checked if content classification is required and if recognition is required. This may raise another XDocPageRotated event with the RotationBy parameter that is set to CscAutoRotationByOCR. This reflects a rotation that is requested by the recognition. If this event is canceled the recognition is executed another time, without rotation.
Event Sequence During Classification
Classification events occur during server processing only. The following image illustrates the script event sequence during classification:
