How to get the size in bytes of the extracted value using scripts in ABBYY FlexiCapture

The size of the extracted value in bytes when will depend on the encoding you set up for the export.

To check what encoding you are using open your Document Definition in Document Definition Editor, go to the Export Settings, choose your export profile and open the options of the Data format.

mceclip0.png

If you are using the custom export or database export, you can check your database encoding settings or specify the encoding in the script.

As an example, the following script lets you store the size in bytes in the UTF8 encoding of the value of the text field Field1 in the howManyBytes variable.

//Rule script
//C# .Net

using System;
using System.Text;
var inputString = Context.Field("Field1").Value.ToString();
var howManyBytes = Encoding.UTF8.GetByteCount(inputString);

You can check the size for other encodings replacing the UTF8 with as an example Unicode or BigEndianUnicode.

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