Skip to content

DataSplice Support Website

Sections
Personal tools
You are here: Home » Product Manuals DataSplice 2.3 » DataSplice 2.3 Installation Guides » Printer Plug-In Installation Guide » Creating Template Files for Label Formatting

Creating Template Files for Label Formatting

Template files store all of the formatting information for your labels. You can create a template file for each distinct label. Each label can have a varying set of attribute values. The filename you give to the template file, such as DPLTest.xml, is then referenced in the plug-in event action.

Note: For complete formatting options, detailed attribute explanation, and additional information, please refer to the documentation provided with your printer.

The Label Tag

The label tag serves as the main container tag for the template file. Within this tag are the other important tags such as text, barcode, and data, as described in the following sections.

If desired, the label tag can contain different attributes that affect the formatting behavior of the template:

  • Contrast (PL4 printers only) - This adjusts the darkness of the label being printed. Possible values are 0 to 3, with 0 being the lightest and 3 being the darkest.
  • Format (PL4 printers only) - This tells the printer to either form feed the label to the next label when done printing or not. Form feeds to the next label when done printing, while Journal does not. The default is Form.
  • Location - The X and Y position of the label.
  • Width (PL4 printers only) - This tells the printer how wide the paper is or how wide you want the label to possibly be (in dots). There are roughly 200 dots per inch.
  • Units (DPL printers only) - DPL printers allow the usage of this attribute in the label tag to specify the unit of measure for the printer to use for the measurement-related attributes. Acceptable values are:
    • Inches - Measured in tenths of an inch. This is the default if not specified.
    • Metric - Measured in hundredths of a millimeter.

The Text Tag

The template file can contain text tags that define the formatting of the text to be printed on the label. Common attributes that can be set for the text tag include the following:

  • Font - The type of font to use. See documentation specific to your printer language for valid font values.

    Note: When the Font attribute is set equal to 9 for a DPL printer, this will utilize "smooth fonts". When smooth fonts are used, it is necessary to define a FontSize attribute, otherwise the driver will throw an exception. This is required because Font=9 tells the printer to use smooth fonts and the FontSize attribute tells the printer which smooth font to use. For a complete list of fonts and smooth fonts, please see the DPL printer documentation

  • FontHeightMult (DPL printers only) - Scales the height of the font. For example, if a font is normally 6 dots in height, and you set the FontHeightMult attribute equal to 2, the resulting font would be 12 dots in height.
  • FontWidthMult (DPL printers only) - Scales the width of the font.
  • Justify (PL4 printers only) - This attribute can be used to justify the text. Acceptable values are CENTER, LEFT, or RIGHT.
  • Location - The X and Y positioning of the text item.

    Note: For a DPL printer, this is slightly different. This specifies the lower-left corner to start printing the data. This is interesting when you want multiple lines of text that is word-wrapped. The text will be printed up from the specified location.

    Example:

                            this text will span
                            more than one line 
                            <- starting here
    

    In the text above, the arrow on the last line points to the point that the Location attribute specifies.

  • Mag (PL4 printers only) - This attribute is used to scale or magnify the set font. It accepts values in the form of x,y. Values can be in the range of 1-16.
  • MaxWrapLines - Specifies the maximum allowed number of lines that a text item is allowed to wrap (such as 1 = one line of text, 2 = two lines of text, etc.). If the text goes further than the MaxWrapLines allows, it will get truncated. There is no support for wrapping when using smooth fonts.
  • Orientation (DPL printers only) - This is responsible for rotating the data to be printed. The values can be between 1 and 4, where each number is an increment of 90 degrees.
  • PointSize - The desired point size for the text item. This will control font size on IPL printers.
  • Units - This specifies what units the printer is to use for the measurement-related attributes such as Location, Width, etc.
    • Valid attribute values for a PL4 printer:
      • IN
      • CM
      • MM
      • DOT - This is the default unit.
  • Width - Specifies the allowed width of text items.

