Skip to main content

Document Review Validation Rule for Duplex Documents


Question / Problem: 

Is there a sample Document Review method to determine if a document is duplex or simplex? 

Answer / Solution: 

Below is a KTM Document Review Scripting method. 

The script validates a document based on an odd or even number of pages in the document, if it is an even number, then the document is valid, if not, then it is invalid. 

Private Sub DocumentMethod_ValidateDocument(ByVal pXDocInfo As CASCADELib.CscXDocInfo, _
                                            ByRef FailureDescription As String, _
                                            ByRef StructureCorrect As Boolean)

    Dim bCorrect As Long

    If ((pXDocInfo.PageCount % 2) != 0)
      FailureDescription = "The document has an odd number of pages"
      bCorrect = False
      FailureDescription = ""
      bCorrect = True
    End If

    StructureCorrect = bCorrect
End Sub


Applies to:  

Product Version Category
KTM  6.3 Scripting
KTM 6.2 Scripting
KTM  6.1 Scripting

Originally QAID 17766: Document Review Validation Rule for Duplex Documents 

Internal Notes: From KTM Wiki.

  • Was this article helpful?