paged.IDML Reference
Geometry & coordinates

Units & origin

IDML measures in points with Y growing downward. Page items use spread coordinates, with the spine at x = 0 and each page placed by its own ItemTransform.

Tier: BeginnerBeginnerIexplanation

IDML coordinates are points, Y grows downward, and page items are placed in their spread's space, whose origin is on the spine.

In short Every coordinate in a layout part is a plain number in points (1/72 inch). X grows to the right and Y grows downward. The origin that page items are measured from is not a page corner: items belong to a spread, and spread coordinates put x = 0 on the spine, the fold between the left and right page. InDesign's own files also put y = 0 at the pages' vertical centre. Each <Page> is placed in spread space by its own ItemTransform, so the left page of a facing spread lies at negative x.

The unit is the point

Bounds, transforms and path anchors carry no unit. They are all points: 72 to the inch. That is why metric documents are full of non-round numbers: an A4 page is 595.276 × 841.89 (210 × 297 mm), US Letter is 612 × 792.

Y grows downward

X grows to the right, as usual. Y grows downward: a larger Y is further down the page. A box from y = 100 to y = 300 is 200 pt tall, with its bottom edge at the larger value. This holds in every space of the format: item space, page space and spread space.

left page: x < 0right page: x > 0spine x = 0(0, 0)X →Y ↓TextFrametx < 0, ty < 0
Spread coordinates: points, Y growing downward, the spine at x = 0. In InDesign's own files the pages' vertical centre is y = 0. Each page is placed by its own ItemTransform; a frame's ItemTransform is in the same spread space, so a frame on the left page has negative x.

Page items use spread coordinates

A spread part holds one <Spread> element. Its children are the <Page> elements and the page items: text frames, rectangles, groups and the rest are siblings of the pages, not children of them. Their transforms map into the spread's space.

In that space:

  • x = 0 is the spine. On a facing spread the left page runs from -width to 0 and the right page from 0 to width. A single-page spread puts its page to the right of the spine, from 0 to width.
  • y = 0 is the vertical centre of the pages in the files InDesign writes: a page of height H runs from -H/2 to H/2.
  • Each page is placed by its ItemTransform. InDesign writes the left page of an A4 spread with ItemTransform="1 0 0 1 -595.276 -420.945" and the right page with 1 0 0 1 0 -420.945; both have GeometricBounds="0 0 841.89 595.276" in their own space.

The vertical centring is a convention, not a rule a reader may rely on. What a reader can rely on is the arithmetic: a page's rectangle in spread space is its GeometricBounds mapped through its ItemTransform. Some files put the page tops at y = 0, and some InDesign exports carry page bounds that do not start at 0 0 (a page whose bounds start at 24.94 and whose transform subtracts 420.94 still spans -396 … 396). Both are placed correctly by doing the mapping.

A two-page A4 spread written the way InDesign writes it: the spine at x = 0, the pages centred on y = 0, and each frame's ItemTransform in spread coordinates.

