asp.netvb.netipl

How to send a picture (or retrieve from printers memory) through raw IPL?


I am printing labels on an Intermec printer via IP and have been asked to add our company logo to the label. In other applications I am able to break apart a bitmap and send raw ZPL, but I can't figure it out in IPL. I would also settle for saving the image on the printers, but I can't figure out how to retrieve it to print. Here is my simple procedure, any help would be great!

Dim clientSocket As New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
        clientSocket.Connect(New IPEndPoint(IPAddress.Parse(IP), 9100))
        Dim Format As String = "<STX><ESC>C<ETX> Select Advanced mode" &
                               "<STX><ESC>P<ETX> Enter Program mode" &
                               "<STX>E22;F22;<ETX> Erase format 22, create format 22" &
                               "<STX>H0;o520,50;f0;c26;h12;w12;d0,50;<ETX> Edit/create human-readable field 0" &
                               "<STX>H1;o520,90;f0;c26;h12;w12;d0,50;<ETX> Edit/create human-readable field 1" &
                               "<STX>H2;o520,130;f0;c26;h12;w12;d0,50;<ETX> Edit/create human-readable field 2" &
                               "<STX>H3;o50,340;f0;c26;h12;w12;d0,50;<ETX> Edit/create human-readable field 3" &
                               "<STX>H4;o50,380;f0;c26;h12;w12;d0,50;<ETX> Edit/create human-readable field 4" &
                               "<STX>H5;o50,420;f0;c26;h12;w12;d0,50;<ETX> Edit/create human-readable field 5" &
                               "<STX>H6;o50,535;f0;c26;h12;w12;d0,50;<ETX> Edit/create human-readable field 6" &
                               "<STX>L8;o30,30;f0;l760;w3;<ETX> Edit/create line field 8" &
                               "<STX>L9;o30,580;f0;l760;w3;<ETX> Edit/create line field 9" &
                               "<STX>L10;o790,31;f3;l550;w3;<ETX> Edit/create line field 10" &
                               "<STX>L11;o29,580;f1;l550;w3;<ETX> Edit/create line field 11" &
                               "<STX>R;<ETX> Save format and exit to Print mode"

        Dim PrintData As String = "<STX><ESC>E22<ETX> Access format 22" &
                                  "<STX><CAN><ETX> Erase all data" &
                                  "<STX>DATE: 7/17/2020<CR><ETX> Data for human-readable field 0" &
                                  "<STX>LWO # 118826<CR><ETX> Data for human-readable field 1" &
                                  "<STX>QUANTITY: 5<CR><ETX> Data for human-readable field 2" &
                                  "<STX>LEE P/N & REV: PCHX0024024S A<CR><ETX> Data for human-readable field 3" &
                                  "<STX>DESCRIPTION:<CR><ETX> Data for human-readable field 4" &
                                  "<STX>LEE RELIEF VALVE, 8mm, INSERT, REVERSE, 241 BAR<CR><ETX> Data for human-readable field 5" &
                                  "<STX>CUSTOMER: Parker Hannifin<CR><ETX> Data for human-readable field 6" &
                                  "<STX><RS><ETB><ETX> Print "
        Dim Label As String = Format & PrintData

        clientSocket.Send(Encoding.UTF8.GetBytes(Label))
        clientSocket.Close()

Solution

  • OK, I was able to do this by saving the picture to the printer.

    The first step was to make a monochrome bitmap the correct size and scale. Next you have to rename it UDCn.LOGO - where n=a number you will later reference. Save it to the printer.

    Then call it in the code

    <STX>U1;o200,400;f1;c1;w1;h1;<ETX>
    

    Another thing to consider is that you can't scale down the picture. w1;h1 is actual size (by pixels), so getting you image the correct size is done outside of the IPL code unless you want to make it bigger.