Chapter 2, Template Features for Designing Static Forms
XFA Specification
Formatting Text That Appears as Fixed or Variable Content
46
Example 2.11 Rich text provided as a default field value
<field>
<value>
<exData contentType="text/html">
<html xmlns:xfa=http://www.xfa.org/schema/xfa-template/2.4/">
<p font-family:"Courier Std">The<b> second </b>and
<b> fourth </b>
words are bold.
</p>
</html>
</exData>
</value>
<ui>
<textEdit
allowRichText="1"
… />
</ui>
</field>
Produces:
The
second
and
fourth
words are bold.
The chapter
“Representing and Processing Rich Text” on page 186
provides more detailed information on
rich text.
Rich Text Used to Embed Objects
Embedded objects are objects which are imported into and flow with the surrounding text. Embedded
objects can include variable data that is defined at run time. For example, the content of a field can be
inserted into fixed text as an embedded object. An embedded object may contain non-textual data such
as an image, in which case the embedded object is treated like a single (possibly rather large) character.
This application of rich text is described in
“Rich Text That Contains External Objects” on page 191.
Formatting Variable Content
Variable content text may be formatted using picture clauses. Such formatting is in addition to that
specified for paragraphs and fonts for rich text.
After variable content text is formatted using picture clauses, it may be further formatted as barcode
representations, as described in
“Barcode Formatting of Variable Text” on page 47.
Picture-Clause Formatting in General
XFA carries the distinction between data and presentation to the field level. Often, the user wishes to see
individual field values embellished (e.g., with thousand separator, currency symbol). Yet the underlying
data element may not contain those embellishments. An XFA picture clause provides the mapping
between the two representations. The
format
element, a child of the
field
element, has a
picture
property, which specifies the presentation of the field's data.
While it may make sense to present a value in a verbose format (e.g., “Thursday, June 26 2003"), it could
prove onerous if users have to enter data in this format. It might prove equally awkward to force users to
Home Index Bookmark Pages
Pages: Home Index All Pages