IDML Reference / Stories & text
Threading and overset
How one IDML story flows through a chain of text frames via NextTextFrame and PreviousTextFrame, and what overset text is when the chain runs out of room.
Reviewed against engine v0.71.6
Threading is how one story flows through a chain of frames; overset is the text that still doesn't fit at the end.
In short A story holds text and a frame shows it, so a story longer than its frame
has to go somewhere. IDML's answer is threading: frames link into a chain with
NextTextFrame and PreviousTextFrame, and the story fills them in order. Text that
still doesn't fit at the end of the chain is overset. Overset is an outcome of layout,
not something the file records: the text stays in the story, and the page simply doesn't
show it.
A story is independent of its frames
The text lives in one Stories/Story_*.xml part however many frames display it. Frames
don't contain text; they name a story in their ParentStory attribute and contribute a
box for it to flow into. "One story in three frames" is one Story part and three
TextFrame elements with the same ParentStory. The story is composed as one continuous
stream and poured into the frames in chain order.
The chain: NextTextFrame and PreviousTextFrame
Each frame in a thread names the following frame's Self id in NextTextFrame and the
preceding one in PreviousTextFrame. The first frame of a chain has
PreviousTextFrame="n" and the last has NextTextFrame="n"; n is IDML's "none". The
head of a chain is therefore the frame that no other frame names as its next one.
A chain can cross pages and spreads: the frames are ordinary page items on whichever spreads they sit, and only the links say how the text runs.
One story, two frames: frame A's NextTextFrame names frame B, which names A back.
<?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="1" BindingLocation="0" ShowMasterItems="true" AllowPageShuffle="true" ItemTransform="1 0 0 1 0 0">
<Page Self="upage" Name="1" AppliedMaster="umaster" ItemTransform="1 0 0 1 0 0" GeometricBounds="0 0 841.89 595.276" MasterPageTransform="1 0 0 1 0 0"/>
<TextFrame Self="uframeA" ParentStory="ustory" PreviousTextFrame="n" NextTextFrame="uframeB" ContentType="TextType" AppliedObjectStyle="ObjectStyle/$ID/[None]" Visible="true" Name="$ID/" ItemTransform="1 0 0 1 57.638 145.8237" 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 60" LeftDirection="0 60" RightDirection="0 60"/>
<PathPointType Anchor="220 60" LeftDirection="220 60" RightDirection="220 60"/>
<PathPointType Anchor="220 0" LeftDirection="220 0" RightDirection="220 0"/>
</PathPointArray>
</GeometryPathType>
</PathGeometry>
</Properties>
</TextFrame>
<TextFrame Self="uframeB" ParentStory="ustory" PreviousTextFrame="uframeA" NextTextFrame="n" ContentType="TextType" AppliedObjectStyle="ObjectStyle/$ID/[None]" Visible="true" Name="$ID/" ItemTransform="1 0 0 1 317.638 145.8237" 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="220 400" LeftDirection="220 400" RightDirection="220 400"/>
<PathPointType Anchor="220 0" LeftDirection="220 0" RightDirection="220 0"/>
</PathPointArray>
</GeometryPathType>
</PathGeometry>
</Properties>
</TextFrame>
</Spread>
</idPkg:Spread>
Columns inside one frame
A frame with several columns (TextColumnCount in its TextFramePreference) fills them
in order before the text moves on to the next frame. With VerticalBalanceColumns set,
InDesign balances the columns by line count: each column is capped at the total number
of lines divided by the number of columns, rounded up. The columns do not come out at equal
heights when their lines differ in height. See text frames.
Overset: the text that doesn't fit
When the composed story needs more room than the chain provides, the remaining lines are overset. InDesign shows a red plus sign in the last frame's out-port; the IDML carries nothing for it. The overset text is still in the story part, so anything that reads the story (see extract all text) gets all of it; only the printed page leaves it out.
A frame can avoid overset by growing instead: AutoSizingType in its
TextFramePreference lets the frame's height (or width) follow its text.
In Paged: the last frame clips its overset lines the way InDesign's own PDF does, and the load reports a warning that names the story. Auto-sizing frames grow to fit.
Supported · verified
Text that never flows
Some text is in the story but not part of the printed text at all:
- Conditional text whose condition is hidden. Conditions and their visibility are covered in conditional text.
- Notes (
Note) and hidden text, which are editorial content attached to the text. Parsed, not rendered
Unlike overset text, these runs are left out because of what they are, not because of where they ended up.
Frequently asked questions
What is text threading in IDML?
Threading is how one story flows through more than one frame. Each frame names the next
with NextTextFrame and the previous with PreviousTextFrame, forming a chain that the
story fills in order.
What is overset text? The text that still doesn't fit once the last frame in the chain is full. It is a result of layout, not an attribute: InDesign marks it with a red plus sign, and the IDML records nothing.
Is overset text lost? No. It stays in the story part; only the printed page omits it.
Do all the frames that show a story hold a copy of the text?
No. The text lives in one story part; frames only reference it through ParentStory.
The paragraph model
Why IDML stores text as flat style runs with an in-band paragraph mark, instead of one element per paragraph — and what that means when you read or write it.
Extract all text
Pull the plain text out of an IDML document — walk each story, end paragraphs at the <Br/> mark, keep forced breaks and tabs, map special characters.