Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>EDIT</strong>: Update based on reading your question: <a href="https://stackoverflow.com/questions/16597789/print-bitmap-on-esc-pos-printer-java">https://stackoverflow.com/questions/16597789/print-bitmap-on-esc-pos-printer-java</a></p> <p>I will assume that the printer you are printing to is the same as above, i.e. the Rego Thermal Printer. This, as you note, support the <a href="http://www.zlgmcu.com/ZLG/Print/pdf/ZLG-ESCPOS_en.pdf" rel="nofollow noreferrer">ESC/POS Page Description Language</a>.</p> <hr> <p>Printers interpret data streamed to them as either a marked up document (in a similar way to how browser interpret HTML). In some cases, the printer literally runs the document as a program (eg PostScript). Link: <a href="https://en.wikipedia.org/wiki/Page_description_language" rel="nofollow noreferrer">Page Description Languages</a>.</p> <p>Common languages are: </p> <ul> <li><strong>Yours</strong>: <a href="http://www.zlgmcu.com/ZLG/Print/pdf/ZLG-ESCPOS_en.pdf" rel="nofollow noreferrer">ESC/POS</a>.</li> <li><a href="https://en.wikipedia.org/wiki/PostScript" rel="nofollow noreferrer">PostScript</a></li> <li><a href="https://en.wikipedia.org/wiki/Printer_Command_Language" rel="nofollow noreferrer">PCL</a></li> <li><a href="https://en.wikipedia.org/wiki/Zebra_(programming_language)" rel="nofollow noreferrer">ZPL</a></li> </ul> <p>You need to read the specifications for your printer to determine which language to use - if you need to support <em>any</em> printer, then you have a very large job ahead of you :(</p> <p>In ESC/POS, you will need to use the <code>GS v 0</code> command (documented on p33). You do this by sending the the characters <code>0x1D7630</code> across the serial link, followed by a set of arguments:</p> <pre><code>ASCII: Gs v 0 Decimal: 29 118 48 m xL xH yL yH [d]k Hexadecimal: 1D 76 30 m xL xH yL yH [d]k </code></pre> <p>Parameter definitions: </p> <ul> <li>m: <ul> <li>0,48: normal mode (1:1 scale)</li> <li>1,49: double-width</li> <li>2,50: double-height</li> <li>3,51: double-width + double-height </li> </ul></li> <li>xL, xH specifies (xL + xH × 256) bytes in horizontal direction for the bit image. </li> <li>yL, yH specifies (yL + yH × 256) dots in vertical direction for the bit image. </li> <li>[d]k specifies the bit image data (raster format). </li> <li>k indicates the number of bit image data. k is an explanation parameter; therefore, it does not need to be transmitted. </li> </ul> <p>Notes:</p> <ul> <li>When data [d]k is 1 specifies a bit printed to 1 and not printed to 0. </li> <li>If a raster bit image exceeds one line of print area, the excess data is not printed. </li> <li>This command executes paper feed for amount needed for printing the bit image regardless of the settings by ESC 2 or ESC 3. </li> <li>After printing the bit image, this command sets the print position to the beginning of the line, and clears up the buffer. </li> <li>When this command is executed, the data is transmitted and printed synchronously. So no other printing command is required.</li> </ul> <p>There are several more extensive expositions:</p> <ul> <li><a href="http://nicholas.piasecki.name/blog/2009/12/sending-a-bit-image-to-an-epson-tm-t88iii-receipt-printer-using-c-and-escpos/" rel="nofollow noreferrer">http://nicholas.piasecki.name/blog/2009/12/sending-a-bit-image-to-an-epson-tm-t88iii-receipt-printer-using-c-and-escpos/</a></li> <li><a href="https://stackoverflow.com/a/14099717/1395668">On SO in C#</a>. While not Java, it is close enough to be a template.</li> </ul> <hr> <p>Unfortunately there is no printer API in Android. If you feel strongly about this, do follow these issues:</p> <ul> <li><a href="https://code.google.com/p/android/issues/detail?id=40486" rel="nofollow noreferrer">https://code.google.com/p/android/issues/detail?id=40486</a></li> <li><a href="https://code.google.com/p/android/issues/detail?id=1148" rel="nofollow noreferrer">https://code.google.com/p/android/issues/detail?id=1148</a></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload