Classification

The event chronology for classification events depends upon the project settings.

The events of the layout classification are either executed or not depending on whether or not the two classification algorithms are activated. This also applies when using the content classification. If the content classification is activated, OCR is executed for the document and if it is not restricted to the first page OCR for the whole document is performed.

The BeforeClassifyText/Image and AfterClassifyText/Image can be limited to the first page or be executed for each page of the document depending 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 a page cannot be classified by layout it is rotated stepwise by 90° clockwise and classification is re-executed. If the 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 where the page can either not be classified or the rotation is canceled by script. The parameter RotationBy is set to CscAutoRotationByDocumentClassifier.

If a page could not be classifed it is checked if content classification is required and if OCR has to be prepared. This may raise another XDocPageRotated event with the parameter RotationBy set to CscAutoRotationByOCR. This rotation reflects a rotation that is suggested by the OCR. If this event is canceled the OCR is re-executed without rotation.

Event Sequence During Classification

Classification events only occur during server processing. The following figure illustrates the script event sequence during classification:


A visual representation of the Classification event.