Skip to main content

Base types

Table of contents


Nullability of base types

All base types are nullable unless stated otherwise. The Boolean type is the only exception and cannot be null.

Integer

This type represents an integer number in the range from -2,147,483,648 to 2,147,483,647.

If you do not use a decimal point with a number, it is interpreted as an integer.

Example:

shape.page.index = 0

Double

This type represents a floating-point number in the range from ±5.0 × 10−324 to ±1.7 × 10308.

If you use a decimal point with a number, it is interpreted as a double.

Example:

shape.font.size = 16.0

String

This type represents a string ("text") of arbitrary length.

Strings must be placed in quotation marks.

Example:

shape.font.name = "Arial"

Color

This type represents a color.

Colors must be written in hexadecimal representation.

Example:

shape.fill = #000000

Boolean

This type represents a true / false value. Boolean expressions cannot be null and evaluate to false by default if no value is specified.

As the Comparison operators and Logical operators of the Expression Language return a Boolean type, true or false usually do not have to be written explicitly.

Example:

(shape.page.index = 0) = true

is equal to

shape.page.index = 0

Sequence

This type represents a sequence of values, technically known as an array.

The values in a sequence must be of the same type.

Null values are allowed in a sequence.

Examples:

[1,2,3]
[9.5,null,11.8]
["Hello", "World"]
["Hello", null, "World"]
[1, "Hello"]                    // invalid

Use the in operator to check whether a value is present in a sequence.

Use the sequence indexer [] to select an individual item from a sequence. Note that the first element has an index of 0.

["hello","world"][0] = "hello"  // evaluates to true

Note: The Expression Language treats strings in many ways like a sequence. As an example, you can use the in operator to find a substring in a string. However, the indexer [] does not work with strings.

"hello"[1] = "e"                // invalid

Use the count property to return the number of elements in a sequence:

[0,7,17].count = 3              // evaluates to true

Point

This type represents a point in the document.

A point is created with two coordinates (x and y), both of which are double values.

Example:

Point(34.0, 278.0)

Rectangle

This type represents a rectangle in the document.

A rectangle is created with four coordinates, all of which are double values. x1/y1 denote the lower left corner point of the rectangle, x2/y2 the upper right corner point.

Example:

Rectangle(15.0, 22.0, 361.0, 678.0)

Null

This type represents a null value.

A null value stands for "nothing" and is therefore different from an empty string ("") or a mathematical 0.

Example: You can remove the author entry of a document by writing null in the corresponding field.