| |
Static Barcodes |
Prior to insert a static barcode into the InDesign document, you need to create a barcode XML data
definition file, using one of the predefined templates. The XML data definition file is used to extract
data. The templates are available in the folder: |
[INX2FO installation folder]\templates\barcodes\ |
Each template file corresponds to a specific type of barcode. It contains a single (sample) XML node
that defines all possible tags for the barcode to be rendered by INX2FO stylesheets. |
| |
|
| |
Creating a XML data definition file for static barcodes |
|
To create a barcode XML data definition file: |
| |
|
1. |
Copy the template file into your project’s folder. |
2. |
Open it in InDesign (using File -> Import XML command). |
| |
Note: In InDesign you may copy the barcode XML node, and paste it as many times as
the barcodes of that type you need (see Fig.4.). |
| |
data source converter; |
3. |
When all the XML nodes are added, you need to set the appropriate attributes values by
editing each of them (see Fig.5.). |
|
| |
Dynamic barcodes connected to a data source with template in external XML |
This variant is quite similar to the previous. The whole procedure of the barcode embedding is all
the same with only a few differences. There is one more XML file (in addition to the primary data
source XML), which contains the secondary barcode parameters. The structure of the XML is the
same as in template files, located at [INX2FO installation folder]\templates\barcodes. |
| |
| |
|
|
|
|
| |
Fig.4. Multiply the XML node template. |
|
Fig.5. Attribute value editing. |
|
|
| |
Dynamic barcodes connected to a data source |
To create a dynamic barcodes with data-merging capabilities, you need to have a data source in
XML format and a CSV representation of that data source (a first XML record in a CSV format) for
the InDesign to be able to use it in its data-merging mechanism (at the document design time).
|
The XML data source should have all the barcodes parameters represented as attributes. The
attributes names should be the same as in the corresponding type of barcode template (see [INX2FO
installation folder]\templates\barcodes folder for templates).
|
The example of the valid XML data source with barcodes shows the barcode definition cells on the
column level and on the row level (see the listing).
|
If a cell in a row has some attribute missing, the value will be taken from the corresponding column
definition cell.
|
<?xml version=”1.0” encoding=”UTF-8”?>
<root>
<columns>
<cell1>RecordID</cell1>
<cell2>Barcode1Description</cell2>
<cell3 cellType=”barcode” type=”Interleaved2of5” module=”0.33mm”
height=”15mm” wide-to-narrow=”2.4”>Barcode1</cell3>
<cell4>Barcode2Description</cell4>
<cell5 cellType=”barcode” type=”Code128”>Barcode2</cell5>
</columns>
<row>
<cell1>1</cell1>
<cell2>This is a barcode #1</cell2>
<cell3 cellType=”barcode” module=”0.35mm”
height=”18mm” wide-to-narrow=”2.4”>12345678</cell3>
<cell4>This is a barcode #2</cell4>
<cell5 cellType=”barcode”>12345678</cell5>
</row>
</root>
|
|
To set up dynamic barcodes with external data source follow these steps: |
1. |
Generate a XML data source using your database engine in the form described above. |
| |
|
2. |
Now you need to generate a CSV representation of the data source with a single record
for the InDesign to be able to map the data fields. To do that you can create a CSV file
manually with the columns names taken from the XML file columns node and the values
- from the first row node. |
|
|
3. |
After the CSV file is created - you need to select it as a data source for Data Merge. By
using command Select Data Source on the Data Merge panel (see Fig.2). |
| |
|
4. |
When the data source is selected, all available data fields will be displayed in a list. |
| |
|
5. |
You need to drag and drop each data field on the required text frames. |
| |
|
6. |
Now you can generate the resulting document with external data source as was described earlier (see “How to process sample document with INX2FO data binding mechanism” section of the “INX2FO User Documentation Part II - Data Binding and Barcodes” for details) |
|
| |
|
| |
Setting up the dynamic barcodes with template in external XML |
| |
To set up dynamic barcodes with external data source follow these steps: |
1. |
Follow 1-4 steps of the previous chapter (Setting up the dynamic barcodes with external
data source). |
| |
|
2. |
Now you need to run File -> Import XML command and import previously prepared XML
template file. This file should contain a XML node for each barcode. |
| |
|
3. |
In this step you need to create an association between the template and the data merged
into the document. To do this, in XML view expand each barcode node and double click the
dbFieldName attribute to edit its value. You need to specify a data merging field name as
a value of the attribute (see Fig.6.). |
| |
|
4. |
After the associations to all barcode producing data fields are set up, you may drag each
barcode node (from XML view) and drop it to a required text frame where the barcode is
expected to render. |
| |
|
|
| |
|
Fig.6. Setting up the association between a data field in a text frame and a template XML node. |