Skip to main content

Operations with Areas

FunctionDescription
Area Max( Area a1, Area a2 )Returns the maximum value from a1, a2.
Area Min( Area a1, Area a2 )Returns the minimum value from a1, a2.
Area ObjectsArea( Rect, ImageObjectType )Returns the area of the objects of the specified type within the specified rectangle. Works in global coordinates.
Area ObjectsIntersectionArea( Rect, ImageObjectType )Returns the area of the objects of the specified type within the specified rectangle. If the area of the objects goes beyond the specified rectangle, returns the intersection of the area of the objects and the specified rectangle. Works in global coordinates.

Operations with Distances

FunctionDescription
Distance Abs( Distance )Returns the absolute value of a distance.
Distance AverageInterLineInterval()Returns the average height of the text lines on the page. The function may only be used if the maximum and minimum numbers of pages in the document are set to 1. For a multi-page document, use the corresponding method of the type Page: Page( N ).AverageLineHeight.
Distance AverageLineHeight()Returns the average distance between the text lines on the page. The function may only be used if the maximum and minimum numbers of pages in the document are set to 1. For a multi-page document, use the corresponding method of the type Page: Page( N ).AverageInterLineInterval.
Distance Min( Distance d1, Distance d2 )Returns the minimum value from d1, d2.
Distance Max( Distance d1, Distance d2 )Returns the maximum value from d1, d2.

Operations with Numeric Data Types

FunctionDescription
Int abs( Int )Returns the absolute value of a number.
Int Ceil( Real )Returns the smallest integer that is not less than the argument.
Int Floor( Real )Returns the biggest integer that is not greater than the argument.
Int Max( Int n1, Int n2 )Returns the maximum value from n1, n2.
Int Min( Int n1, Int n2 )Returns the minimum value from n1, n2.
Int Round( Real )Returns an integer closest in value to the argument.
Real Min( Real d1, Real d2 )Returns the minimum value from d1, d2.
Real Max( Real d1, Real d2 )Returns the maximum value from d1, d2.

Operations with Rectangles and Regions

FunctionDescription
Rect DocumentRect()Returns the rectangle of the entire document (in global coordinates).
Rect PageRect()Returns the rectangle of the entire image. The function may only be used if the maximum and minimum numbers of pages in the document are set to 1.
Region FormRegion( RectArray included, RectArray excluded )Creates a region that includes the array of included rectangles, and excludes the array of excluded rectangles.

String Operations

FunctionDescription
String Chr( Int )Returns a string using the specified Unicode code of the character (code must be written in decimal system).
String LCase( String )Returns a string obtained from the specified string by changing all of its characters to lower case.
String RealToStrVariants( Real value, String fractionalPartSeparators, Int maxDigitsCountInFractionalPart = 2 )Creates string representations, separated by a vertical bar, for the specified real number “value,” decimal separators fractionalPartSeparators, and the maximum number of digits in the fractional part.
String Str( ... )String representation of a data type. Available for Int, Logic, Real, XInterval, YInterval, DistInterval, FuzzyRect, Hypothesis, RectArray, Region, Area, Quality, Distance, PageInterval.
String RemoveSpaces( String )Returns a string obtained from the specified string by removing all of the spaces in the string.
String UCase( String )Returns a string obtained from the specified string by changing all of its characters to upper case.

Access to XML Files

FunctionDescription
StringArray ReadFromXML( String filename, String xPathQuery )Reads an array of strings from the “filename” XML file. The strings are obtained by calculating the passed xPath query “xPathQuery.” For more information about using XML files, see User Dictionaries. Note: To make the code clearer, you can define constants with replaceable parameters for frequently used xPath queries and use these constants in function calls.
String ReadSingleStringFromXML( String filename, String xPathQuery )Reads a string from the “filename” XML file. The string is obtained by calculating the passed xPath query “xPathQuery.” For more information about using XML files, see User Dictionaries.

Type Conversion and Checks

FunctionDescription
Logic IsReal( String numberString, String separators = ".,", Logic isStrictMode = false )Checks that the inputString string can be safely converted to a real number. The list of allowed decimal separators is set by the “separators” argument.
Logic IsRealFuzzy( String, String separators = defaultDecimalSeparators, Logic isStrictMode = false )Checks if the string inputString can be safely converted into a real number taking into account possible recognition errors in the string.
Logic IsInt( String inputString, Logic isStrictMode = false )Checks that the inputString string can be safely converted to an integer number.
Logic IsIntFuzzy( String inputString, Logic isStrictMode = false )Checks if the string inputString can be safely converted into an integer taking into account possible recognition errors in the string.
Real StrToRealFuzzy( String, String separators = defaultDecimalSeparators, Logic isStrictMode = false )Returns the result of converting the value of the string inputString into a real number taking into account possible recognition errors.
Real StrToReal( String numberString, String separators = ".,", Logic isStrictMode = false )Returns the result of converting the inputString string into a real number. Spaces are omitted.
Int StrToInt( String inputString, Logic isStrictMode = false )Returns the result of converting the inputString string value into an integer. Spaces are omitted.
Int StrToIntFuzzy( String, Logic isStrictMode = false )Returns the result of converting the value of the string inputString into an integer taking into account possible recognition errors.
Int LogicToInt( Logic value )Returns “1” if the value is true and “0” if the value is false.

Operations with Coordinates

FunctionDescription
XCoordinate Min( XCoordinate x1, XCoordinate x2 )Returns the minimum value from x1, x2.
XCoordinate Max( XCoordinate x1, XCoordinate x2 )Returns the maximum value from x1, x2.
XCoordinate MiddleBetween( XCoordinate x1, XCoordinate x2 )Returns the X-coordinate calculated as ( x1 + x2 ) / 2.
XCoordinate Between( XCoordinate x1, XCoordinate x2, Real ratio )Returns the X-coordinate calculated as x1 + ( x2 – x1 ) * ratio.
YCoordinate Min( YCoordinate y1, YCoordinate y2 )Returns the minimum value from y1, y2.
YCoordinate Max( YCoordinate y1, YCoordinate y2 )Returns the maximum value from y1, y2.
YCoordinate MiddleBetween( YCoordinate y1, YCoordinate y2 )Returns YInterval calculated as ( y1 + y2 ) / 2.
YCoordinate Between( YCoordinate y1, YCoordinate y2, Real ratio )Returns YInterval calculated as y1 + ( y2 – y1 ) * ratio.
XInterval MiddleBetween( Xinterval x1, XInterval x2 )Returns XInterval calculated as ( x1 + x2 ) / 2.
XInterval Between( Xinterval x2, Xinterval x2, Real ratio )Returns XInterval calculated as x1 + ( x2 – x1 ) * ratio.
YInterval MiddleBetween( Yinterval y1, Yinterval y2 )Returns YInterval calculated as ( y1 + y2 ) / 2.
YInterval Between( Yinterval y1, Yinterval y2, Real ratio )Returns YInterval calculated as y1 + ( y2 – y1 ) * ratio.

Access to Data Catalogs

Note: To access a data catalog, you should first create a skill parameter referring to that catalog, and then use the parameter name in the method calls.
FunctionDescription
Logic TestAccessToCatalog( String catalogParameterName )Tests access to the data catalog referenced by the catalogParameterName parameter.
Logic TestCatalogSearchCriteria( String catalogParameterName, StringArray searchColumns, NamedValueArray searchCriteria )Checks the validity of the search criteria set for the data catalog. The search criteria are set using an array of named values, where each named value represents a column name and its expected value. The searchColumns array specifies which columns of the data catalog record are to be included in the response.
StringArray FieldNamesOfCatalog( String catalogParameterName )Returns a list of all column names in the data catalog referenced by the catalogParameterName parameter. The columns are arranged by index number in ascending order.
StringArray FieldNamesOfCatalog( String catalogParameterName, StringArray searchColumnNames )Returns a list of the data catalog column names that appear in the searchColumnNames array (case-insensitive). The columns are arranged by index number in ascending order. You can use this method to determine column indexes.
Int RecordCountOfCatalog( String catalogParameterName, StringArray searchColumns, NamedValueArray searchCriteria = EmptyNamedValueArray )Returns the number of records in the data catalog that meet the specified search criteria.
Void PrepareRecordsetOfCatalog( String catalogParameterName, StringArray searchColumns, NamedValueArray searchCriteria = EmptyNamedValueArray, Int maxRecordsCount = 1000 )Fetches data catalog records which meet the search criteria.
StringArray RecordOfCatalog( String catalogParameterName, StringArray searchColumns, NamedValueArray searchCriteria = EmptyNamedValueArray, Int rowIndex )Returns a record from the data catalog that meets the search criteria.
Quality ValidateByCatalog( String word, String catalogParameterName, Int columnIndex, NamedValueArray searchCriteria = EmptyNamedValueArray, Int maxErrors, Rational maxErrorsPart, Logic ignoreSpaces = true, Int maxRecordsCount = 1000 )Checks the specified word string by comparing it with the values of the column with index columnIndex in the data catalog. Returns the quality of matching between the specified string and the best match from the data catalog column.
Int GetCatalogColumnIndex( String catalogParameterName, String columnName )Returns the index of the first column with the given name found in the data catalog referenced by the catalogParameterName parameter. The column name is case insensitive.
IntArray GetCatalogColumnIndices( String catalogParameterName, String columnName )Returns indexes of all columns with the given name found in the data catalog referenced by the catalogParameterName parameter. The column name is case insensitive.

Access to Skill Parameters of Type Text

FunctionDescription
Logic NamedParameterStringExists( String parameterName )Checks whether a text parameter with the given name exists in the skill. The parameter name is case sensitive.
String GetNamedParameterString( String parameterName )Returns the value of the text parameter with the given name. The parameter name is case sensitive.

Miscellaneous

FunctionDescription
InputFieldArray InputFields()Returns a collection of objects - fields found in the document during the previous stages of document processing.
Int PagesCount()Returns the number of pages in the document.
Page Page( Int PageNumber )Returns the Page object representing the page with the given number.
Logic IsOnSameLine( Hypothesis, Hypothesis )Checks if the hypotheses intersect vertically.