thermal-printer

Opening a Cash Drawer using JAVA or Batch File

早过忘川 提交于 2019-12-08 06:22:04
问题 I have a Partner RP-300 receipt printer with a cash drawer connected to it for experimental purposes.It connects to the PC via LPT1. I would like to open the cash drawer by means of a java application or a batch file. Any ideas? EDIT I have found out that the command to open the drawer is ESC p, hex value \x1b\x70\x00, but how do I send that command to the printer using cmd?, I tried putting latter in a text file, then using copy \b file name lpt1, but it just prints the contents of the text

Print barcode using thermal printer Android

▼魔方 西西 提交于 2019-12-07 01:00:54
问题 I was able to print text but when it comes to barcode it not showing or just showing irregular text. Here is my source code //barcode 128 byte[] formats = {(byte) 0x1d, (byte) 0x6b, (byte) 0x73,(byte) 0x0d}; byte[] contents = content.getBytes(); byte[] bytes = new byte[formats.length + contents.length]; System.arraycopy(formats, 0, bytes, 0, formats.length ); System.arraycopy(contents, 0, bytes, formats.length, contents.length); usbCtrl.sendByte(bytes, dev); usbCtrl.sendByte(LineFeed(), dev);

Send escape character to printer

不打扰是莪最后的温柔 提交于 2019-12-06 04:06:52
I am developing an C# application to print labels from a thermal transfer printer from SATO (CG408 TT) For this I am using SBPL (Programming language for SATO). Which looks something like following: <ESC>A <ESC>H0050<ESC>V0100<ESC>L0303<ESC>XMSATO <ESC>H0050<ESC>V0200<ESC>B103100*SATO* <ESC>H0070<ESC>V0310<ESC>L0101<ESC>XUSATO <ESC>Q1<ESC>Z To communicate with Printer and send raw data to it I am following this technique. At first i am trying to build the escape sequences using StringBuilder Class. StringBuilder sb = new StringBuilder(); sb.AppendLine(); sb.AppendLine("<ESC>A"); sb.AppendLine(

How to Calculate Zebra Font 0 text width?

三世轮回 提交于 2019-12-05 22:50:45
Is there a way to calculate the total width of Zebra Font 0 given text? Consider the following ZPL command, **^XA^FO100,150^A030,30^FDSample Text^FS^XZ** Here both character height and width is 30 dots. I want to calculate the actual width of this text in mm. Please note that printer DPI is 300.............. Font 0 is a variable-width font (not monospaced like some of the others), so the width of the text will depend on the text itself. One option would be to switch to a built-in monospaced font like font C, where each character is always 10 dots wide and the intercharacter gap is 2 dots wide

How to improve speed with Receipt printer and ESC/POS commands in Java

独自空忆成欢 提交于 2019-12-05 15:07:03
I have an application that communicates with a thermal printer in Java and makes the thermal printer print receipts with a barcode/emphasis/different sizes and so forth using a Star tsp 100 Printer. I can make the program print exaclty what i like but the printer is very slow. I believe the reason is that I am using non-preferable way/method of sending the byte commands. public static void Command(byte[] bytes) throws Exception{ //The bytes array is the argument, consisting of a byte[] array such as //byte[] Emphasis = {0x1B, 0x45}; //Which gives the text boldness. //And Command(Emphasis); To

Print barcode using thermal printer Android

落爺英雄遲暮 提交于 2019-12-05 03:40:53
I was able to print text but when it comes to barcode it not showing or just showing irregular text. Here is my source code //barcode 128 byte[] formats = {(byte) 0x1d, (byte) 0x6b, (byte) 0x73,(byte) 0x0d}; byte[] contents = content.getBytes(); byte[] bytes = new byte[formats.length + contents.length]; System.arraycopy(formats, 0, bytes, 0, formats.length ); System.arraycopy(contents, 0, bytes, formats.length, contents.length); usbCtrl.sendByte(bytes, dev); usbCtrl.sendByte(LineFeed(), dev); but the result barcode is not showing, am i missing something Please help me EDIT I found the ESC/POS

Java Printing to specific page size using label printer

拈花ヽ惹草 提交于 2019-12-04 14:35:34
问题 I am trying to use a label printer (EPSON TM-T88V to be specific), to spit out PNG images. I can get it to print fine, except when I am printing an image dimensions (220x175 at 72dpi to be specific again) there is a wad of white space on top of the image printed, which I think is a waste of paper. Any ideas on how I can minimize the paper waste? I want it to print just the image, minimal whitespace and then cut the paper. Here is my code AttributeSet aset = new HashAttributeSet(); aset.add

How to convert monochrome image to bitwise format for thermal printer

我怕爱的太早我们不能终老 提交于 2019-12-04 11:42:54
I'm using a Custom s'print DPT100-S thermal printer to made a receipt printing application. It is able to print graphics using 384 pixels in one line. This data has to be passed on to the printer using 48 bytes (48x8=384). So, each 'bit' represents one dot to be printed (bit will be '0' for white and '1' for black). So, I need to create a program which will read a monochrome BMP generated in Windows Paint(or any other program) and convert it into this bit format using a C program in Linux. Please guide me. Pseudo code: Read BMP For each row in BMP For each group of 8 pixels in row output_byte

Java Printing to specific page size using label printer

馋奶兔 提交于 2019-12-03 09:04:40
I am trying to use a label printer (EPSON TM-T88V to be specific), to spit out PNG images. I can get it to print fine, except when I am printing an image dimensions (220x175 at 72dpi to be specific again) there is a wad of white space on top of the image printed, which I think is a waste of paper. Any ideas on how I can minimize the paper waste? I want it to print just the image, minimal whitespace and then cut the paper. Here is my code AttributeSet aset = new HashAttributeSet(); aset.add(new PrinterName(printerName, null)); /* locate a print service that can handle the request */

Epson epos sdk receipt alignment issue

﹥>﹥吖頭↗ 提交于 2019-12-03 05:09:28
i'm currently using epson ePOS SDK for android. i need to print the receipt that menu name align to the left and its price align to the right in the same line but it doesn't work properly, my temporary solution is add some feed line to make its price align right, is it possible to have both text align left and right in the same line ? (Attachments below and please ignore question mark symbols) mPrinter.addTextAlign(Printer.ALIGN_LEFT); mPrinter.addFeedLine(0); textData.append(menuName); mPrinter.addText(textData.toString()); textData.delete(0, textData.length()); mPrinter.addFeedLine(0); /