Skip to main content
Kofax

The following error is occuring in KTM Server 2 after splitting Documents in KTM Docment Review: "Fox-Exception: Index (2) out of range (0 - 1)". What is the cause of this error and can it be avoided?

14099

QAID # 14099 Published

Question / Problem:

The following error is occuring in KTM Server 2 after splitting Documents in KTM Docment Review:

"Fox-Exception: Index (2) out of range (0 - 1)".

What is the cause of this error and can it be avoided?

Answer / Solution:

The error is caused by a defect in which a locator is returning Alternatives past page 1, and when the Document structure is modified, these locator results are not cleared internally. This has been reported as a defect under SPR 69641.

To work around this error and clear the locator results after a split or merge, the following script can be added at the Project Level to a project:

Private Sub Batch_AfterSplitDocument(ByVal pFirstXDocInfo As CASCADELib.CscXDocInfo,
                                     ByVal pSecondXDocInfo As CASCADELib.CscXDocInfo)

    If Not pFirstXDocInfo Is Nothing Then
        pFirstXDocInfo.XDocument.Locators.Clear
    End If
End Sub

Private Sub Batch_AfterMergeDocument(ByVal pMergedXDocInfo As CASCADELib.CscXDocInfo,
                                    ByVal MergedPageIndex As Long)
    If Not pMergedXDocInfo Is Nothing Then
        pMergedXDocInfo.XDocument.Locators.Clear
    End If
End Sub


Private Sub Batch_AfterMovePage(ByVal pTargetXDocInfo As CASCADELib.CscXDocInfo,
                                ByVal TargetPageIndex As Long,
                                ByVal pSrcXDocInfo As CASCADELib.CscXDocInfo,
                                ByVal SrcPageIndex As Long)
    If Not pSrcXDocInfo Is Nothing Then
        pSrcXDocInfo.XDocument.Locators.Clear
    End If
    
    If Not pTargetXDocInfo Is Nothing Then
        pTargetXDocInfo.XDocument.Locators.Clear
    End If
End Sub

Applies to:

Product  Version  Category 
AXPRO 4.5 Server
AXPRO 4.5 Validation
AXPRO 5.0 Server
AXPRO 5.0 Validation