3 Replies Latest reply on Dec 18, 2017 12:37 PM by Samantha Corn

    Formatting multi-line text

    Srikanth Reddy

      Hi,

      I am trying to print a label but the new line char "\&" doesn't seem to be working in my zpl code.

      I am not sure what I am missing

      Any help is appreciated.

       

      CT~~CD,~CC^~CT~

      ^XA~TA000~JSN^LT0^MNW^MTT^PON^PMN^LH0,0^JMA^PR6,6~SD10^JUS^LRN^CI0^XZ

      ^XA

      ^MMT

      ^PW812

      ^LL1015

      ^LS0

      ^FT640,761^A0B,34,33^FH\^FDCustomer PO #:^FS

      ^FT740,761^A0B,34,33^FH\^FDOrder #:^FS

      ^FT740,446^A0B,34,33^FH\^FD999999^FS

      ^FT640,446^A0B,34,33^FH\^FDTAS TEST^FS

      ^FT308,707^A0B,39,38^FH\^FD1234 TEST ST\&SUITE# 567\&LOS ANGELES,CA 90045^FS

      ^PQ1,0,1,Y^XZ

       

      Thanks & regards

        • Re: Formatting multi-line text
          Robin West

          Hi Srikanth, You have to use a multi-line ZPL command (^FB or ^TB) to show multiple lines of text with one data field:

           

          CT~~CD,~CC^~CT~

          ^XA~TA000~JSN^LT0^MNW^MTT^PON^PMN^LH0,0^JMA^PR6,6~SD10^JUS^LRN^CI0^XZ

          ^XA

          ^MMT

          ^PW812

          ^LL1015

          ^LS0

          ^FT640,761^A0B,34,33^FH\^FDCustomer PO #:^FS

          ^FT740,761^A0B,34,33^FH\^FDOrder #:^FS

          ^FT740,446^A0B,34,33^FH\^FD999999^FS

          ^FT640,446^A0B,34,33^FH\^FDTAS TEST^FS

          ^FT308,707^FB490,4,^A0B,39,38^FH\^FD1234 TEST ST\&SUITE# 567\&LOS ANGELES,CA 90045^FS

          ^PQ1,0,1,Y^XZ

            • Re: Formatting multi-line text
              Srikanth Reddy

              Hi Robin,

               

              Thanks for your reply.

              Yes I tried, but for some reason "\&" is not being reflected as a newline character.

               

              After the change the output looks as below, the customer PO # and Order # printed as expected

               

              1234 TEST ST&SUITE#

              567&LOS ANGELS,CA 90045

               

              Thanks

                • Re: Formatting multi-line text
                  Samantha Corn

                  Hi Srikanth,

                   

                  Sorry for the delay in response, but the reason this didn't work is because of the ^FH\ commands. That command sets \ as the field hexadecimal indicator, and is meant to be used in conjunction with the hex for a newline, not the & shortcut. Removing that will allow you to print multi-line:

                   

                  CT~~CD,~CC^~CT~

                  ^XA~TA000~JSN^LT0^MNW^MTT^PON^PMN^LH0,0^JMA^PR6,6~SD10^JUS^LRN^CI0^XZ

                  ^XA

                  ^MMT

                  ^PW812

                  ^LL1015

                  ^LS0

                  ^FT640,761^A0B,34,33^FDCustomer PO #:^FS

                  ^FT740,761^A0B,34,33^FDOrder #:^FS

                  ^FT740,446^A0B,34,33^FD999999^FS

                  ^FT640,446^A0B,34,33^FDTAS TEST^FS

                  ^FT308,707^FB490,4,^A0B,39,38^FD1234 TEST ST\&SUITE# 567\&LOS ANGELES,CA 90045^FS

                  ^PQ1,0,1,Y^XZ