paged.IDML Reference
Layout model

Page items and stacking

What an IDML spread contains, and how layer order and document order together set the back-to-front paint order of its page items.

Tier: IntermediateIntermediateIIexplanation

Page items are the children of a spread after its pages; layers set the order between layers, and document order sets it within a layer.

In short After its <Page> elements, a <Spread> lists its page items: TextFrame, Rectangle, Oval, GraphicLine, Polygon and Group (and rarer kinds such as EPSText). Items can nest: a group holds members, and a frame can hold content pasted into it. There is no z-index attribute. Within one layer, the item written first is painted first and sits at the back. Across layers, the layer order in the design map wins: it lists layers from bottom to top.

What a spread contains

  • Shapes and frames as direct children of the <Spread>. See page-item types.
  • Groups: a <Group> holds its members as child elements, in their own back-to-front order. See groups.
  • Pasted-in content: a Rectangle, Oval or Polygon can hold another page item as a child element (InDesign's Paste Into, and every placed image). The child's ItemTransform is relative to the host, and the host's path clips it.
  • Anchored objects are not here: they live in the story, inside the text they are anchored to. See anchored objects.

Document order within a layer

Items on the same layer paint in the order they are written: the first one is at the back, the last one at the front. A group's members paint at the group's position in that order, in their own order, as one unit. A pasted-in child paints with its host, inside the host's outline.

Layer order across layers

Every page item can name a layer with ItemLayer. The <Layer> elements in designmap.xml are listed from bottom to top: everything on the first-listed layer paints before everything on the second, whatever the order in the spread.

The red rectangle is written first but sits on the second-listed layer, so it paints above the blue rectangle on the first-listed layer.

designmap.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?aid style="50" type="document" readerVersion="6.0" featureSet="257" product="20.0(32)"?>
<Document xmlns:idPkg="http://ns.adobe.com/AdobeInDesign/idml/1.0/packaging" DOMVersion="20.0" Self="d" StoryList="ustory" Name="layer-order.indd" CMYKProfile="Coated FOGRA39 (ISO 12647-2:2004)" RGBProfile="sRGB IEC61966-2.1" SolidColorIntent="UseColorSettings" AfterBlendingIntent="UseColorSettings" DefaultImageIntent="UseColorSettings">
  <Layer Self="ulayer-bottom" Name="Bottom" Visible="true" Locked="false" Printable="true"/>
  <Layer Self="ulayer-top" Name="Top" Visible="true" Locked="false" Printable="true"/>
  <idPkg:Graphic src="Resources/Graphic.xml"/>
  <idPkg:Fonts src="Resources/Fonts.xml"/>
  <idPkg:Styles src="Resources/Styles.xml"/>
  <idPkg:Preferences src="Resources/Preferences.xml"/>
  <idPkg:Tags src="XML/Tags.xml"/>
  <idPkg:MasterSpread src="MasterSpreads/MasterSpread_umaster.xml"/>
  <idPkg:Spread src="Spreads/Spread_uspread.xml"/>
  <idPkg:Story src="Stories/Story_ustory.xml"/>
  <idPkg:BackingStory src="XML/BackingStory.xml"/>
</Document>

Two rules about groups and layers:

  • A group's members are on the group's layer. InDesign keeps a group on one layer and ignores an ItemLayer on a member that disagrees.
  • A <Group> with no ItemLayer lands on the document's first layer (the bottom one) and takes its members with it. A writer should always give a group the layer its members should be on.

Layers in full are covered under Layers.

In Paged: items paint in layer order, then document order, with groups and pasted-in content composed in place and clipped by their host. A group pasted into a frame is still drawn unclipped. Supported · verified

Supported · untested

Frequently asked questions

How is the stacking order of page items determined? By layer first, then by document order. Layers paint from the first <Layer> in the design map (bottom) to the last (top); within a layer, the item written first is at the back.

Is there a z-index attribute? No. Position in the XML, together with the layer, is the stacking order. To bring an item forward, move its element later in the spread or onto a higher layer.

Which layer are a group's members on? The group's. InDesign keeps members on their group's layer; a group without ItemLayer goes to the document's first layer.

What is pasted-in content? A page item written as a child of a Rectangle, Oval or Polygon. Its transform is relative to the host frame and the host's outline clips it. A placed image is the most common case.

On this page