variable replace prn templet file problem

S Steven Wu 3 years 7 months ago
308 0 0

I'd like to use c# code and zpl command to print a file on zebra printer
step 1)create a prn templet file
step 2) c# code to replace variables in prn file and send file to zebra printer.

problem:
I'd like to use Code128 auto on label
if variables are numbers, it's ok.
if variables are numbers mixed letters, the barcode will be longer than input value in templet file directly.
e.g.

CT~~CD,~CC^~CT~
^XA~TA000~JSN^LT0^MNW^MTT^PON^PMN^LH0,0^JMA^PR2,2~SD22^JUS^LRN^CI0^XZ
^XA
^MMT
^PW799
^LL0400
^LS0
^BY2,3,100^FT30,241^BCN,,Y,N
^FD>:##NEWBATCH##^FS
^PQ1,0,1,Y^XZ

##NEWBATCH## is variables, value will be  0123456789A01234B0123, but if I try to input this value into prn file directly instead of  variable "##NEWBATCH## " ,then I will see
CT~~CD,~CC^~CT~
^XA~TA000~JSN^LT0^MNW^MTT^PON^PMN^LH0,0^JMA^PR2,2~SD22^JUS^LRN^CI0^XZ
^XA
^MMT
^PW799
^LL0400
^LS0
^BY2,3,100^FT30,241^BCN,,Y,N
^FD>:0123456789>6A>50123>64B>50123^FS
^PQ1,0,1,Y^XZ

value 0123456789>6A>50123>64B>50123 instead of  0123456789A01234B0123
value 0123456789>6A>50123>64B>50123 is right.
my question is how to convert "0123456789A01234B0123" to "0123456789>6A>50123>64B>50123",
what is the convert rule of zebra designer?(any c# code sample?)

CONTACT
Can’t find what you’re looking for?