Defining a Dynamic Barcode

This topic explains how to define a dynamic barcode using a graphic content object.

To add a barcode content object in uPlan:

  1. Create a graphic content object.

    uPlan_Creating_a_New_Graphic_ADOR_Object.PNG

  2. Double-click the graphic content object in the ADOR Objects pane to edit the expression.

    The Expression tab of the graphic content object is displayed.

  3. Write a barcode expression using the XMPBarcode function. This function takes two parameters: the barcode name and the string to be encoded.

    An optional third parameter may be added to provide further customization to the barcode options.

    Example: a QLingo expression of a Code 128 barcode encoding the Index data field:

    XMPBarcode("Code128", |->[Index])

    Barcode_Code128.png

To add a barcode content object in uCreate Print:

  1. Right-click anywhere in the Dynamic Content panel and select New Content Object. The New Content Object dialog is displayed.

  2. Enter a name for the content object, set Type to Graphic, select the Edit Rule checkbox, and click OK.

    Optionally, select an audience from the Link to Audience dropdown to give the content object a different rule for each audience segment (see Define a rule for an audience-linked content object or variable).

  3. The Rule Editor opens in Rule Builder mode. Right-click in the rule area and select Graphic Functions > Generate a barcode (XMPBarcode).

  4. Fill in the function parameters: the barcode name and the data to encode. The following example uses a conditional so that recipients with CustomerType "Private" get a QR code to the uDirect page, and recipients with CustomerType "Business" get one to the PersonalEffect page:

    if(|->[CustomerType] = "Private")
    {
        XMPBarcode("QRCode", "http://www.xmpie.com/uDirect")
    }
    else
    {
        XMPBarcode("QRCode", "http://www.xmpie.com/PersonalEffect")
    }
  5. To customize the barcode — for example, to add color — switch the Mode dropdown to Code Editor and edit the QLingo expression directly. Adding a third parameter sets barcode options such as color:

    if(|->[CustomerType] = "Private")
    {
        XMPBarcode("QRCode", "http://www.xmpie.com/uDirect", "color=rgb(248,16,85);")
    }
    else
    {
        XMPBarcode("QRCode", "http://www.xmpie.com/PersonalEffect", "color=rgb(248,16,85);")
    }
  6. Click OK to save the rule. The new barcode content object is added to the list of content objects.

  7. In the document, create a graphic frame that will display the barcode.

  8. Tag the graphic frame with the graphic content object. The recipient-specific barcode is displayed in the graphic frame.

  9. Scroll through the data source records using the record selection box (located at the bottom of the Dynamic Content panel) to see how the tagged object changes in the document for each recipient.

    2DBarCode_in_Document_per_Record_in_Palette_uCreate.png

The barcode image is best viewed in your document when setting the display performance to High Quality Display.

More topics

Supported Barcodes and Matching QLingo Parameters

Barcode Options

Fitting the Barcode in the Graphic Frame