Skip Layout Classification after second page

This example shows how to skip the layout classification after the second page. You can restrict the classification of a multi page document to the first page by selecting the Classify only first page option in the project settings. It may happen that such a document, for which only the first page is processed, remains unclassified when, after the first page, the values for minimum confidence and minimum distance are not reached. When you select Classify each page, the classification is performed for each page of a multi page document until a classification result is ascertained or all pages are processed. If you want to stop the layout classification after the second page of the document, select the Classify each page option in the project settings, insert the Document_AfterClassifiy image into the edit area of the project classification script, and insert a condition to check the page number and to exit the loop over all pages.

' Project Script 
Private Sub Document_AfterClassifyImage(pXDoc As CASCADELib.CscXDocument, ByVal PageNr As Long, bExit As Boolean) 
     If PageNr >= 2 Then 
     bExit = True 
   End If 
End Sub