Label Alignment Issue
We've been designing and testing out a custom label as we prepare to undergo barcoding all of our equipment. The design is super simple and derived from the 2x0.5 template that Flex has provided all users. We've adapted it to our label size (1.5 x 0.5) and removed company name and phone.
I've done the design in ZebraDesigner3 (demo version), printed a 'test' from ZebraDesigner3 on to the actual printer & verified the design on labelary. The look on these 3 platforms is exactly what we want. When we print to file, upload to Raw Printer Template, etc etc, and finally print a label from Flex, the barcode & it's accompanying numbers appear to be left aligned. The Preferred Display Name appears centred.
We'd like for the barcode & barcode numbers to be centred on the label.
Any ideas on what we're doing wrong?
Also...it there a way to have the [preferredDisplayName] text wrap, for longer inventory names to appear on two lines instead of just running off the label? Happy to make a second post for this if that's better.
Thanks again for your help! This community is a valuable resource.
-
Official comment
Hey Scott- no second post necessary, as both points tie to the same explanation. Of all the default labels, the 2x0.5 Data Matrix is the only one that has this by default, but it essentially boils down to the code of the template.
In the essentials edition of ZebraDesigner, you can set the anchor point location of an element like a text field, which helps for alignment and sizing, but it does not carry through to the .PRN file you generate to get your template text- you may notice this in labelary as well if you replace your tokens with data that may take that place when the label is printed from Flex.
But, essentially, to center text in a field and have that text wrap over to additional lines, the code is the same with the ^FB or Field Block command, which turns a ^FT or Field Text command/area to a proper text box with formatting options and line wrapping.
So, for default labels, the portion of the template code that represents the item name usually looks like this:
^FT12,46^A0N,20,21^FH\^FD[element.preferredDisplayString]^FS^FT is the command, 12,46 is the x,y position in dots. ^A0N,20,21 is the Font, and font size. ^FD proceeds the content of the field, and ^FS ends it.
In the Data Matrix template, the same command looks like this:
^FT16,75^A0N,20,19^FB304,2,0,C^FH\^FD[element.preferredDisplayString]^FSSo after we define the font with ^A0N, we further define the ^FT field as a Field Block with the ^FB command. To briefly explain ^FB, it works like this: ^FBa,b,c,d,e
a represents the total width of the block in dots
b represents the height of the block in lines
c represents the spacing between lines- zero is the default, not an actual value of zero/no spacing
d represents the alignment, of Left, Center, Right, or Justified, with the respective values of L/C/R/JSo, ^FB304,2,0,C establishes a field block 304 dots wide, text wrap to two lines, default line spacing, and center alignment.
That should cover your inquiries as far as Centering names and other text, and wrapping text to additional lines.
Regarding Barcodes- this is a bit more difficult than text- for Code128, I was able to find a stackoverflow thread on the same topic, but it seems fairly involved- I would typically put dummy information in that field in labelary, and play with the x,y until it was aligned well.
I'll add that as far as I know, the paid version(s) of ZebraDesigner supposedly have more features which can help for projects like this, however for our purposes it's tough to justify the software expense for designing a couple labels, and so that's why I typically suggest doing more advanced things like this in the code, despite the difficulty.
Let us know how it goes!Comment actions -
Aaron! Thanks for taking the time to go into the detail and spelling it out so clearly!! The ^FB explanation was such a fast fix for us. Turns out we had it in the code already, just the height of the block (b) was set to 0. Did a quick little adjustment of the ^FT to keep it looking right and then it was good to go!
Honestly, regarding the barcode alignment, we just manually moved it in ZD3 so that it spits out something that looks right in the real world. The barcode field is up in the top right corner of the software, but looking pretty centred on our physical labels. Unless there's a future issue that might would arise from that, we're happy to go with it as is.
Great support - We really appreciate it!
Scott
Please sign in to leave a comment.
Comments
2 comments