5 Replies Latest reply on May 22, 2018 9:01 AM by Robin West

    Send ZPL string to printer using asp.net C# code

    Jot Singh

      Thanks in advance to all for your valuable time !

       

      I have to print a ZPL image using printer , What I have done so far is Uploading the Image and converting it to the ZPL string

      but now I want to send it to the printer that is on my usb using asp.net C# code , I have read the ~DG command is useful for the same , But still dont know how to use this command to save the image in the printer memory .

       


      Best
      Jot

        • Re: Send ZPL string to printer using asp.net C# code
          Robin West

          Hi Jot,

          Are you using the Link-OS .NET library?

          If you already have the ZPL string of the image it should start with a ~DG, ~DY, or !CISDF already. Open it in a text editor to verify.  If it doesn't, the ~DG command is just a header to the image to tell the printer what to expect. You can add it yourself to the file in the text editor.

          To send this to the printer over USB, there are a few options.

          1. Use the Link-OS SDK

          2. I documented several other methods here: Sending ZPL on USB

           

          Once you have sent the image to the printer, it is stored as a file. The file name is right after the ~DG command as in ~DGE:TESTIMG.PNG,...  You then print it with something like the following:

          ^XA^FO10,10^IME:TESTIMG.PNG^FS^XZ
          

           

          You can send this the same way you sent the image.

            • Re: Send ZPL string to printer using asp.net C# code
              Jot Singh

              Thats okay to add ~Dg and ~Dy command , but I can shoot this ZPL string upto printers memory ?

              • Re: Send ZPL string to printer using asp.net C# code
                Jot Singh

                ^XA ^FO20,20^GFA,1260,1260,12,,,P07FF0,N01EI0780,N0CK018,M0601IF803,L0301KFC060,K04C1MFC10,K0307NF04,K043OFE1,J090QF8,J063QFC20,J087RF10,I011SFC4,I023SFE240,

                I0C7TF1,0019UF8D0,0033UFE40,0067VF0400004WF90,009IFN03KFC800013FFCN01KFC0,023FF07MF9KFE080047FE3NF9LF0,

                04FFC7MFE3LF80009FF8FFEJ0787LF82001FF1FF8J061MFC0013FF3FE1FFE3C7MFE0007FE3FC7FF878NFE0027FE7F8IF1F1OF204FFE7F1FFE3F3OF804FFCFE3FFC7E7OF909FFCFE7FF8FC7OFC09FFCFCIF1

                FCPFC03FFCF8IF3F9PFC03FFCF9FFE7F9PFE03FFCF9FFC7F3PFE07FFE73FFCFF3QF07FFE73FF9FE7QF87FFE73FF1FE7QF8JF27FF3FC7QF8JF07FE3FCFFN01F8JF8FFE7FCF8N01F8MFE7FDF0NF9F8KF800FF

                803NF9F8KF800FF807FFEI07C3F8KF9KF8FFCJ0787F8KF9KF9FF03FF0E1FF8KF8KF3FE1FFC3C7FF8KFC01FF03FC7FF8F8IF8LF03FE07F9IF1F1IF8MF3FE67F3FFE3F3IF8LFE7FCE7E7FFC7E7IF8LFE7FCEFC7

                FF8FC7IF8LFCFF9CFCIF1FCJF8LFCFF1CF8FFE3F9JF8LF9FF3E79FFE7F9JF8LF1FE3E79FFCFF3JF8KFE3FC7E73FF8FF3JF8KFC7FCFE73FF9FE7JF8IF3F0FF9FF33FF1FE7JF8IF003FF3FF27FF3FC7JF8IF00F

                FE3FF87FE3FCKF8IF3IF8IFCFFE7FCKF8IF9IF1LFC7FCKF87FF8FF83JF800FF8003FF87FFC100KF800FF8007FF87IF003KF9LFE7FF03IFE7LF8LFCFFE03QFC01FF001FFE03QFE03FF003FFE09SF3FE7J

                FC0:0RFE7FCKF804RFE7FCKF8007QFCFF9KF0027QFCFF1KF0003QF9FF3JFE1003QF1FE7JFC0009PFE3FC7JFC2000PF87FCKF800107MF1E0FF9KF040027MF003FF3KF080013MF20FFC7JFE0,

                041MF9IF8KFC900I0MF8FFE1KF82000047LFC7F07KF0400I03LFE001KFE0800I01MF807KFC10,J0UF820,J03SFE040,J01SFC480,J08SF81,I0203QFE06,L0QF808,J0403OFE010,J0100OF8040,

                K0883MFC0180,K02007KFE006,L08003IFE0018,L02O060,M04M0380,N0CK01C,O04I01,,^FS ^XZ

                 

                 

                My zpl string is like that. i have to save image in zebra printer. So tell me whether

                1. I am create zpl string

                2. save image to zebra printer?

                If create zpl string then how use ~DY commands.

                  • Re: Send ZPL string to printer using asp.net C# code
                    Robin West

                    Hi Jot, I would change the file to the following to save the image as "MyImage.GRF"

                    ~DGE:MYIMAGE.GRF,1260,12,,,P07FF0,N01EI0780,N0CK018,M0601IF803,L0301KFC060,K04C1MFC10,K0307NF04,K043OFE1,J090QF8,J063QFC20,J087RF10,I011SFC4,I023SFE240,I0C7TF1,0019UF8D0,0033UFE40,0067VF0400004WF90,009IFN03KFC800013FFCN01KFC0,023FF07MF9KFE080047FE3NF9LF0,

                    04FFC7MFE3LF80009FF8FFEJ0787LF82001FF1FF8J061MFC0013FF3FE1FFE3C7MFE0007FE3FC7FF878NFE0027FE7F8IF1F1OF204FFE7F1FFE3F3OF804FFCFE3FFC7E7OF909FFCFE7FF8FC7OFC09FFCFCIF1

                    FCPFC03FFCF8IF3F9PFC03FFCF9FFE7F9PFE03FFCF9FFC7F3PFE07FFE73FFCFF3QF07FFE73FF9FE7QF87FFE73FF1FE7QF8JF27FF3FC7QF8JF07FE3FCFFN01F8JF8FFE7FCF8N01F8MFE7FDF0NF9F8KF800FF

                    803NF9F8KF800FF807FFEI07C3F8KF9KF8FFCJ0787F8KF9KF9FF03FF0E1FF8KF8KF3FE1FFC3C7FF8KFC01FF03FC7FF8F8IF8LF03FE07F9IF1F1IF8MF3FE67F3FFE3F3IF8LFE7FCE7E7FFC7E7IF8LFE7FCEFC7

                    FF8FC7IF8LFCFF9CFCIF1FCJF8LFCFF1CF8FFE3F9JF8LF9FF3E79FFE7F9JF8LF1FE3E79FFCFF3JF8KFE3FC7E73FF8FF3JF8KFC7FCFE73FF9FE7JF8IF3F0FF9FF33FF1FE7JF8IF003FF3FF27FF3FC7JF8IF00F

                    FE3FF87FE3FCKF8IF3IF8IFCFFE7FCKF8IF9IF1LFC7FCKF87FF8FF83JF800FF8003FF87FFC100KF800FF8007FF87IF003KF9LFE7FF03IFE7LF8LFCFFE03QFC01FF001FFE03QFE03FF003FFE09SF3FE7J

                    FC0:0RFE7FCKF804RFE7FCKF8007QFCFF9KF0027QFCFF1KF0003QF9FF3JFE1003QF1FE7JFC0009PFE3FC7JFC2000PF87FCKF800107MF1E0FF9KF040027MF003FF3KF080013MF20FFC7JFE0,

                    041MF9IF8KFC900I0MF8FFE1KF82000047LFC7F07KF0400I03LFE001KFE0800I01MF807KFC10,J0UF820,J03SFE040,J01SFC480,J08SF81,I0203QFE06,L0QF808,J0403OFE010,J0100OF8040,

                    K0883MFC0180,K02007KFE006,L08003IFE0018,L02O060,M04M0380,N0CK01C,O04I01,,

                • Re: Send ZPL string to printer using asp.net C# code
                  Jot Singh

                  Hi Please help me! I have create ZPL string and need to store in Zebra printer memory. How can this done...