Chapter 2, Template Features for Designing Static Forms
XFA Specification
Formatting Text That Appears as Fixed or Variable Content
47
enter dates in the underlying
date
element format (e.g., “20030626”). XFA-Template allows a second
picture clause to be associated with the field, as a property of the field's
ui
element. For example, an
American might enter the date as “06/26/2003”, and have it presented as “Thursday, June 26 2003" after
tabbing out of the field. The picture clause associated with the
ui
element is referred to as an input mask.
See “Picture Clause Specification” on page 901.
Locale-Specific Picture Clauses
A locale is identified by a language code and/or a country code. Usually, both elements of a locale are
important. For example, the names of weekdays and months in the USA and in the UK are formatted
identically, but dates are formatted differently. So, specifying an English language locale would not suffice.
Conversely, specifying only a country as the locale may not suffice either — for example, Canada, has
different currency formats for English and French.
When developing internationalized applications, a locale is the standard term used to identify a particular
nation (language and/or country). A locale defines (but is not limited to) the format of dates, times,
numeric and currency punctuation that are culturally relevant to a specific nation.
Localized formatting can be specified within the template (using picture clauses) or by allowing a picture
clause to specify various formats for the supported locales. The XFA processing application then chooses
the picture clause for the current locale or specified by the template locale.
Barcode Formatting of Variable Text
Barcodes are not a different data type but a different way of presenting textual or binary data. In a barcode
the data is presented as a series of bars with varying widths. So-called
one-dimensional barcodes
have a
single line of bars. So-called
two-dimensional barcodes
have multiple rows of bars.
The function of a barcode is to be read by a specialized piece of hardware called a barcode reader. Some
barcodes also display the data in human-readable format as a string of glyphs, but this is a secondary
function. Since the barcode is intended to be read by a machine its appearance is usually strictly
constrained. For example, for a particular type of barcode the bars may have to have to particular height
and distance apart. In addition it is common for a barcode to require a minimum amount of white space
around it (the
quiet zone)
and a particular range of distances from a designated edge of the page.
In XFA, a barcode is the visual representation of a field. The content of the field supplies the data that is
represented as a barcode. For example,
Example 2.12 Field represented as a barcode
<field h="10.16mm" name="InventoryNumber" w="48mm" >
<ui>
<barcode dataLength="10" textLocation="belowEmbedded"
type="code3Of9" wideNarrowRatio="3.0"/>
</ui>
<font typeface="Courier New"/>
</field>
Assume that the field
InventoryNumber
contains the text "
1234567890
". When printed the field
appears as follows (actual size):
Home Index Bookmark Pages
Pages: Home Index All Pages