Spreads/Spread_uspread.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<idPkg:Spread xmlns:idPkg="http://ns.adobe.com/AdobeInDesign/idml/1.0/packaging" DOMVersion="20.0">
  <Spread Self="uspread" PageCount="2" BindingLocation="1" ShowMasterItems="true" AllowPageShuffle="true" ItemTransform="1 0 0 1 0 0">
    <Page Self="upageL" Name="2" AppliedMaster="umaster" ItemTransform="1 0 0 1 -595.276 -420.945" GeometricBounds="0 0 841.89 595.276" MasterPageTransform="1 0 0 1 0 0"/>
    <Page Self="upageR" Name="3" AppliedMaster="umaster" ItemTransform="1 0 0 1 0 -420.945" GeometricBounds="0 0 841.89 595.276" MasterPageTransform="1 0 0 1 0 0"/>
    <TextFrame Self="uframeL" ParentStory="ustoryL" PreviousTextFrame="n" NextTextFrame="n" ContentType="TextType" AppliedObjectStyle="ObjectStyle/$ID/[None]" Visible="true" Name="$ID/" ItemTransform="1 0 0 1 -537.638 -275.1213" FillColor="Swatch/None" StrokeColor="Swatch/None" StrokeWeight="0">
      <Properties>
        <PathGeometry>
          <GeometryPathType PathOpen="false">
            <PathPointArray>
              <PathPointType Anchor="0 0" LeftDirection="0 0" RightDirection="0 0"/>
              <PathPointType Anchor="0 400" LeftDirection="0 400" RightDirection="0 400"/>
              <PathPointType Anchor="480 400" LeftDirection="480 400" RightDirection="480 400"/>
              <PathPointType Anchor="480 0" LeftDirection="480 0" RightDirection="480 0"/>
            </PathPointArray>
          </GeometryPathType>
        </PathGeometry>
      </Properties>
    </TextFrame>
    <TextFrame Self="uframeR" ParentStory="ustoryR" PreviousTextFrame="n" NextTextFrame="n" ContentType="TextType" AppliedObjectStyle="ObjectStyle/$ID/[None]" Visible="true" Name="$ID/" ItemTransform="1 0 0 1 57.638 -275.1213" FillColor="Swatch/None" StrokeColor="Swatch/None" StrokeWeight="0">
      <Properties>
        <PathGeometry>
          <GeometryPathType PathOpen="false">
            <PathPointArray>
              <PathPointType Anchor="0 0" LeftDirection="0 0" RightDirection="0 0"/>
              <PathPointType Anchor="0 400" LeftDirection="0 400" RightDirection="0 400"/>
              <PathPointType Anchor="480 400" LeftDirection="480 400" RightDirection="480 400"/>
              <PathPointType Anchor="480 0" LeftDirection="480 0" RightDirection="480 0"/>
            </PathPointArray>
          </GeometryPathType>
        </PathGeometry>
      </Properties>
    </TextFrame>
  </Spread>
</idPkg:Spread>

The same spread written with the page tops at y = 0 is the two-page-spread example; it opens identically.

Which page an item is on

Nothing in an item names its page. A reader works it out from geometry: map the item's bounds into spread space and find the page that contains it. Items that lie outside every page sit on the pasteboard, the area around the pages; InDesign keeps them in the file and does not print them.

In Paged: an item belongs to the page that contains the centre of its bounds, and it is drawn on every page its bounds overlap, so an item across the spine shows on both pages.

Supported · verified

Spreads on the pasteboard

The <Spread> element has an ItemTransform too. InDesign uses it to stack the spreads of a document down its pasteboard: the first spread at 0 0, the next one a page height plus a gap further down (1 0 0 1 0 1039.89 for A4), and so on. Because the pages and the items of a spread are both inside that transform, the translation does not change where an item sits on its page. A rotation in it does: it turns the whole spread, as InDesign's rotate spread view does.

Item space

One level further in, each item draws its outline in its own space, usually from 0, 0. The item's ItemTransform maps that space into the spread (or into a group, or into the frame the item was pasted into). The unit and the direction of Y are the same in every space; only the origin and orientation change. ItemTransform covers the matrix.

InDesign writes an ItemTransform on every spread, page and page item, including the identity 1 0 0 1 0 0. A writer should do the same: InDesign does not read a missing ItemTransform as the identity, and items written without one land in the wrong place.

Frequently asked questions

What unit does IDML use for coordinates? The point, 1/72 of an inch, everywhere. Nothing in the file labels a value as points.

Where is the origin for page items? On the spine of the spread: page items are children of the <Spread> and use its coordinates. In InDesign's own files the origin is also at the vertical centre of the pages. The page's top-left corner is the origin only of the page's own inner space.

Why does a frame on the left page have a negative x? Because the left page of a facing spread lies left of the spine, at negative x in spread coordinates, and the frame's ItemTransform is written in those coordinates.

How do I convert an item's position to page coordinates? Map the item's bounds through its transforms into spread space, then subtract the page's placement: map the page's GeometricBounds through the page's ItemTransform and measure from that rectangle's top-left corner.

Why is 595.276 such a common number? It is 210 mm, the A4 width, in points (210 × 72 / 25.4). 841.89 is the A4 height.

On this page