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.
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,OvalorPolygoncan hold another page item as a child element (InDesign's Paste Into, and every placed image). The child'sItemTransformis 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.
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
ItemLayeron a member that disagrees. - A
<Group>with noItemLayerlands 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.
Spreads and pages
The IDML Spread and Page elements — how pages are placed in spread coordinates, the attributes InDesign needs to open a spread, and margins and guides.
Master spreads
The idea of an IDML master spread in one screen — a spread of repeating items that body pages apply by AppliedMaster — with links to the full reference.