1 Reply Latest reply on Aug 31, 2018 2:09 PM by Robin West

    I am using CPCL in Android.

    vinothsakthi kumarG

      I would like to write multiple lines on a printout, but my code is printing them out on top of eachother. I am using CPCL in Android.

       

       

      String cpclData = "! 0 200 200 210 1\r\n"

                                                  + "TEXT 5 0 20 10 " + receiptString() + " \r\n" //type, font, size, x position, y position, data

                                                  + "FORM\r\n"

                                                  + "PRINT\r\n";

       

                                          connection.write(cpclData.getBytes());

       

      How can multiple lines be achieved?

        • Re: I am using CPCL in Android.
          Robin West

          Hi,

          You have two choices, either print each line and give it a location, or print in line mode:

          String cpclData = "! 0 200 200 210 1\r\n"

                                                      + "TEXT 5 0 20 10 " + line1() + " \r\n" //type, font, size, x position, y position, data

                                                      + "TEXT 5 0 20 30 " + line2() + " \r\n" //type, font, size, x position, y position, data

                                                      + "TEXT 5 0 20 50 " + line3() + " \r\n" //type, font, size, x position, y position, data

                                                      + "FORM\r\n"

                                                      + "PRINT\r\n";

          or

           

          String cpclLineData = "! U1 SETLF 10\r\n"

                                                      + "Test line One\r\nTest line Two\r\nTest line 3\r\n";