How to manipulate the image field value using scripts in ABBYY FlexiCapture 12

While every IField object has access to the IValue object, the image fields do not store anything as their value, thus the simple assign operation (as in the sample below in JScript) while working for the text fields will not work for the image fields.

//Assign the value of the Text02 field to the value Text01 field
this.Field("Text01").Value = this.Field("Text02").Value;

The same operation for the Image01 and Image02 fields will require deleting the capture area of the Image01 and adding the capture area of the Image02 to it. Please refer to the example script below:

this.Field("Image01").Regions.Item(0).Delete();
this.Field("Image01").AddRegion(
    this.Field("Image02").Regions.Item(0).Page,
    this.Field("Image02").Regions.Item(0).SurroundingRect.ToString());

The above script will work for the simple image fields with the capture area consisting of one rectangle.

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.

Recently viewed