Opening hours: 8am to 6pm
Skopje, Macedonia

ESC POS with Raw Printing in PrintNode

ESC POS with Raw Printing in PrintNode

I was working on a Thermal printer module for our Restaurant Platforms, and found that the easiest and most stable way to achieve that will be thought PrintNode using their REST API.

All was going ok. I downloaded their client, the thermal printer was shown ( given an ID ).

The I used Postman to work with the API of PrintNode. Started by testing the authentication, listing of printers and then the most important part, to create a print job.

The best way to print on ESC POS enabled printer ( like the one I had, and most receipt printers ) is to use raw_base64 printing. This means to send all the print commands in base64 format.

But this is where I run into a problem. How to write ESC/POS commands. With a good reading of this article, I think finally figure it out. So for you not to waste the time, here is a sample code I did in PHP to get me raw_base64 string that I need to send to PrintNode.

<?php
$ESC = "\e";
$GS = chr(29);
$InitializePrinter = "@";
$nl="\n"; //Single new line
$dnl=$nl.$nl; //Double new line
$BoldOn = $ESC . "E" . "1";
$BoldOff = $ESC . "E" . "0";
$DoubleOn = $GS . "!" . "16";  // 2x sized text (double-high + double-wide)
$DoubleOff = $GS . "!" . "0";
$jLeft=$ESC."a"."0";//allign Left
$jCenter=$ESC."a"."1";//allign Center
$jRight=$ESC."a"."2";//allign Right

$cmd=$ESC.$InitializePrinter."FoodTiger Recepie #112".$nl;
$cmd.=$BoldOn."My Bold text".$BoldOff." no more bold".$nl;
$cmd.="Regular allign".$nl;
$cmd.=$jLeft."Left allign".$nl;
$cmd.=$jCenter."Center allign".$nl;
$cmd.=$jRight."Right allign".$nl;
$cmd.=$jLeft."VAT:".$jRight."45 $".$nl;
$cmd.=$ESC;

echo base64_encode($cmd);

At the end of this code, you do get the raw_base64 string that you can send to PrintNode.

List of supported ESC/POS Printeres

Many thermal receipt printers support ESC/POS to some degree. This driver has been known to work with:

  • 3nStar RPT-008
  • Approx APPPOS80AM
  • AURES ODP-333
  • AURES ODP-500
  • Bematech-4200-TH
  • Bematech LR2000E
  • Birch PRP-085III
  • Bixolon SRP-350III
  • Bixolon SRP-350Plus
  • Black Copper BC-85AC
  • CHD TH-305N
  • Citizen CBM1000-II
  • Citizen CT-S310II
  • Dapper-Geyi Q583P
  • Daruma DR800
  • DR-MP200 (manufacturer unknown)
  • EPOS TEP 220M
  • Elgin i9
  • Epson EU-T332C
  • Epson FX-890 (requires feedForm() to release paper).
  • Epson TM-T20
  • Epson TM-T20II
  • Epson TM-T70
  • Epson TM-T70II
  • Epson TM-T81
  • Epson TM-T82II
  • Epson TM-T88II
  • Epson TM-T88III
  • Epson TM-T88IV
  • Epson TM-T88V
  • Epson TM-U220
  • Epson TM-U295 (requires release() to release slip).
  • Epson TM-U590 and TM-U590P
  • Equal (EQ-IT-001) POS-58
  • Everycom EC-58
  • Excelvan HOP-E200
  • Excelvan HOP-E58
  • Excelvan HOP-E801
  • Gainscha GP-2120TF
  • Gainscha GP-5890x (Also marketed as EC Line 5890x)
  • Gainscha GP-U80300I (Also marketed as gprinter GP-U80300I)
  • gprinter GP-U80160I
  • HOIN HOP-H58
  • Ithaca iTherm 28
  • Hasar HTP 250
  • Metapace T-1
  • Metapace T-25
  • Nexa PX700
  • Nyear NP100
  • OKI RT322
  • OKI 80 Plus III
  • Orient BTP-R580
  • P-822D
  • P85A-401 (make unknown)
  • Partner Tech RP320
  • POSLIGNE ODP200H-III-G
  • QPOS Q58M
  • Rongta RP326US
  • Rongta RP58-U
  • Rongta RP80USE
  • SAM4S GIANT-100DB
  • Senor TP-100
  • Sewoo SLK-TS400
  • SEYPOS PRP-96
  • SEYPOS PRP-300 (Also marketed as TYSSO PRP-300)
  • SNBC BTP-R880NPIII
  • Solux SX-TP-88300
  • Sicar POS-80
  • Silicon SP-201 / RP80USE
  • SPRT SP-POS88V
  • Star BSC10
  • Star TSP100 ECO
  • Star TSP100III FuturePRNT
  • Star TSP-650
  • Star TUP-592
  • TVS RP45 Shoppe
  • Venus V248T
  • Xeumior SM-8330
  • Xprinter F-900
  • Xprinter XP-365B
  • Xprinter XP-58 Series
  • Xprinter XP-80C
  • Xprinter XP-90
  • XPrinter XP-Q20011
  • Xprinter XP-Q800
  • Zjiang NT-58H
  • Zjiang ZJ-5870
  • Zjiang ZJ-5890 (Also sold as POS-5890 by many vendors; ZJ-5890K, ZJ-5890T also work).
  • Zjiang ZJ-8220 (Also marketed as Excelvan ZJ-8220)
  • Zjiang ZJ-8250
Related Posts
Leave a Reply

Your email address will not be published.Required fields are marked *