I have the following ZPL code:
^XZ
^XA
^MMT
^PW900
^LL300
^LS0
^FT900,132^A0I,150,150^FB854,1,38,C^FH\^CI28^FDABC#1\5C&^FS^CI27
^BY4,3,60^FT724,31^BCI,,N,N
^FH\^FD>:FREEZER#1^FS
^PQ1,0,1,Y
^XZ
which works fine if you paste it here : https://labelary.com/viewer.html
However, I am trying to store it in a variable in my code:
let prepareData = "^XZ"+
"^XA"+
"^MMT"+
"^PW900"+
"^LL300"+
"^LS0"+
"^FT900,132^A0I,150,150^FB854,1,38,C^FH\^CI28^FDNBA#1\5C&^FS^CI27"+
"^BY4,3,60^FT724,31^BCI,,N,N"+
"^FH\^FD>:FREEZER#1^FS"+
"^PQ1,0,1,Y"+
"^XZ"
JSFiddle here : https://jsfiddle.net/x8c14tpn/
It seems to be printing in console some weird characters which I think I should escape but I’m afraid if escaping it would mess up the code. So is there a way to keep it as it is?
Visual Studio was telling me Octal escape sequences are not allowed. Use the syntax '\x05'
for the \5
on this line "^FT900,132^A0I,150,150^FB854,1,38,C^FH\^CI28^FDNBA#1\5C&^FS^CI27"+
. Even though I replaced it with \x05
it didn’t print as expected.