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 Settings) and send the preset to Workflow.

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:

  1. Select Insert > Barcode on the menu or click the Barcode toolbar button
  2. Choose the desired barcode type. The list is divided between 1d and 2d barcodes.
  3. An ID is required. You can change the given ID and, optionally, add a class.
  4. Check the option Absolute to insert the barcode in an absolute-positioned box inside the <body> of the HTML, but outside other elements. 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>).*

    * 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 until the root of the body.

  5. 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.
  6. 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 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 of the barcode box.

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.

 
  • Last Topic Update: 17, October, 2017 08:20 AM
  • Last Published: 23, May, 2019 01:55 PM