Barcode Label Template Formatting Guidelines
This page is intended to assist with the creation of barcode label templates as used in conjunction with the DataSplice barcode printing plug-in. When a new template entry is created, it is populated with a default set of values. This provides a good base structure from which to develop the specific format of interest. The following information is intended to provide explanatory data regarding the structure of the template code and to assist with general formatting principles that can be applied within these templates.
The Label Tag
The <label> tag serves as the main container tag for the template. Within this tag are the other important tags - <text>, <barcode>, and <data>. Each of those tags is described below.
As 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
0to3, with0being the lightest and3being 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.
Formfeeds to the next label when done printing, whileJournaldoes not. The default isForm. - Location - The X (horizontal) and Y (vertical) positioning 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 can contain <text> tags that define the formatting of the text to be printed on the label. The following common attributes can be set for the <text> tag.
- 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
9for 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=9tells 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 the FontHeightMult attribute is set 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, orRIGHT. - Location - The X (horizontal) and Y (vertical) 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 hereIn 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 of1-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
1and4, 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:
INCMMMDOT- This is the default unit.
- Valid attribute values for a PL4 printer:
- Width - Specifies the allowed width of text items.
The Barcode Tag
The <barcode> tag defines the formatting of the barcode itself that will be printed on the label. The following common attributes can be set for the <barcode> tag.
- 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 (horizontal) and Y (vertical) positioning of the barcode.
- NarrowWidth - The narrow bar width of the barcode (
1through10). - 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
1and4, where each number is an increment of 90 degrees. - PrintLabel - Specifies whether or not the barcode should display the human-readable text value (
TrueorFalse). - Symbology - Type of barcode symbology (such as
Code11,Code39,Code39CheckDigit,Code49,Code128Auto,Code128A,Code128B,Code128C,Code128UCCC,Codabar,EAN8,EAN13,Interleaved2of5,UPCA,UPCE,MSI1, orMSI3). - 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:
INCMMMDOT- This is the default unit.
- Valid attribute values for a PL4 printer:
- 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}.
Template Examples
The following examples are intended for guidance purposes. For best results, the exact label template code that should be used depends on the names of the fields in the view, the physical size of the label, and the desired content.
<?xml version="1.0" encoding="utf-8" ?>
<label Location="15,5">
<barcode Location="110,10" Symbology="Code128" NarrowWidth="5" WideWidth="10" Height="85" PrintLabel="False" LabelAboveBarcode="False">
<data>${Item}</data>
</barcode>
<text Font="4" Location="110,110">
<data>Item:${Item} Bin:${Bin} Unit:${Issue Unit}</data>
</text>
<text Font="3" Location="110,150">
<data>${Description}</data>
</text>
</label>
Resulting Label: 
<?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>
<?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>
Last modified 2007-02-13 09:40 AM