Splitting example #2

Split documents and create output files depending on the number of pages.

  1. Create a workflow with the AutoCapture and Barcode components.
  2. On the General tab of the Barcode component configuration dialog box, select the Split on barcode check box, and select External Script in the Using box.
  3. Click the Scripts button, click Add, and enter a file name with the .vbs extension.
  4. Click the Edit button, and in the Script Editor window create the following script:
    Example
    
    RRV="OutputPages=1..5" 
    If sPagesCount = sSplitValue Then
          RRV="OutputPages=2,4;1" 
    End If
    
  5. Click Compile, save the script, and close the Script Editor.
  6. In the Script Properties dialog box, select Each document as Run condition.
  7. In Script Variables, click the Add button to configure the script variables:
    VariableDescription
    sPagesCount Local variable initialized by the ~LTB::PagesCount~ RRT.
    sSplitValue Local variable initialized by the value 7.
  8. Save the configuration and run the process.
This script is executed for the entire document when all pages are processed. If a document contains 7 pages, the Barcode component creates two documents, one with two pages (pages 2 and 4 of the original document) and a second with one page (the first page of the original document). If the page count is not equal to 7, the component creates one output document that contain pages 1 to 5 from the original document.