The Barcode Tag

Like the text tag, the barcode tag contains formatting information. The barcode tag defines the formatting of the barcode itself that will be printed on the label. Common attributes that can be set for the barcode tag include the following:

  • Height - Height of the barcode in dots.
  • LabelAboveBarcode - Specifies whether or not to print the text value above (True) or below (False) the barcode.
  • Location - The X and Y positioning of the barcode.
  • NarrowWidth - The narrow bar width of the barcode (1 through 10).
  • Offset (PL4 printers only) - This defines how far to place the label from the barcode.
  • Orientation (DPL printers only) - This is responsible for rotating the data to be printed. The values can be between 1 and 4, where each number is an increment of 90 degrees.
  • PrintLabel - Specifies whether or not the barcode should display the human-readable text value (True or False).
  • Symbology - Type of barcode symbology (such as Code11, Code39, Code39CheckDigit, Code49, Code128Auto, Code128A, Code128B, Code128C, Code128UCCC, Codabar, EAN8, EAN13, Interleaved2of5, UPCA, UPCE, MSI1, or MSI3).
  • Units - This specifies what units the printer is to use for the measurement-related attributes such as Location, Height, NarrowWidth, WideWidth, Width, etc.
    • Valid attribute values for a PL4 printer:
      • IN
      • CM
      • MM
      • DOT - This is the default unit.
  • WideWidth - The wide bar width of the barcode (2 to 3 times the narrow width).

The Data Tag

In addition to the attributes mentioned above for both the text and barcode tags, there is a data tag that can be included within both of those tags. The data tag specifies the actual information that is going to be printed on the label. This can be a literal value, such as WINSTON, or a DataSplice attribute, such as ${EMPLOYEE_NAME}.

Examples

Please see the following XML code for examples of the contents of different label template files:

General Example:

    <?xml version="1.0" encoding="utf-8" ?>

    <label Location="15,15">

        <text Font="D" Location="20,15">
            <data>${Item Num} ${Bin} UOM: ${Issue Unit}</data>
        </text>

        <text Font="C" Location="20,50" Width="300" MaxWrapLines="4">
            <data>${Desc}</data>
        </text>

        <barcode Location="20,110" Symbology="Code39" NarrowWidth="4" WideWidth="9" Height="50" PrintLabel="False" LabelAboveBarcode="False">
            <data>${Item Num}</data>
        </barcode>

    </label>

DPL-Specific Example:

    <?xml version="1.0" encoding="utf-8" ?>

    <label Location="25,12" Units="Metric">

        <text Font="2" Location="25,100" DPI="300" FontWidthMult="1" FontHeightMult="4" MaxWrapLines="6" Width="100">
            <data>This should wrap over several lines</data>
        </text>

        <barcode Location="25,200" Symbology="Code39" NarrowWidth="3" WideWidth="5" Height="100" PrintLabel="True">
            <data>123456</data>
        </barcode>

    </label>

PL4-Specific Example:

    <?xml version="1.0" encoding="utf-8" ?>

    <!-- The Location's X value is the offset (in dots) on the paper for the label to appear. -->
    <!-- The Location's Y value is the maximum height of the label (in dots).
         300 dots is roughly an inch and a half. -->

    <label Location="25,300" Contrast="2" Format="Form" Width="800">

        <text Location="25,100" Font="2" Size="3">
            <data>Testing the PL4 printer driver</data>
        </text>

        <!-- If PrintLabel is True, then Font, Size, and Offset pertain to the label. -->

        <barcode Location="25,180" Symbology="Code39" NarrowWidth="3" 
            Ratio="1" Height="100" PrintLabel="True" Font="2" Size="1" Offset="5">
            <data>123456</data>
        </barcode>

    </label>

 

Created by root
Last modified 2005-04-04 01:56 PM
 

Powered by Plone

This site conforms to the following standards: