To specify a unique caption for the paper forms barcode
-
On
the form design, select the paper forms barcode.
-
In the Object palette, click the Field tab, deselect Generate
Label Automatically, and type a caption in the Label box.
To generate a caption for the paper forms barcode
-
On
the form design, select the paper forms barcode.
-
In the Object palette, click the Field tab and select Generate
Label Automatically.
To specify the symbology for the paper forms barcode
-
On the form design,
select the paper forms barcode.
-
In the Object palette, click the Field tab and select one
of the following options from the Symbology list:
-
PDF417
-
QR Code
-
Data Matrix
Note:
End users filling
a form that contains a QR Code, DataMatrix, or GS1 DataMatrix barcode
require Acrobat 7.0.5 or later, or Adobe Reader 7.0.5 or later. Decoding
of QR Code and DataMatrix barcodes is supported by Barcoded Forms 7.0
but is not supported by barcoded forms 7.0 Standalone (ST).
To specify the paper forms barcode scanning method
-
On the form design,
select the paper forms barcode.
-
In the Object palette, click the Field tab and select one
of the following options from the Scanning Method list:
-
Hand-held Scanner
-
Fax Server
-
Document Scanner
-
Custom
-
If you select Custom, you can also specify custom decoding
settings.
To specify custom decoding settings for a paper forms barcode
-
On
the form design, select the paper forms barcode.
-
In the Object palette, click the Field tab and select Custom
from the Scanning Method list.
-
To change the decoding properties, select the value from
the Value list beside the property.
Note:
If you
are planning to decode the barcode by using a handheld barcode scanner,
avoid creating barcodes wider than four inches. Taller and narrower barcodes
generally work better with handheld scanners.
To control how a paper forms barcode encodes data
When using a paper
forms barcode object in a form design, you must specify the format
that the barcode will use when encoding the data, as well as which
data will be encoded. You can specify the following types of data
formats:
Both options provide a script for the paper forms barcode object
that instructs it to use a particular data type when encoding the
data.
You can provide your own script for encoding the data. For more
information, see
To create a custom script for encoding data for a paper forms barcode
.
To define how the paper forms barcode object obtains data, use
the options in the Value tab of the Object palette. You can also
specify whether the data is compressed before encoding.
To automatically generate a script to encode barcode data
-
On the form design, select the paper forms barcode.
-
In the Object palette, click the Value tab and select Automatic
Scripting.
-
In the Format list, select one of these options:
-
(Optional) Select Include Field Names and Include Label.
-
In the Apply To list, select one of these options:
To compress the data before encoding
-
On the form
design, select the paper forms barcode.
-
In the Object palette, click the Value tab and select Compress
Data Before Encoding.
To create a custom script for encoding data for a paper forms barcode
In
situations when you need to follow government or other specifications
for encoding data, you may find that the preset data encoding options
do not meet your requirements. Using the Custom option, you can
provide your own script for encoding the data. The script could
be quite simple, as in this example:
this.rawValue=NumericField1.rawValue
Alternatively, you could create a more complex script that determines
which fields to encode based on certain conditions.
-
On the form design, select the paper forms barcode object.
-
In the Object palette, click the Value tab and deselect Automatic
Scripting.
-
In the Script Editor, you can modify the sample custom script
or write your own script.
For example, the following sample code illustrates the JavaScript
script required to retrieve a form’s field values, format a string
representing a Comma Separated Value (CSV) instance containing the
form fields, and update a paper forms barcode for an interactive
PDF form. The form contains fields named
accountNum
,
formerFirstName
,
formerMiddleInitial
,
formerLastName
,
newFirstName
,
newMiddleInitial
,
and
newLastName
.
// This function ensures that the barcode will update
// when a change is made to any field on the form.
function depends(node)
{
for (var i = 0; i < node.nodes.length; ++i)
{
var child = node.nodes.item(i);
if (child.isContainer)
depends(child);
}
}
// Return a field surrounded by quotes and followed with a separator
function fmtField(fieldName, separator)
{
var str = "\"" + fieldName.rawValue + "\"" + separator;
return str;
}
// Force all fields in the form to be updated in the dataset
depends(xfa.form);
// Generate the CSV string that will be encoded in the barcode
var comma = ",";
var newLine = "\n";
var s = fmtField(accountNum, comma);
s += fmtField(formerFirstName, comma)
s += fmtField(formerMiddleInitial, comma);
s += fmtField(formerLastName, comma);
s += fmtField(newFirstName, comma)
s += fmtField(newMiddleInitial, comma);
s += fmtField(newLastName, newLine);
// Assign the string to the barcode for encoding
this.rawValue = s;
To use legacy encoding format
By default, Designer uses a new encoding format that uses
the XFA JavaScript function
xfa.record.saveXML()
to
produce XML encoded data. However, you can still use the legacy
encoding format that uses the old function
xfa.datasets.saveXML()
.
For example, you may be processing forms with barcode data by using
an application that can only parse the old XML format.
The legacy encoding format is used in paper forms barcode XML
scripts in Designer 7.0 to 8.0. When you open a form that contains
the legacy encoding format, the Use Legacy Format option is selected
automatically.
-
On the form design, select the paper forms barcode object.
-
In the Object palette, click the Value tab.
-
In the Format list, select XML and then select Use Legacy
Format.
To specify a delimiter
You can choose the delimiter character that is used to
separate field data, such as field names, field values, and barcode
labels.
With all delimiters other than Carriage Return, the first line
starts with the optional barcode label heading, followed by the
form object names, and ends with a delimiter and a new line character.
The second line starts with the barcode label, which is a globally
unique identifier (GUID) by default, followed by the form object
data, and ends with a delimiter and a new line character.
With the Carriage Return delimiter, field names, barcode labels,
and field values are listed over multiple lines, with field names
and barcode labels listed first, each on a separate line, followed
by either a carriage return, a new line character, and then with
the field values, each of which are on a separate line.
If a field name or value in the form is empty, the barcode encoding
script will insert a delimiter and encode the next field name or
value. The barcode data will not contain a space, or any special
marking, as the placeholder for the empty text.
Note:
With all types of delimiters, you can control
whether field names and barcode labels are included in the barcode
content by selecting the Include Field Names and Include Label options
in the Value tab of the Object palette.
To avoid incorrect decoding results when you choose the delimited
format for a paper forms barcode, make sure that the delimiter you
select is not a part of your form's textual contents. That is, do
not choose a delimiter that may be a part of the paper forms barcode
field value. For instance, if you choose tab, comma, or space as
the delimiter, the contents of the form fields you are encoding
cannot contain any tab, comma, or space characters because it will
confuse the decoder.
You can always choose a different character as the delimiter
if the form contents change and the character that was originally
chosen to be the delimiter becomes a part of the contents.
Note:
It is recommended that you do not select the
Carriage Return option as a delimiter, because the carriage return
character is already used in the paper forms barcode values as a
delimiter to separate the header and value rows.
-
On the form design, select the paper forms barcode object.
-
In the Object palette, click the Value tab.
-
In the Format list, select Delimited and, in the Delimiter
list, select the type of delimiter you want.
To specify character encoding
You can select the character encoding of the value that
is encoded into a barcode.
-
On the form design, select the paper forms barcode object.
-
In the Object palette, click the Value tab.
-
In the Character Encoding list, select the option that suits
your needs.
|
|
|