Anchored objects
The element model of an anchored object — a frame nested inside a CharacterStyleRange, plus every attribute of its AnchoredObjectSetting and our parser's support status.
An anchored object is a <Rectangle>, <TextFrame>, or <Group> written as a child of a CharacterStyleRange, carrying one <AnchoredObjectSetting>.
In short: An anchored object is built from two parts in IDML. The first is an
ordinary frame element — a <Rectangle>, a <TextFrame>, or a <Group>, the same
elements you would find on a spread — but written inside a run of text rather than
on the spread. The second is a single extra child, <AnchoredObjectSetting>, that
records where the frame should land relative to the anchor character. Our parser
reads the frame's geometry and styling onto the host paragraph and reads the setting
alongside it. This page is the reference for both: the frame element's attributes
and every attribute of <AnchoredObjectSetting>, each with its honest support
status.
An anchored object is a frame written as a child of a CharacterStyleRange. The
frame is one of three familiar elements — a <Rectangle>, a <TextFrame>, or a
<Group> — and it carries a single extra child, <AnchoredObjectSetting>, that
describes where it should land relative to the anchor character. The parser reads
the frame's geometry and styling onto the host paragraph and reads the setting
alongside it.
A Rectangle nested inside a run, with an AnchoredObjectSetting. The renderer
reports paragraphs: 1, runs: 1 — the anchored frame is read onto the
paragraph, not counted as a spread item.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<idPkg:Story xmlns:idPkg="http://ns.adobe.com/AdobeInDesign/idml/1.0/packaging" DOMVersion="20.0">
<Story Self="ustory">
<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/$ID/[No paragraph style]">
<CharacterStyleRange AppliedCharacterStyle="CharacterStyle/$ID/[No character style]">
<Content>A paragraph that carries an anchored object.</Content>
<Rectangle Self="uanchor" AppliedObjectStyle="ObjectStyle/$ID/[None]" ItemTransform="1 0 0 1 0 0" GeometricBounds="0 0 36 72" FillColor="Color/Black" StrokeColor="Swatch/None" StrokeWeight="0">
<AnchoredObjectSetting AnchoredPosition="InlinePosition" SpineRelative="false" LockPosition="false" AnchorPoint="BottomLeftAnchor" AnchorXoffset="0" AnchorYoffset="0"/>
</Rectangle>
</CharacterStyleRange>
</ParagraphStyleRange>
</Story>
</idPkg:Story>
The frame element
Any of three elements may appear directly inside a CharacterStyleRange to become
an anchored object. Which one it is, the parser records as a frame kind; the rest
of the attributes it reads mirror how the same element is read at spread level.
| Attribute · Rectangle / TextFrame / Group (nested in a CharacterStyleRange) | Type / values | Support | Notes |
|---|---|---|---|
| Self | string id | Parsed, not yet rendered | The frame’s id. Recorded on the anchored-frame record. |
| GeometricBounds | string "y1 x1 y2 x2" (pt) | Parsed, not yet rendered | The frame’s box. Read here; an explicit GeometricBounds wins over bounds derived from a nested PathGeometry. |
| ItemTransform | string "a b c d e f" (matrix) | Parsed, not yet rendered | The frame’s transform. For an anchored frame it positions content in the frame’s own coordinates, not on the spread. |
| ParentStory | string ref (Story/…) | Parsed, not yet rendered | TextFrame only — the story whose text fills the anchored frame. Absent for Rectangle and Group. |
| FillColor | string ref (Color/… or Swatch/None) | Parsed, not yet rendered | Fill swatch. None ⇒ inherit from the applied object style cascade. |
| StrokeColor | string ref (Color/… or Swatch/None) | Parsed, not yet rendered | Stroke swatch. |
| StrokeWeight | double (pt) | Parsed, not yet rendered | Stroke width. |
| FillTint | double (0–100) | Parsed, not yet rendered | Tint percentage of the fill. |
| GradientFillAngle | double (deg) | Parsed, not yet rendered | Angle of a gradient fill. |
| AppliedObjectStyle | string ref (ObjectStyle/…) | Parsed, not yet rendered | The object style applied to the frame. |
A few things the parser deliberately does not recurse into on an anchored
frame: nested transparency settings, and — beyond a nested <Image>'s link URI
and transform on an anchored <Rectangle> — image styling. A <Group> records its
child frames in z-order; a <TextFrame> records its ParentStory so the renderer
can chase the story content once placement lands. Parsed, not yet renderedanchored frames read but not flowed — paged-parse/src/story.rs:264
AnchoredObjectSetting
The placement block. It sits inside the frame element and records intent — where the object should land relative to the anchor — without itself moving anything. The parser stores each attribute's value verbatim; an absent attribute falls back to the cascaded default.
| Attribute · AnchoredObjectSetting | Type / values | Support | Notes |
|---|---|---|---|
| AnchoredPosition | InlinePosition | AboveLine | Anchored | Parsed, not yet rendered | The placement mode. Absent ⇒ inline. See inline vs anchored positioning for what each mode means. |
| AnchorPoint | TopLeftAnchor | TopCenterAnchor | TopRightAnchor | LeftCenterAnchor | CenterAnchor | RightCenterAnchor | BottomLeftAnchor | BottomCenterAnchor | BottomRightAnchor | Parsed, not yet rendered | Which point of the object is pinned to the anchor. |
| AnchorXoffset | double (pt) | Parsed, not yet rendered | Horizontal nudge from the anchor point. 0 when absent. |
| AnchorYoffset | double (pt) | Parsed, not yet rendered | Vertical nudge from the anchor point. 0 when absent. |
| SpineRelative | boolean | Parsed, not yet rendered | true flips the offset direction on facing pages. false is the default. |
| LockPosition | boolean | Parsed, not yet rendered | true pins the object so it can’t be dragged. false is the default. |
| HorizontalReferencePoint | AnchorLocation | ColumnEdge | TextFrame | PageMargins | PageEdge | Parsed, not yet rendered | For custom positioning — which rectangle the horizontal alignment measures from. Absent ⇒ AnchorLocation. |
| HorizontalAlignment | LeftAlign | CenterAlign | RightAlign | TextAlign | Parsed, not yet rendered | For custom positioning — which side of the horizontal reference the object sits against. |
| VerticalReferencePoint | LineBaseline | LineXHeight | LineCapHeight | TopOfLeading | Column | TextFrame | PageMargins | PageEdge | Parsed, not yet rendered | For custom positioning — which line or page feature the vertical alignment measures from. |
| VerticalAlignment | TopAlign | CenterAlign | BottomAlign | Parsed, not yet rendered | For custom positioning — vertical alignment against the vertical reference. |
Why the count doesn't change
The example above adds a whole <Rectangle> to the story, yet the renderer still
reports frames: 1, paragraphs: 1, runs: 1. That is the point of an anchored
object being inside a run: it is recorded on the host paragraph, not promoted to
a spread-level frame, so it does not inflate the frame count — and the run that
hosts it is still one run. The frame on the spread (frames: 1) is the page's text
frame; the anchored rectangle is data hanging off the paragraph within it.
Next
What AnchoredPosition, AnchorPoint, and the reference/alignment attributes
actually do — and how much of it the renderer carries today — is the subject of
inline vs anchored positioning.
Frequently asked questions
Which elements can be an anchored object?
Exactly three: a <Rectangle>, a <TextFrame>, or a <Group>, written directly
inside a CharacterStyleRange. These are the same elements you would find on a
spread; the parser records which one it is as the frame's kind and reads the rest
of its attributes the way it reads them at spread level.
What does <AnchoredObjectSetting> do?
It is the placement block nested inside the frame element. It records intent —
where the object should land relative to the anchor, via attributes like
AnchoredPosition, AnchorPoint, and the offset and reference/alignment pairs —
without itself moving anything. The parser stores each attribute verbatim, and an
absent attribute falls back to its cascaded default.
Why doesn't adding an anchored object change the frame, paragraph, or run count?
Because the object is recorded on its host paragraph rather than promoted to a
spread-level frame. The frame count reflects the page's text frame, the paragraph
still has one paragraph, and the run that hosts the object is still one run — so the
renderer reports frames: 1, paragraphs: 1, runs: 1 even though a whole
<Rectangle> was added to the story.
Does the parser read everything inside an anchored frame?
No. It deliberately skips nested transparency settings and, beyond a nested
<Image>'s link URI and transform on an anchored <Rectangle>, image styling. A
<Group> records its child frames in z-order, and a <TextFrame> records its
ParentStory so the renderer can chase the story content once placement lands.
Anchored & inline objects
An anchored object is a frame that lives inside a run of text instead of standing free on the spread — how IDML expresses that nesting and what our parser reads from it.
Inline vs anchored positioning
What inline, above-the-line, and custom placement each mean for an anchored object — and exactly how far our renderer carries each one today.