title: Print Bitmap to ESC/POS printer
body: <p>I am trying to print to a ESC/POS compatible printer and am struggling to get my head around <code>GS v 0</code>. I have just connected from a Mac and sending commands is <code>hex</code> via CoolTerm. </p>
  
  <p>The docs say ... </p>
  
  <pre><code>  GS v 0 m xL xH yL yH d1....dk
    -----------------------------------------------------
    [Name] Print raster bit image
    [Format] ASCII GS v 0 m xL xH yL yH d1....dk
    Hex 1D 76 30 m xL xH yL yH d1....dk
    Decimal 29 118 48 m xL xH yL yH d1....dk
    [Range] 0≤xL≤48, xH=0; 0≤yL≤255, yH=0; 0≤d≤255
    k=(xL+xH×256)×(yL+yH×256)(k≠0)
    [Description] Selects Raster bit-image mode. The value of m selects the mode, as follows:
  +------+------------+----------------------------+---------------------------+
  |  m   |    MODE    |      Vertical Dot Density  |  Horizontal Dot density   |
  +------+------------+----------------------------+---------------------------+
  |0, 48 |   Normal   |          200 DPI           |        200 DPI            |
  +------+------------+----------------------------+---------------------------+
  |1, 49 |Double-width|          200 DPI           |        100 DPI            |
  +------+-------------+---------------------------+---------------------------+
  |2, 50 |Double-height|         100 DPI           |        200 DPI            |
  +------+-------------+---------------------------+---------------------------+
  |3, 51 | Quadruple  |          100 DPI           |        100 DPI            |
  +------+-------------+---------------------------+---------------------------+
  
   • xL, xH, select the number of data bits ( xL+ xH × 256) in the horizontal direction for the bit image.
   • yL, yH, select the number of data bits ( yL+ yH × 256) in the vertical direction for the bit image.
   • This command has no effect in all print modes (character size, emphasized, double-strike, upside-down, underline, white/black reverse printing, etc.) for raster bit image.
   • The part of bit image that exceeds the printable area will not be printed.
   • d indicates the bit-image data. Set time a bit to 1 prints a dot and setting it to 0 does not print a dot.
  </code></pre>
  
  <p>So from this I deduce I need to send the following in <code>HEX</code></p>
  
  <pre><code> 1D 76 30 30 20 00 00 01
  </code></pre>
  
  <p>Does the image data now follow this, and do I have to send a message saying the image has ended?</p>