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.
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.
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
-widthto0and the right page from0towidth. A single-page spread puts its page to the right of the spine, from0towidth. - y = 0 is the vertical centre of the pages in the files InDesign writes: a page of
height
Hruns from-H/2toH/2. - Each page is placed by its
ItemTransform. InDesign writes the left page of an A4 spread withItemTransform="1 0 0 1 -595.276 -420.945"and the right page with1 0 0 1 0 -420.945; both haveGeometricBounds="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.
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.
Geometry & coordinates
The coordinate spaces of an IDML layout — points, Y growing downward, spread space with the spine at x = 0, and the transforms that nest them.
ItemTransform
ItemTransform is the six-number affine matrix (a b c d tx ty) that maps an IDML element's inner space into its parent's space; InDesign writes it everywhere.