Swift - ZPL, printing correctly on first print when printer is turned on but incorrectly every print after?











up vote
0
down vote

favorite












I am trying to send two print jobs to the printer . I am trying to print the a label in the correct orientation then using ^POI to print it a second time inverted. This works when the printer has first been turned on but then every print after the first it prints the 2 labels in the same orientation almost ignoring the ^POI.



My ZPL (zplData):



^XA
^LL600
^LS0
^BY2,2,59
^LH0,0
^FT100,400^BQN,2,10^FD##(attendee!.id)^FS
^A0N,50,50^FO350,240^FD(name)^FS
^A0N,40,40^FO350,290^FD(attendee!.company)^FS
^XZ


(zplDataFlip):



^XA
^POI
^LL600
^LS0
^BY2,2,59
^LH0,0
^FT100,400^BQN,2,10^FD##(attendee!.id)^FS
^A0N,50,50^FO350,240^FD(name)^FS
^A0N,40,40^FO350,290^FD(attendee!.company)^FS
^XZ


Swift to send Job to printer:



if success! {

thePrinterConn?.write(zplData.data(using: String.Encoding.utf8), error: errorPtr)

thePrinterConn?.write(zplDataFlip.data(using: String.Encoding.utf8), error: errorPtr)

}









share|improve this question


























    up vote
    0
    down vote

    favorite












    I am trying to send two print jobs to the printer . I am trying to print the a label in the correct orientation then using ^POI to print it a second time inverted. This works when the printer has first been turned on but then every print after the first it prints the 2 labels in the same orientation almost ignoring the ^POI.



    My ZPL (zplData):



    ^XA
    ^LL600
    ^LS0
    ^BY2,2,59
    ^LH0,0
    ^FT100,400^BQN,2,10^FD##(attendee!.id)^FS
    ^A0N,50,50^FO350,240^FD(name)^FS
    ^A0N,40,40^FO350,290^FD(attendee!.company)^FS
    ^XZ


    (zplDataFlip):



    ^XA
    ^POI
    ^LL600
    ^LS0
    ^BY2,2,59
    ^LH0,0
    ^FT100,400^BQN,2,10^FD##(attendee!.id)^FS
    ^A0N,50,50^FO350,240^FD(name)^FS
    ^A0N,40,40^FO350,290^FD(attendee!.company)^FS
    ^XZ


    Swift to send Job to printer:



    if success! {

    thePrinterConn?.write(zplData.data(using: String.Encoding.utf8), error: errorPtr)

    thePrinterConn?.write(zplDataFlip.data(using: String.Encoding.utf8), error: errorPtr)

    }









    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I am trying to send two print jobs to the printer . I am trying to print the a label in the correct orientation then using ^POI to print it a second time inverted. This works when the printer has first been turned on but then every print after the first it prints the 2 labels in the same orientation almost ignoring the ^POI.



      My ZPL (zplData):



      ^XA
      ^LL600
      ^LS0
      ^BY2,2,59
      ^LH0,0
      ^FT100,400^BQN,2,10^FD##(attendee!.id)^FS
      ^A0N,50,50^FO350,240^FD(name)^FS
      ^A0N,40,40^FO350,290^FD(attendee!.company)^FS
      ^XZ


      (zplDataFlip):



      ^XA
      ^POI
      ^LL600
      ^LS0
      ^BY2,2,59
      ^LH0,0
      ^FT100,400^BQN,2,10^FD##(attendee!.id)^FS
      ^A0N,50,50^FO350,240^FD(name)^FS
      ^A0N,40,40^FO350,290^FD(attendee!.company)^FS
      ^XZ


      Swift to send Job to printer:



      if success! {

      thePrinterConn?.write(zplData.data(using: String.Encoding.utf8), error: errorPtr)

      thePrinterConn?.write(zplDataFlip.data(using: String.Encoding.utf8), error: errorPtr)

      }









      share|improve this question













      I am trying to send two print jobs to the printer . I am trying to print the a label in the correct orientation then using ^POI to print it a second time inverted. This works when the printer has first been turned on but then every print after the first it prints the 2 labels in the same orientation almost ignoring the ^POI.



      My ZPL (zplData):



      ^XA
      ^LL600
      ^LS0
      ^BY2,2,59
      ^LH0,0
      ^FT100,400^BQN,2,10^FD##(attendee!.id)^FS
      ^A0N,50,50^FO350,240^FD(name)^FS
      ^A0N,40,40^FO350,290^FD(attendee!.company)^FS
      ^XZ


      (zplDataFlip):



      ^XA
      ^POI
      ^LL600
      ^LS0
      ^BY2,2,59
      ^LH0,0
      ^FT100,400^BQN,2,10^FD##(attendee!.id)^FS
      ^A0N,50,50^FO350,240^FD(name)^FS
      ^A0N,40,40^FO350,290^FD(attendee!.company)^FS
      ^XZ


      Swift to send Job to printer:



      if success! {

      thePrinterConn?.write(zplData.data(using: String.Encoding.utf8), error: errorPtr)

      thePrinterConn?.write(zplDataFlip.data(using: String.Encoding.utf8), error: errorPtr)

      }






      swift zpl-ii






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 21 hours ago









      Danyal2020

      134




      134
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          Figured it out. The printer saves the orientation of the print after ^POa is used, so you have to define what orientation you want every time.



          My ZPL (zplData):



          ^XA
          ^PON
          ^LL600
          ^LS0
          ^BY2,2,59
          ^LH0,0
          ^FT100,400^BQN,2,10^FD##(attendee!.id)^FS
          ^A0N,50,50^FO350,240^FD(name)^FS
          ^A0N,40,40^FO350,290^FD(attendee!.company)^FS
          ^XZ


          (zplDataFlip):



          ^XA
          ^POI
          ^LL600
          ^LS0
          ^BY2,2,59
          ^LH0,0
          ^FT100,400^BQN,2,10^FD##(attendee!.id)^FS
          ^A0N,50,50^FO350,240^FD(name)^FS
          ^A0N,40,40^FO350,290^FD(attendee!.company)^FS
          ^XZ





          share|improve this answer





















            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














             

            draft saved


            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53371371%2fswift-zpl-printing-correctly-on-first-print-when-printer-is-turned-on-but-inc%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            Figured it out. The printer saves the orientation of the print after ^POa is used, so you have to define what orientation you want every time.



            My ZPL (zplData):



            ^XA
            ^PON
            ^LL600
            ^LS0
            ^BY2,2,59
            ^LH0,0
            ^FT100,400^BQN,2,10^FD##(attendee!.id)^FS
            ^A0N,50,50^FO350,240^FD(name)^FS
            ^A0N,40,40^FO350,290^FD(attendee!.company)^FS
            ^XZ


            (zplDataFlip):



            ^XA
            ^POI
            ^LL600
            ^LS0
            ^BY2,2,59
            ^LH0,0
            ^FT100,400^BQN,2,10^FD##(attendee!.id)^FS
            ^A0N,50,50^FO350,240^FD(name)^FS
            ^A0N,40,40^FO350,290^FD(attendee!.company)^FS
            ^XZ





            share|improve this answer

























              up vote
              0
              down vote













              Figured it out. The printer saves the orientation of the print after ^POa is used, so you have to define what orientation you want every time.



              My ZPL (zplData):



              ^XA
              ^PON
              ^LL600
              ^LS0
              ^BY2,2,59
              ^LH0,0
              ^FT100,400^BQN,2,10^FD##(attendee!.id)^FS
              ^A0N,50,50^FO350,240^FD(name)^FS
              ^A0N,40,40^FO350,290^FD(attendee!.company)^FS
              ^XZ


              (zplDataFlip):



              ^XA
              ^POI
              ^LL600
              ^LS0
              ^BY2,2,59
              ^LH0,0
              ^FT100,400^BQN,2,10^FD##(attendee!.id)^FS
              ^A0N,50,50^FO350,240^FD(name)^FS
              ^A0N,40,40^FO350,290^FD(attendee!.company)^FS
              ^XZ





              share|improve this answer























                up vote
                0
                down vote










                up vote
                0
                down vote









                Figured it out. The printer saves the orientation of the print after ^POa is used, so you have to define what orientation you want every time.



                My ZPL (zplData):



                ^XA
                ^PON
                ^LL600
                ^LS0
                ^BY2,2,59
                ^LH0,0
                ^FT100,400^BQN,2,10^FD##(attendee!.id)^FS
                ^A0N,50,50^FO350,240^FD(name)^FS
                ^A0N,40,40^FO350,290^FD(attendee!.company)^FS
                ^XZ


                (zplDataFlip):



                ^XA
                ^POI
                ^LL600
                ^LS0
                ^BY2,2,59
                ^LH0,0
                ^FT100,400^BQN,2,10^FD##(attendee!.id)^FS
                ^A0N,50,50^FO350,240^FD(name)^FS
                ^A0N,40,40^FO350,290^FD(attendee!.company)^FS
                ^XZ





                share|improve this answer












                Figured it out. The printer saves the orientation of the print after ^POa is used, so you have to define what orientation you want every time.



                My ZPL (zplData):



                ^XA
                ^PON
                ^LL600
                ^LS0
                ^BY2,2,59
                ^LH0,0
                ^FT100,400^BQN,2,10^FD##(attendee!.id)^FS
                ^A0N,50,50^FO350,240^FD(name)^FS
                ^A0N,40,40^FO350,290^FD(attendee!.company)^FS
                ^XZ


                (zplDataFlip):



                ^XA
                ^POI
                ^LL600
                ^LS0
                ^BY2,2,59
                ^LH0,0
                ^FT100,400^BQN,2,10^FD##(attendee!.id)^FS
                ^A0N,50,50^FO350,240^FD(name)^FS
                ^A0N,40,40^FO350,290^FD(attendee!.company)^FS
                ^XZ






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 13 hours ago









                Danyal2020

                134




                134






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53371371%2fswift-zpl-printing-correctly-on-first-print-when-printer-is-turned-on-but-inc%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Wiesbaden

                    Marschland

                    Dieringhausen