On this Page

    Barcode Options

    Barcodes in DocOrigin designs can be either static barcodes (the value is fixed when the form is Designed) or dynamic Barcode Fields, filled when Merge is run. The static barcodes are created using the barcode drawing tool in Design. To use dynamic barcodes, draw a Field, then set the Object Properties Field 'Display as' to Barcode. Both options then allow you to select from a dropdown list of built-in barcode formats.

    Note that the Zebra printer has built-in barcode generation that is defined and used somewhat differently - see the Zebra Internal Barcodes.

    2D Barcodes

    2-dimensional barcodes are drawn as raster images that are scaled to fill the entire barcode object or field. DocOrigin supports the following 2-dimensional barcodes: DataMatrix, MaxiCode, PDF417, and QR Code.

    Linear Barcodes

    Linear barcodes are those that are typically a series of bars that is scanned left-to-right, as opposed to 2D Barcodes which are 2-dimensional arrays of marks or dots (see the 2D Barcodes section below.) The various supported linear barcodes are listed below, along with their available options. Note that all these options can be set either in the associated PRT, in Design using object tags, or at Merge runtime using script. See the examples below under Barcode Bar Widths.

    In DocOrigin, barcodes are defined within a rectangular area - either a Field rectangle or a drawn static Barcode rectangle. By default, most barcodes will automatically scale to fit within the entire rectangle. So if you draw a 3"x3" rectangle, you'll get a barcode that's 3" high and 3" wide. You can override this default behavior and supply an actual bar width - either in the PRT configuration file, via script, or directly as a tag property of the object from within Design. See the Barcode Bar Widths section below, and the detailed list of supported barcodes below. The height of a barcode is scaled to ensure that the entire barcode, including any human-readable text that appears below it - fits within the margins of the Field or Barcode Label area.

    The text font of a barcode object or field is used when drawing any associated text under the barcode. This includes typeface, size, bold, italic, etc.

    Barcodes are printed with black bars, with the exception of the Pharma barcodes which will use the text color as the bar color as well.

    Barcode Bar Widths

    In DocOrigin all linear barcodes maintain fixed ratios for the bars. (This is unlike systems like Jetform where you explicitly set widths for individual bars) With DocOrigin the .prt configuration file defines a basic bar width. If not overridden by a setParm() call, or by an Object Tag setting, DocOrigin will use that width and its internal knowledge of the ratios of bar widths in a given barcode type to render the chosen barcode.

    If the basic bar width is set to 0, then DocOrigin will use its internal knowledge of the barcode's relative bar widths to come up with a base bar width so as to stretch the barcode across the width that was designed for it in the form design. In general, the default basic bar width is set to 0, so this scaling is in effect by default.

    In an override PRT, using setParm(), or using an object tag in Design, you may override the basic bar width. In that case, DocOrigin will use its internal knowledge of the relative bar widths in a given barcode type to produce the fixed-width rendering. For example, with barcode type Code 128, the internally known ratios, per the Code 128 spec are: 1:2:3:4 -- DocOrigin applies those ratios to the overridden basic bar width.

    In the Default-LJ4.prt file you will see the following configuration for Code 128 options:

    Default-LJ4.prt
    ...
      <Barcode128Text>Y</Barcode128Text>						<!-- Draw text below barcode -->
      <Barcode128CharacterSet>8859-1</Barcode128CharacterSet>	<!-- The encoding character set to use -->
      <Barcode128BarWidth>0</Barcode128BarWidth>      			<!-- Set the width of a bar; 0 - scale to designed width --> 
    ...

    Other barcode types have similar-but-different option names and settings. Some have more than others. You can override the default barcode width in Design by selecting the barcode object or field, then using the Format > ObjectTags command:

    You can also override these configured settings at Merge runtime, using setParm().

    // set this field's barcode to a base unit width of 10 microns.
    this.setParm("Barcode128BarWidth", 10);
    // set this field's barcode to a base unit width of 1 millimeter. 
    this.setParm("Barcode128BarWidth", "1mm");