title: Writing correct ESC/POS commands for POS printer
body: <p>I'm trying to write proper ESC/POS commands for 58mm POS thermal printer. I tried to input this commands as ASCII text and also converted it to HEX, but in both cases printer print just this code, not receipt output. Something wrong is with code, can no find examples of working code(not commands).</p>
  
  <pre><code>ESC @
  ESC a SOH
  ESC ! NUL
  ESC t 25 (select character code table)
  ESC a 1.49 (centering text)
  ESC E 1
  Bold text
  ESC E 0
  Text line 1
  Text line 2
  Text line 3
  ESC a 0
  Date/Time: January 14, 2002 15:00
  
  ESC d &amp;H03
  ESC a 0
  ESC! 1
  TM-U210B $20.00
  &amp;H0A
  Item 1 $20.00
  &amp;H0A
  Item 2 $10.00
  &amp;H0A
  &amp;H0A
  ESC ! D
  TOTAL $30.00
  LF
  ESC! NUL
  ------------------------------
  LF
  PAID $30.00
  LF
  CHANGE $ 0.00
  LF
  
  Thank you!
  GS k m d...dk  NUL
  </code></pre>
  
  <p>I want get printed receipt like this <a href="http://img10.imageshack.us/img10/4972/s80x.png" rel="nofollow">sample</a>.
  The available commands for printer commands is <a href="http://www.scribd.com/doc/149141847/58XX-Programming-Manual" rel="nofollow">here</a>. Can someone show me the proper code for this?</p>