title: Sending commands directly to Zebra EPL
body: <p>I am trying to send commands directly to a Zebra TLP2844 printer. I followed the suggestion made <a href="https://stackoverflow.com/questions/16949683/sending-data-to-usb-printer-in-delphi">here</a> and my final code came to be as follows:</p>
  
  <pre><code>var
    cm: String;
    p: TPrinter;
    i: integer;
  begin
    p := Printer;
    p.BeginDoc;    
    for i := 0 to memo1.Lines.Count-2 do
    begin
      cm := memo1.Lines[i];
      if Escape(p.Canvas.Handle,
                  PASSTHROUGH,
                  Length(cm),
                  PAnsiChar(cm),
                  nil) = 0 then
        ShowMessage('Command error: ' + IntToStr(GetLastError));
    end;
    p.EndDoc;
  end;
  </code></pre>
  
  <p>The content of memo1 is (first line is empty) as purposed <a href="http://nicholas.piasecki.name/blog/2009/03/sending-raw-epl2-directly-to-a-zebra-lp2844-via-c/" rel="nofollow noreferrer">here</a>:</p>
  
  <pre><code>N
  q609
  Q203,26
  B26,26,0,UA0,2,2,152,B,"603679025109"
  A253,26,0,3,1,1,N,"SKU 6205518 MFG 6354"
  A253,56,0,3,1,1,N,"2XIST TROPICAL BEACH"
  A253,86,0,3,1,1,N,"STRIPE SQUARE CUT TRUNK"
  A253,116,0,3,1,1,N,"BRICK"
  A253,146,0,3,1,1,N,"X-LARGE"
  P1,1
  </code></pre>
  
  <p>The commands don't seem to be properly received or interpreted by the printer. I checked that the printer is in Page Mode (EPL2), with the suggested code I am able to open the printer handle. But nothing is printed, only a new line of labels is feeded.</p>
  
  <p>I tried to completely change the commands to something obviously wrong and the behaviour is the same.</p>
  
  <p>What else should I be looking to get things printed?</p>