Is it possible for Kofax Transformation Modules Server to separate documents by a bar code?
13541
Question / Problem:
Is it possible for Kofax Transformation Modules Server to separate documents by a bar code?
Answer / Solution:
Yes, it is possible to accomplish this via scripting. As an example, follow the steps below:
- Assign a Barcode Locator to a field named "Barcode" at the project level.
- Create a class named "BarcodeSeparation".
- Copy the following to the project level script:
Private Sub Document_SeparateCurrentPage(pXDoc As CASCADELib.CscXDocument, ByVal PageNr As Long, bSplitPage As Boolean, RemainingPages As Long) Dim oSinglePageDoc As CscXDocument Set oSinglePageDoc = New CscXDocument '# Create a temporary document with a single page oSinglePageDoc.CopyPages(pXDoc, PageNr, 1) '# Read the barcode Project.ClassByName("BarcodeSeperation").Extract oSinglePageDoc '# If the barcode is a separation barcode then split the document bSplitPage = BarcodeSeparation(oSinglePageDoc.Fields.ItemByName("Barcode").Text) End Sub Private Function BarcodeSeparation(ByVal sValue As String) As Boolean '# Return true if the barcode is a seperation barcode If sValue = "000000" Then BarcodeSeparation = True Else BarcodeSeparation = False End If End Function
Modify the BarcodeSeparation function to include separation logic. Return True if the bar code value indicates that it should separate.