escpos

ESC/POS thermal printer, how to center a bitmap image in Android?

蓝咒 提交于 2021-02-19 04:41:32
问题 I'm writing a simple app in Android to print through a ESC/POS thermal printer. I've just a problem. The app generate a QR Code (with zxing library), convert it in a bitmap and send it to the printer. The printer print it, but I'm not able to center it. Instead with text I have no positioning issue. This is the code to print the text and the QR. byte[] INIT = {27, 64}; byte[] FEED_LINE = {10}; byte[] SELECT_FONT_A = {27, 33, 0}; byte[] FONT_B = {0x1B, 0x4D, 0x01}; byte[] ALLINEA_SX = {0x1B,

ESC/POS thermal printer, how to center a bitmap image in Android?

守給你的承諾、 提交于 2021-02-19 04:41:10
问题 I'm writing a simple app in Android to print through a ESC/POS thermal printer. I've just a problem. The app generate a QR Code (with zxing library), convert it in a bitmap and send it to the printer. The printer print it, but I'm not able to center it. Instead with text I have no positioning issue. This is the code to print the text and the QR. byte[] INIT = {27, 64}; byte[] FEED_LINE = {10}; byte[] SELECT_FONT_A = {27, 33, 0}; byte[] FONT_B = {0x1B, 0x4D, 0x01}; byte[] ALLINEA_SX = {0x1B,

Printooth library, label feed control issue

走远了吗. 提交于 2021-02-11 13:53:57
问题 I am new in Android development. The following bloc is part of my APP's code, it does a simple job of select two columns of information from a local sqlite database's table, filter it by a scanned barcode and print the information retrieved plus the current date. My issue is the label feed control. Printer only execute Android APP's command when in ESC/POS mode, and doesn't stop the label paper in the right position for the next label to be printed. If anyone have ever made something similar

ESC/POS printing barcode aligned vertically and horizontally in the middle?

青春壹個敷衍的年華 提交于 2021-01-29 12:30:36
问题 My code is currently printing a barcode and hri text easily, but I want everything to be printed dead centre on the label. Can someone please tell me when I should declare the alignment command? I tried declaring it at the beginning and just before the barcode print command, but the barcode is still printing in the top left corner. Here is my align command: def align_esc(self,esc,n): ''' ESC|a|n 0<=n<=2,48<=n<=50 0,48 = Left; 1,49 = Mid; 2,50 = Right ''' align = [esc,n] align_prnt = bytearray

USB小票打印解决办法

◇◆丶佛笑我妖孽 提交于 2020-11-30 03:13:33
转载的: https://blog.csdn.net/ghs79/article/details/46543845 \?\USB#VID_8866&PID_0100#0001B0000000#{a5dcbf10-6530-11d2-901f-00c04fb951ed} USB小票打印解决办法 一、需要驱动,无需更改程序 安装USB打印驱动,然后共享打印机,通过 “\\计算机\打印机名”的形式,按端口方式写。 1 二、直接写USB端口,无需驱动,但需要改程序。 1、USB端口的形式如:\\?\usb#vid_0483&pid_5720#11101800002#{a5dcbf10-6530-11d2-901f-00c04fb951ed}。 1.1、顺便说下:在我测试过程中,发现同一台小票打印机,在不同电脑上显示的端口名称是一样的。 1.2、根据查的资料推断,同一型号的打印机名称应该是固定的(没有证实)。 2、用串口与电脑通信,实现数据的发送。 2.1、本人改了网上的SPcomm控件,以支持COM10以上的端口和USB端口。在CreateFile中产生影响。 3、提供DEMO和控件源码。 3.1、DEMO中可以检测USB打印机的名称:先打开程序,再插入USB打印机。 1 2 3 4 5 6 7 8 9 10 11 12 13 下载地址: http://download.csdn.net

Convert raster byte[] image data to column Format in C#

折月煮酒 提交于 2020-07-14 06:48:48
问题 I'm trying to convert a byte array from an image that is in Raster format, which reads from left to right, to Column format, which reads from top to bottom. The problem looks simple, we have two-dimensional array of bits (width/height of image). In Raster format, you read the bits from left to right, in Column format you read the bits from top to bottom. I try to do this to support Column format printing of the ESC/POS protocol. I already have the image in Raster format, now I'm trying to

How to equally separate items in a printable area

最后都变了- 提交于 2020-06-29 03:48:24
问题 I'm writing a simple app in Android to print through a ESC/POS thermal printer. I need to equally divide the printable area among three different items so that they look justified. I am unable to find a way to print the same am using these commands to feed into my printer https://reliance-escpos-commands.readthedocs.io/en/latest/layout.html attaching an image for reference, any help or suggestion will be appreciated. "Amount" to the left ":" in the center and "value" to the right 回答1: You won

How to send raw string to a dotmatrix printer using python in ubuntu?

流过昼夜 提交于 2020-06-27 08:42:46
问题 I have a dot-matrix printer LX-300 connected to my computer through the network. How do I send a raw string with ESCP characters directly to my printer in Python? The computer is connected to the printer through another computer. I need to send a raw string because LX-300 image printing result is blurry. 回答1: The Problem To send data down this route: Client computer ---> Server (Windows machine) ---> printer (dot-matrix) ...and to not let Windows mess with the data; instead to send the raw

Why is the “€” character only printed before printer initialization and not after the initialization?

£可爱£侵袭症+ 提交于 2020-04-18 05:45:48
问题 I have an Epson TM-T88VI printer and use the Microsoft.PointOfService.PosPrinter in C# for printing. Using the following function i get a strange output printed: public static void printerTestFunction2(string printerName) { PosExplorer explorer = new PosExplorer(); DeviceInfo di = explorer.GetDevice("PosPrinter", printerName); PosPrinter printer = (PosPrinter)explorer.CreateInstance(di); printer.Open(); printer.Claim(10000); printer.DeviceEnabled = true; printer.AsyncMode = false; string init

how to print images with ESC/POS commands?

房东的猫 提交于 2020-04-16 06:40:26
问题 i have an Epson-TMH6000III thermal printer and i want to print some bitmap with it by using ESC/POS commands. but before this i want to print a very simple single line with ESC/POS printing image commands. here's my attempt : namespace printingImageMode { class Program { static void Main(string[] args) { Bitmap bmp = new Bitmap(@"C:\Users\falamarzi\Desktop\Kyan Graphic Viewer\jTest.jpg"); int msb = (int)(bmp.Width & 0x0000ff00) >> 8; int lsb = (int)(bmp.Width & 0x000000ff); byte msbB =