2015-08-22 203 views
1

我想打印到ESC/POS兼容的打印机,并且努力让我的头在GS v 0左右。我刚刚从Mac连接并通过CoolTerm发送命令为hex将位图打印到ESC/POS打印机

文档说...

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. 
从这个

所以我推断我需要发送的HEX

1D 76 30 30 20 00 00 01 

下面现在是否在图像数据遵循这一点,我必须发送消息说图像已经结束?

回答

0

我记得有<ESC>K(不是GS)命令来打印8行像素。详情请参阅ESC命令。 K必须发送2字节后 - 数据字节数和实际数据。但不保证每台打印机是否都支持此功能。你的品牌和型号是什么?