3 Replies Latest reply on May 16, 2018 11:43 AM by Robin West

    c# ZPL string command to adjust left position of stored label

    James Morris

      I am using the zpl string below to send data to and print a stored label on our ZT410 printer. Everything is working except the "^LS" command. It is very strange because the printer settings for left position reflect the data I provide( example -23). The problem is the label is not adjusted. The "^LT" command works. I can change it  and the label moves accordingly. Any help would be appreciated. Thanks

       

                  string ZPL_STRING = string.Format(@"^XA                      

                                      ^XFE:csa.ZPL                                                       

                                      ^FN12^FD{0}^FS

                                      ^FN11^FD{1}^FS

                                      ^FN13^FD{2}^FS

                                      ^FN14^FD{3}^FS

                                      ^LS-23^FS 

                                      ^LT12^FS                           

                                      ^PQ{4}                          

                                      ^XZ

                                      ",

                                       data1,

                                       data2,

                                       data3,

                                       data4,

                                       data5

                                       );

        • Re: c# ZPL string command to adjust left position of stored label
          Robin West

          Hi James,

          ^LS is one of those commands that is best sent separately before your main print job. Try changeing the ZPL_STRING to:

          string ZPL_STRING = string.Format(@"

                                          ^XA^LS-23^XZ

                                          ^XA                     

                                          ^XFE:csa.ZPL                                                      

                                          ^FN12^FD{0}^FS

                                          ^FN11^FD{1}^FS

                                          ^FN13^FD{2}^FS

                                          ^FN14^FD{3}^FS

                                          ^LT12^FS                          

                                          ^PQ{4}                         

                                          ^XZ

                                          ",

                                           data1,

                                           data2,

                                           data3,

                                           data4,

                                           data5

                                           );

           

          I tested it with the following string:

          ^XA^DFE:test.zpl^FO0,0^GB400,200,5^FS^XZ^XA^XFE:test.zpl^XZ^XA^LS-23^XZ^XA^XFE:test.zpl^XZ

          This prints out 2 labels, each with a box, but the second is shifted from the first.