Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

What are functions?

Certain properties of elements within the document can be defined as a function or formula. This function can refer to other elements properties and variable values.

...

Properties (to reference of)

The following These properties can be referenced on frame and page level:used from the page, frame, inline frame or tagged paragraph which is referenced by the tag of the frame.

CenterY
XThe X position of the referenced rotated frame (note reference point) (or 0 for page)
YThe Y position of the referenced rotated frame (note reference point) (or 0 for page)
TopThe Y value of the top of the referenced rotated frame (or 0 for page)
BottomThe Y value of the bottom of the referenced rotated frame or page height
LeftThe X value of the left of the referenced rotated frame (or 0 for page)
RightThe X value of the right of the referenced rotated frame or page widthCenterX
CenterYThe Y value of the center of the referenced rotated frame or page
CenterXThe X value of the center of the referenced rotated frame or page
WidthThe width of the referenced frame or page (note value is scaled)
NonScaledWidthThe non scaled width of the referenced frame
HeightThe height of the referenced frame or page (note value is scaled)
NonScaledHeightThe non scaled height of the referenced frame
RotationRotation of the frame (note doesn't exist on inline frames)
ScaleXX Scale of the frame
ScaleYY Scale of the frame

Examples

  • page.width
  • frametag.height

...

  • frametag.paragraphtag.centerX

Variables

It is possible to use variables in the calculation, but only variables of type number or coordinate. For now, only the value of the variable can be referenced. No other meta information.

"variable.value" or "variable" will both resolve to the actual value of the variable.

In case a variable has the same name as a frame tag, this property being used will indicate if the user intends to use the variable value or the frame property. (there is no "value" property on frames and no width, height, etc on a variable)

If page.property is used in a calculated value, it will always refer to the page in the document, never to a frame with tag "page".

Functions within the calculation

  Following additional functions are available for application in the calculations

MinMax(min, max, input)

Clamps a given value between a minimum and maximum value.

E.g. MinMax(300,700, addwidth)

When the width of the add is lower than 300, the function will return 300.
If the width is above 700, the function will return 700.
If the addwidth is somewhere between, it will return the actual value (e.g. 450)

ClampMin(min, input)

If the input value is less than the minimum, return the minimum value otherwise return the input value

ClampMax(max, input)

If the input value is greater than the maximum, return the maximum value otherwise return the input value

...

Units (millimeters, inches, points, pixels) can be used within a function.

If no unit is are specified the Dynamic layout engine will assume the value is in points. Multiple units can be used within a single function.

...