XFA Specification
Chapter 8, Dynamic Forms
Layout for Dynamic Forms
287
Break on Overflow
A layout object may specify that when it does not fit in the current
pageArea
or
contentArea
, the
object (or remaining fragment of the object) must be placed in a
pageArea
or
contentArea
matching a
particular XML ID or SOM expression. This is done by specifying an
overflow
element. The XML ID or
SOM expression is supplied as the value of the
overflow
element’s target attribute. If overflow occurs
and there is an object of the correct type matching the target specification, the layout processor breaks to
the specified target.
Note that there is no
targetType
attribute for
overflow
. It is not necessary because the
target
attribute uniquely specifies an object. If the value of
target
is the empty string (the default) then the
overflow
property has no effect.
For example, a template contains the following declarations:
<subform name="X">
<overflow target="#F_ID"/>
<pageSet name="A">
<pageArea name="B">
<contentArea name="C" h="0.2in" w="1in" … />
<contentArea name="D" … />
</pageArea>
<pageArea name="E">
<contentArea name="F" ID="F_ID" h="0.2in" w="6in" … />
</pageArea>
</pageSet>
<field name="Y"> … </field>
</subform>
The Form DOM contains the following content:
[subform (X)]
[field (Y) = "lots and lots of text that overflows the contentArea"]
At startup the layout processor descends into the first
contentArea
(C) of the first
pageArea
(B) of the
first
pageSet
(A). The first content it encounters in the Form DOM is subform X. It tries to place subform X
into
contentArea
C but finds that it doesn't fit. So, it splits the subform and places the top fragment of it
into
contentArea
C. At this point the overflow break comes into play. Instead of traversing to
contentArea
D as it would normally do, the layout processor traverses to the overflow target, which is
contentArea
F. There it puts the remainder of subform X (or at least as much of it as fits). Assuming the
typeface is Courier and the typesize is 10 points, the result is:
[root]
[pageSet (A)]
[pageArea (B)]
[contentArea (C)]
[subform (X)]
[field (Y) = "lots and "]
[pageArea (E)]
[contentArea (F)]
[subform (X)]
[field (Y) = "lots of text that overflows the contentArea"]
In this example, the overflow break of subform X affects every new
pageArea
or
contentArea
(unless
overridden by a lower-level subform) because the root subform in effect flows through the entire
document.