paged.IDML Reference
Anchored & inline objects

Anchored & inline objects

An anchored object is a page item written inside a run of text instead of on the spread, so it moves with the words; how IDML expresses that nesting.

Tier: IntermediateIntermediateIIexplanation

An anchored object is a frame that lives inside a run of text, not on the spread.

In short Most page items sit on a spread at a fixed position. An anchored object is written inside a story instead, as a child of a CharacterStyleRange, at the point in the text where it is anchored. Edit the text before it and it moves along. A child <AnchoredObjectSetting> says where it goes: in the line like a character (inline), on a line of its own above the anchor (above line), or at a position measured from the text frame, the column or the page (custom).

Why an author anchors an object

A free frame belongs to a place on the page. An anchored object belongs to a point in the text: an icon in a sentence, a figure that must stay with the paragraph that describes it, a side note that follows its paragraph when the text reflows. Because the object is part of the story, reflow carries it along instead of leaving it behind.

How IDML writes it

The object element is written in the story, between the <Content> before the anchor and the <Content> after it, inside the same CharacterStyleRange. Its place among the content is the anchor's position in the text. The element is an ordinary page item, with its outline in <Properties><PathGeometry> like any other, plus one extra child:

ParagraphStyleRange
└── CharacterStyleRange
    ├── Content                     text before the anchor
    ├── Rectangle / TextFrame / Group      the anchored object, at the anchor
    │   ├── Properties / PathGeometry      its outline, as for any page item
    │   └── AnchoredObjectSetting          where it goes, relative to the anchor
    └── Content                     text after the anchor

An anchored text frame has its own story, named by ParentStory, like any text frame. In the surveyed documents the anchored objects are text frames, rectangles and groups.

A 36 x 18 pt rectangle anchored inline in the middle of a sentence. It takes its own width in the line, and the text after it continues to its right.

Stories/Story_ustory.xml
<?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 inline object </Content>
        <Rectangle Self="uanchor" AppliedObjectStyle="ObjectStyle/$ID/[None]" ItemTransform="1 0 0 1 0 0" FillColor="Color/Black" StrokeColor="Swatch/None" StrokeWeight="0">
          <Properties>
            <PathGeometry>
              <GeometryPathType PathOpen="false">
                <PathPointArray>
                  <PathPointType Anchor="0 0" LeftDirection="0 0" RightDirection="0 0"/>
                  <PathPointType Anchor="0 18" LeftDirection="0 18" RightDirection="0 18"/>
                  <PathPointType Anchor="36 18" LeftDirection="36 18" RightDirection="36 18"/>
                  <PathPointType Anchor="36 0" LeftDirection="36 0" RightDirection="36 0"/>
                </PathPointArray>
              </GeometryPathType>
            </PathGeometry>
          </Properties>
          <AnchoredObjectSetting AnchoredPosition="InlinePosition" SpineRelative="false" LockPosition="false" AnchorPoint="BottomLeftAnchor" AnchorXoffset="0" AnchorYoffset="0"/>
        </Rectangle>
        <Content> in the middle of its line.</Content>
      </CharacterStyleRange>
    </ParagraphStyleRange>
  </Story>
</idPkg:Story>

Pages in this chapter

The frame itself works as in frames & paths; the run it lives in is explained in story structure.

In Paged: anchored objects are drawn at their anchors in all three modes, and inline and above-line objects take room in their lines. Text does not yet wrap around an anchored object. Supported · verified

Frequently asked questions

What is an anchored object in IDML? A page item written inside a CharacterStyleRange of a story instead of on a spread. It is anchored at its position in the text and carries an <AnchoredObjectSetting>.

How is an anchored object different from a frame on the spread? A spread frame has a fixed position on the spread. An anchored object's position follows its anchor in the text, so it moves when the text before it changes.

Where does the anchor sit in the text? Where the object element is written: between the <Content> before it and the <Content> after it in the run.

Does Paged place anchored objects at their anchors? Yes, inline, above-line and custom objects alike, and inline objects take room in their line. Text wrap around anchored objects is not applied yet.

On this page