ZM 400 Label Printing

ivylnm
ivylnm used Ask the Experts™
on
I am trying to code in Delphi so that my system can print out label accordingly.  However I have no clue on how to tell the system about the label size, besides I am trying to print label parrallel, meaning two labels at one row.  Does anyone have any sample code for ZM label printing ?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
Are u using a reports utility? Most of them have allowance for labels. Also usually if u try to print on a paper that is smaller than your document size it just prints what it can starting on the top left of the paper.

Author

Commented:
I didn't use any report utility.   I mainly write codes in delphi in order to print out the label.

I use a "sendcommand" function to send the below strings to the printer :-
^XA
^LH0,0
^FO0,0^FD<#ProductName>^FS
^FO5,5
^B3
^FS
^XZ

However I haven't known how to set the label size as well as printing two labels in row.  And I have the label problem as well, as everytime after I test printing, it will come out with more blank labels, it just didn't stop right at the label which is printed.
Freelance Project Manager
Top Expert 2010
Commented:
if you mean printing the barcode next to the name, then you are missing the barcode field value in your example. You would have to calculate the right position as well. Maybe use the right aligment to put it, or use ^FT command . from manual, in the ^FT command :
"When a coordinate is missing, the position following the last formatted field is assumed. This
remembering simplifies field positioning with respect to other fields. Once the first field is
positioned, other fields follow automatically."

You might want also to pad your labels with spaces using Delphi Format with '%-20s' for example (will right align the text, padded with spaces on the right up to 20 chars)
Procedure PrintLabel(ProductName:String);
Var
 Cmd:TStringList;
begin
 Cmd:=TStringList.Create;
 Cmd.Add('^XA^LH0,0');
 Cmd.Add(Format('^FT0,0^FD%-30s^FS',[ProductName]));
 Cmd.Add(Format('^FT^B3^FD%s^FS',[ProductName]));
 Cmd.Add('^XZ');
 SendCommand(Cmd.Text);
 Cmd.Free;
end;

Open in new window

Emmanuel PASQUIERFreelance Project Manager
Top Expert 2010

Commented:
Emmanuel PASQUIERFreelance Project Manager
Top Expert 2010

Commented:
Would you mind posting the command that suits your needs ?

Author

Commented:
^XA~TA000~JSN^LT0^MNW^MTT^PON^PMN^LH0,0^JMA^PR2,2^MD10^JUS^LRN^CI0^XZ
^XA
^MMT
^LL0194
^PW584
^LS0
^BY2,3,43^FT372,152^BCN,,Y,N
^FD<#ProductIDB>^FS
^BY2,3,43^FT70,152^BCN,,Y,N
^FD<#ProductIDA>^FS
^FT372,56^A0N,28,28^FH\^FD<#ProductNameB>^FS
^FT372,92^A0N,23,24^FH\^FD<#ProductSecNameB>^FS
^FT70,56^A0N,28,28^FH\^FD<#ProductNameA>^FS
^FT70,92^A0N,23,24^FH\^FD<#ProductSecNameA>^FS
^PQ<#NUMBEROFCOPY>,0,1,Y^XZ

The above are the codes I find out from the Zebra Designer where I have designed two labels parallel.  Mainly, the below two commands telling the printer about the length and the print width of the label.
^LL0194
^PW584

As for printing parallel, just need to get the correct X and Y then should be fine.

Emmanuel PASQUIERFreelance Project Manager
Top Expert 2010

Commented:
Ok, then If you don't mind, I object the fact that you close like that.
I stated that you should use ^FT for positioning your field

Besides, you could test the tools coming with your hardware before asking experts who don't have what you have, and must dig in manuals for solutions. It takes time you know, and some points is a fair price
Emmanuel PASQUIERFreelance Project Manager
Top Expert 2010

Commented:
I already commented why I object and think this answer deserves some points
http:#33146464

Author

Commented:
Dear Admin,

I would like to go for #3.  http:#33146464  can be selected as answer however it only answers part of my question.  This is because the Expert did mention about the command of ^FT to get the label to be printed at specific location.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial