Barcode
In PReS Connect Designer, you can add a variety of barcodes to your template. The supported Barcode types include 1d barcodes (the striped ones) and 2d barcodes (encoded horizontally and vertically).
Adding a Barcode
When generating Print output, you can add extra barcodes and OMR marks. The reason why you would do this, is that at merge time more information is available about the actual output document. The page count, for example, is not available at design time.
To add barcodes and OMR marks on the fly when generating Print output, select File > Print and check the option Add additional content (see Additional Content) in the Print Wizard. To have this done automatically, save this and other output options in an Output Creation Preset: select File > Print Presets > Output Creation Settings (see Output Creation Presets Wizard)
Before adding a Barcode, load data or at least a Data Model; see Loading data. You will need the field names when adding the Barcode. Then, to add a Barcode to a section, Master Page or snippet:
- Select Insert > Barcode on the menu or click the Barcode toolbar button.
- Choose the desired barcode type. The list is divided between 1d and 2d barcodes.
- Give the barcode an ID and/or class.
- Check the option Absolute to insert the barcode in an absolute-positioned box inside the <body> of the HTML, but outside other elements. (This option is not available in Email sections.) Alternatively, use the Location drop-down to select where to insert the Barcode.
- At cursor position inserts it where the cursor is located in the template.
- Before element inserts it before the HTML element in which the cursor is currently located. For example if the cursor is within a paragraph, the insertion point will be before the <p> tag.*
- After start tag inserts it within the current HTML element, at the beginning, just after the start tag.*
- Before end tag inserts it within the current HTML element, at the end, just before the end tag.*
- After element inserts it after the element in which the cursor is currently located. For example if the cursor is within a paragraph, the insertion point will be after the end tag of the paragraph (</p>).*
- Replace inserts it in place of the currently selected element. (This option is not available when inserting content in a Master Page.)
* If the current element is located inside another element, use the Elements drop-down to select which element is used for the insertion location. The list displays every element in the breadcrumbs, from the current selection point down to the root of the body.
Note: HTML has some restrictions as to which types of elements are allowed as children of other elements. For example, a paragraph element is not allowed to have children that are block level elements - like a Div or a Table. If inserting content at the selected location would produce invalid HTML the final result may be different than expected. For example, when you insert a Div into a paragraph, the paragraph gets split in two. This means you end up with two paragraphs with the Div in between.
- Under Script, select the field that contains the barcode value. The barcode type dictates the length and exact format of the required value. For a detailed description or for background information on a specific barcode, please refer to the documentation provided by the individual barcode supplier. Note that some barcode readers may require specific parameters as well.
If it is necessary to concatenate fields to compose the barcode value, edit the script after adding the barcode; see Barcode script.For barcodes that require a Checksum, the Designer can calculate a Checksum if that isn't provided by your data. In that case the field should contain the required value minus the Checksum. To include a calculated Checksum in the barcode value, edit the barcode properties after adding the barcode to the template; see below. - Click OK to close the dialog.
In the template the barcode shows up as a gray box. The associated barcode script is added to the Scripts pane. To see the barcode script working, toggle to the Preview tab in the Workspace.
A barcode is always added with the barcode type's default properties and dimensions, but they can easily be changed; see Barcode type and properties.
Changing a barcode
Barcode script
The barcode script determines which value is fed to the barcode generator. Double-click the script on the Scripts pane to change which field or fields are added to the barcode value. When you select more than one field, the script puts the values of the selected fields in one string and passes that to the barcode generator.
If you don't know which script matches the barcode, click the box that contains the barcode and check the ID and class of that box on the Attributes pane. Then take a look at the Scripts pane: the selector of the associated script is the same as the ID and/or class of the barcode box.
If a barcode has more than one class name, only the first one is used in the script's selector.
Barcode type and properties
A barcode is always added with the barcode type's default properties and dimensions.
To change the barcode type or the barcode's properties such as the scale and color, open the Barcode properties dialog: right-click the barcode (on the Design tab in the Workspace) and select Barcode on the shortcut menu.
The barcode properties set via the properties dialog are written to the data-params
attribute on the barcode element in JSON format. (To see this, select the barcode and open the document in the Source view.)
Click the barcode type below for information about its properties.
- Australia Post, see Australia Post, Japan Post, KIX, USPS IMb
- Aztec Code
- Codabar
- Code 11, see Code 11, Code 93, Industrial 2 of 5, Interleaved 2 of 5, Matrix 2 of 5
- Code 39
- Code 39 extended
- Code 93, see Code 11, Code 93, Industrial 2 of 5, Interleaved 2 of 5, Matrix 2 of 5
- Code 93 extended
- Code 128
- Data Matrix
- EAN-8, EAN-13, see UPC-A, UPC-E, EAN-8, EAN-13
- GS1 DataMatrix
- GS1-128
- Industrial 2 of 5, see Code 11, Code 93, Industrial 2 of 5, Interleaved 2 of 5, Matrix 2 of 5
- Interleaved 2 of 5, see Code 11, Code 93, Industrial 2 of 5, Interleaved 2 of 5, Matrix 2 of 5
- Japan Post, see Australia Post, Japan Post, KIX, USPS IMb
- KIX, see Australia Post, Japan Post, KIX, USPS IMb
- Matrix 2 of 5, see Code 11, Code 93, Industrial 2 of 5, Interleaved 2 of 5, Matrix 2 of 5
- MaxiCode
- MSI
- PDF417
- POSTNET
- QR Code
- Royal Mail 2D Mailmark
- Royal Mail 4-State (CBC)
- Royal Mail 4-State Mailmark C, Royal Mail 4-State Mailmark L, see Royal Mail 4-State Mailmark C, Royal Mail 4-State Mailmark L
- UPC-A, UPC-E, see UPC-A, UPC-E, EAN-8, EAN-13
- USPS IMb, see Australia Post, Japan Post, KIX, USPS IMb
- USPS IMpb