The "description" part of the labels I'm printing are usually short like "super" and "superman", but once in while they are long like "supercalifragilisticexpealidocious"
In the latter case, the text wraps around, but does not "crlf", thus printing over portions of the original line.
crlif'ing would not be good, either, because that would "throw off" the alignment of the rest of the label.
I came up with a workaround to truncate the description if it's too long:
public void PrintLabel(string price, string description, string barcode)
{
const int MAX_CAPS_DESC_LEN = 21;
const int MAX_LOWERCASE_DESC_LEN = 32;
try
{
// Users were getting wrapped descriptions causing legibility/alignment
//problems; this code could be elegantized, but at the cost of readability
bool descAllUpper = HHSUtils.IsAllUpper(description);
if (descAllUpper)
{
if (description.Length > MAX_CAPS_DESC_LEN)
{
description = description.Substring(0, MAX_CAPS_DESC_LEN);
}
}
else // not all upper
{
if (description.Length > MAX_LOWERCASE_DESC_LEN)
{
description = description.Substring(0, MAX_LOWERCASE_DESC_LEN);
}
}
. . .
...but is there a way (a property/setting/configuration/command or such) that would tell the printer to stop at the edge of the label?
In windows > control panel > printers and devices, right click and printer properties. You can set margins and stuff. The zebra printers have lots of settings in there.
Also, we use smaller fonts to allowore characters, and uline.com sells 4x8 labels I believe instead of using standard 4x6.
Unfortunately, there is not an option for Text Field Word Wrap in the current Zebra Designer Software as of 2012-12-17 date. If you want to achieve this you must also add ZPL code into the PRN file as per the instructions taken from the ZPL Programming Manual Below.
EDIT: Had to indent all because stack was being weird.
Source Easyworks.com
CT~~CD,~CC^~CT~
^XA~TA000~JSN^LT0^MNW^MTD^PON^PMN^LH0,0^JMA^PR2,2~SD8^JUS^LRN^CI0^XZ
^XA
^MMT
^PW448
^LL0488
^LS0
^BY1,3,34^FT84,244^BCN,,Y,N
^FD>:<%EXP%>0^FS
^BY1,3,34^FT84,175^BCN,,Y,N
^FD>:<%UID%>0^FS
^BY1,3,34^FT84,106^BCN,,Y,N
^FD>:<%PARTNO%>0^FS
^FT84,344^AAN,27,15^FH\^FD<%EXP%>^FS
^FB500,3,,, //This is what the below is referencing
^FT84,293^AAN,18,10^FH\^FD<%WARN%>^FS
^PQ1,0,1,Y^XZ
CT~~CD,~CC^~CT~
^XA~TA000~JSN^LT0^MNW^MTD^PON^PMN^LH0,0^JMA^PR2,2~SD8^JUS^LRN^CI0^XZ
^XA
^MMT
^PW448
^LL0488
^LS0
^BY1,3,34^FT84,244^BCN,,Y,N
^FD>:<%EXP%>0^FS
^BY1,3,34^FT84,175^BCN,,Y,N
^FD>:<%UID%>0^FS
^BY1,3,34^FT84,106^BCN,,Y,N
^FD>:<%PARTNO%>0^FS
^FT84,344^AAN,27,15^FH\^FD<%EXP%>^FS
^FT84,293^AAN,18,10^FH\^FD<%WARN%>^FS
^PQ1,0,1,Y^XZ
^FB - Field Block
Description The ^FB command allows you to print text into a defined block type format.
This command formats an ^FD or ^SN string into a block of text using the origin, font, and
rotation specified for the text string. The ^FB command also contains an automatic word-wrap function.
Format ^FBa,b,c,d,e
This table identifies the parameters for this format:
Parameters
a = width of text block line (in dots)
Accepted Values: 0 to the width of the label
Default Value: 0
If the value is less than font width or not specified, text does not print.
b = maximum number of lines in text block
Accepted Values: 1 to 9999
Default Value: 1
Text exceeding the maximum number of lines overwrites the last line. Changing the font size automatically increases or decreases the size of the block.
c = add or delete space between lines (in dots)
Accepted Values: -9999 to 9999
Default Value: 0
Numbers are considered to be positive unless preceded by a minus sign. Positive values add space; negative values delete space.
d = text justification Accepted Values:
L = left
C = center
R = right
J = justified
Default Value: L
If J is used the last line is left-justified.
e = hanging indent (in dots) of the second and remaining lines
Accepted Values: 0 to 9999
Default Value: 0
\& = carriage return/line feed
\(*) = soft hyphen (word break with a dash)
\\ = backslash (\)
Item 1: ^CI13 must be selected to print a backslash (\).
Item 2: If a soft hyphen escape sequence is placed near the end of a line, the hyphen is printed. If it is not placed near the end of the line, it is ignored.
(*) = any alphanumeric character
" If a word is too long to print on one line by itself (and no soft hyphen is specified), a hyphen is automatically placed in the word at the right edge of the block. The remainder of the word is on the next line. The position of the hyphen depends on word length, not a syllable boundary. Use a soft hyphen within a word to control where the hyphenation
occurs.
" Maximum data-string length is 3K, including control characters, carriage returns, and line feeds.
" Normal carriage returns, line feeds, and word spaces at line breaks are discarded.
" When using ^FT (Field Typeset), ^FTuses the baseline origin of the last possible line of text. Increasing the font size causes the text block to increase in size from bottom to top. This could cause a label to print past its top margin.
" When using ^FO (Field Origin), increasing the font size causes the text block to increase in size from top to bottom.
" ^FS terminates an ^FB command. Each block requires its own ^FB command.