Chapter 2, Template Features for Designing Static Forms
XFA Specification
Formatting Text That Appears as Fixed or Variable Content
48
1234567890
In the example, the
field
element’s width (
w
) and height (
h
) attributes control the width and height of
the barcode, hence the dimensions and spacing of the individual bars. In addition the field font, specified
by the
font
element, controls the font used for the human-readable text embedded inside the barcode.
The
type
attribute of the barcode element determines what type of barcode is printed. The example uses
a 3-of-9 barcode. 3-of-9 barcodes are very common but not tightly specified so there are many parameters
controlling the appearance of the barcode. Other attributes of the
barcode
element determine how
many characters are in the barcode (
dataLength
), whether there is human-readable text and where it is
located (
textLocation
), and the ratio of the width of wide bars to narrow bars (
wideNarrowRatio
).
There are other applicable parameters which are defaulted in the example.
Barcode readers are used only with printed forms; therefore, although a field may be designated as a
barcode field it need not appear as a barcode in an interactive context. When the field has input focus
some sort of text widget must be presented so that the user can edit the data. When the field does not
have input focus the appearance is application-defined.
There are many different types of barcodes, hundreds in wide use and thousands more in specialized
applications. Some types of barcode are specified formally by standards organizations. Others, however,
are nothing more than conventions. See the bibliographic appendix“Barcode
References” on page 987
for
references for some barcode types. Note, however, that the barcode bibliography is not authoritative and
includes only those barcode types mentioned in the specification and for which references could be
identified.
Some printers (notably label printers) are capable of printing some barcodes all by themselves. The XFA
application driving the printer only has to select the barcode type and supply any necessary parameters,
including the data to be encoded in bars. This specification refers to such barcodes as
hardware barcodes.
In other cases the printer does not handle the barcode. In those cases the XFA application has to tell the
printer to draw the barcode a line at a time. This specification refers to such barcodes as
software barcodes.
Because support for barcodes is a function of both hardware and software, XFA cannot specify a universal
set of supported barcodes. Instead XFA supplies a generalized barcode grammar that includes a barcode
type identifier and parameters controlling such things as the ratio of thick to thin bar widths. See
The
barcode element
for a detailed description of the grammar. These parameters cover the needs of all of the
common barcode types. However for any particular barcode type some settings are inapplicable. It is
normal and expected for templates to contain inapplicable barcode settings; they are silently ignored.
Note:
XFA does nothing to express or enforce positioning or quiet zone requirements. It is up to the form
creator to ensure that these requirements are met.
XFA specifies barcode identifiers for a few dozen of the most commonly used types of barcodes. XFA
applications (in combination with particular printers) that support any of these barcodes recognize the
specified barcode type identifier. XFA applications may use custom identifiers to support other types of
barcodes.
Note:
When a specified barcode type is not supported either in hardware or software the result is
application-defined.
Home Index Bookmark Pages
Pages: Home Index