Question
How can I use barcodes other than the first one for document separation?
Answer
To achieve this, you need to use scripts. The examples that follow are in JScript.
- Open the properties of the workflow
- Click the Document Separation tab
- Select Create one document for each job and click Script
- Now type in the following code:
To use the first, second, etc. barcode:
var blocks = BarcodeBlocks;
if (blocks.count >1)
{
var block = blocks.Item( required number );
IsStartingPage = true;
CustomText = block.Text;
}
To use the barcode that corresponds to a specific template:
var blocks = BarcodeBlocks;
for( j = 0; j < blocks.Count; j++ )
{
var block = blocks.Item( j );
var str= block.Text;
var reg=template
var result=reg.test(str);
if ((str != '')&&(result == true))
{
IsStartingPage = true;
CustomText = block.Text;
}
}
In the examples above, the script will process the block collection of type Barcode, which is accessed via the properties and methods of the BarcodeBlocks object. The value of the barcode is accessed via the Text property of the BarcodeBlocks element. The template is defined by a regular expression. For example, the regular expression 123\w (Jscript syntax) checks that the barcode’s numerical value begins with the digits 123 which are followed by any letter of the Latin alphabet.
Comments
0 comments
Please sign in to leave a comment.