Bar Codes
The Bar Codes tab specifies whether the selected index field should be populated using a bar code value. Index fields can be populated by either bar code mapping or with a bar code processing script.
Select Map Field to bar code number to designate a physical or logical bar code number to the current field. (For splitting, see Recognition: Bar Codes.) The following options are available for bar code mapping:
-
Bar Code X in Document: Maps to the specified bar code number in the document.
-
Bar Code X on Page X: Maps to the specified bar code number on a particular page of the document.
-
Bar Code X on Batch Separator Sheet: Maps to the specified bar code number on the batch separator sheet.
-
Bar Code X on Folder Separator Sheet: Maps to the specified bar code number on the folder separator sheet.
-
Bar Code X on Document Separator Sheet: Maps to the specified bar code number on the document separator sheet.
-
Bar Code X in Zone Y: Maps to the specified bar code number within a specified zone in the document. This zone can be defined to be anywhere on the document including on a specified page.
Clicking Define Zones opens the Zone Configuration dialog box, where you can define a new zone.
Under Bar Code Parsing, the following options can be selected:
-
Populate field with entire bar code (default): The entire bar code is placed in the index field.
-
Populate field with subset of bar code: The value placed in the index field is based on what values you set for Start position and End position. For example, if the start position is 1 and the end position is 4, only the first 4 characters of the bar code would be placed there.
If the bar codes in question do not contain fixed length values, an unexpected result occurs. See Recognition: Bar Codes for bar code splitting or use scripting.
Use a bar code processing script to extract specific data from bar codes that are inconsistent in length and/or content. Click Open Script Editor to open the Script Editor.
Scripting within PSIcapture requires knowledge of the C# programming language.
A generic example script is as follows:
public virtual bool DocumentDataFieldValidated(IDocument document, IDataRecord d[...]
{
try
{
if(dataField.Name == "Date Check Field" && dataField.Value != null)
{
DateTime minDate = DateTime.Now.Date.AddDays(-10);
DateTime maxDate = DateTime.Now.Date.AddDays(1);
DateTime value = (DateTime)dataField.Value;
if(value < minDate || value >= maxDate)
{
dataField.SetValidationAlert("Date is not between 10 days old and 1 day [...]
return false;
}
}
return valid;
}
catch (Exception exception)
{