arrange(pItemOrLayer, positionOrDirection, [reference])

Arranges a page item or a layer before or behind other page items or layers. If using the constants FORWARD or BACKWARD the object is sent forward or back one step. The constants FRONT or BACK send the object to the very front or very back. Using FRONT or BACK together with the optional reference object, sends the object in front or behind this reference object.

Type: function

Parameter(s):

  • pItemOrLayer {PageItem | Layer}:

    The page item or layer to be moved to a new position.

  • positionOrDirection {String}:

    The position or direction to move the page item or layer. Can be FRONT, BACK, FORWARD or BACKWARD.

  • reference {} Optional:

    A reference object to move the page item or layer behind or in front of.

Returns:

  • {PageItem | Layer}:

    The newly arranged page item or layer.