3

I am very new to ESC POS programming on Objective C. I have tested the printer with normal ESC pos line command and it works perfectly. But I was unable to understand the raster mode command. (GS v 0)

What I simply need is print the PNG receipt using ESC POS (I am creating the receipt as a PNG file) - Generic ESC POS (not STAR or EPSON) I tried to search about this command and spec is unclear.

K.Dᴀᴠɪs
  • 9,945
  • 11
  • 33
  • 43
user2546107
  • 41
  • 1
  • 3
  • I'm more-or-less researching the same thing right now. You'll need to convert the png to bitmap monochrome and then feed that to the printer. see http://gofreerange.com/printer – Krista K Aug 03 '13 at 06:23

3 Answers3

1

I am doing this from my Android app, using the Epson TM-IV 88 printer.

You use the utility called TMFlogo to flash the .bmp logo file to the printer. The printer can store 10 separate images.

Then you send the FS code such as below to print the logo.

Note the sendCommand is just a specific function in my app to send the FS sequence to the printer.

sendCommand("FS p 1 0");    // print the logo in NVRAM position 1
sendCommand("FS p 2 0");    // print the logo in NVRAM position 2

And here is a summary of the FS command parameters for Epson ESC:

ASCII FS p n m
Hex 1C 70 n m
Decimal 28 112 n m
where
1<=n<=255
0<=m<=3, 48<=m<=51
prints NV bit image n using mode m
where
m = 0,48 normal mode
m = 1,49 double-wide mode
m = 2,50 double tall mode
m = 3,51 quadruple mode

Best of luck.

K.Dᴀᴠɪs
  • 9,945
  • 11
  • 33
  • 43
Mark JW
  • 476
  • 3
  • 8
  • I am developing an app which have use of POS printer. I wants to print like Below :- Noodles 2 $10 $20 Manchurian 4 $200 $800 if passing \x1b\x24\x79\x00 then it set the position of text but when i doing x80 then its not accept the hex decimal number. – Maulik patel Jun 10 '15 at 11:43
0

Printing an image through Thermal Printer

In some of the printer you can define the image in non-volatile memory of the printer and then print the image from there through ESC cmd 1C 70 01 30.

In some of the other printers you can give a direct path of the image while printing an image through thermal printer.

Naresh Sharma
  • 4,323
  • 7
  • 48
  • 68
0

You need to distinguish 2 problems:

  1. The printer device/port. IP/RS-232/USB/Bluetooth have different methods of transmitting data. Be aware that the printer can not store all your data, it's slow needs handshake and you need probably a separate thread to run each printer.
  2. The printer type. Although ESC/POS is used for many printers, some have high density (24 pixels) and others only low density (8 pixels). Also, each printer type has different number of dots and characters per line. Line feed is different per printer.

Let the printer class how to print things and let the device class decide how to send the data. On top you need a class that decides the graphics/text to print.

Usually, printers have a HEX mode where you can see if the correct bytes were sent to the printer.

Bart Mensfort
  • 995
  • 11
  • 21