node-thermal-printer
Node.js module for EPSON and STAR thermal printers command line printing.
Installation
Dependency requires build-essentials
sudo apt-get install build-essential
$ npm install node-thermal-printer
Features
printer; printer // Check if printer is connected, callback passes bool of statusprinter; // Executes all the commands. Optional callback returns null if no error, else error messageprinter; // Print instantly. Optional callback returns null if no error, else error messageprinter; // Append textprinter; // Append text with new lineprinter; // Kick the cash drawerprinter; // Cuts the paper (if printer only supports one mode use this)printer; // Cuts the paper leaving a small bridge in middle (if printer supports multiple cut modes)printer; // Sound internal beeper/buzzer (if available)printer; // Content is printed upside down (rotated 180 degrees) printer; // Set text boldprinter; // Background/text color inversionprinter; // Underline text (1 dot thickness)printer; // Underline text with thick line (2 dot thickness)printer; // Draws a lineprinter; // Insers break line printer; // Align text to centerprinter; // Align text to leftprinter; // Align text to right printer; // Set font type to A (default)printer; // Set font type to B printer; // Set text to normalprinter; // Set text to double heightprinter; // Set text to double widthprinter; // Set text to quad area printer; // Prints text left and rightprinter; // Prints table equalyprinter; printer; // Print code128 bar codeprinter; // Print QR codeprinter; // Print PNG image (uses callback) printclear; // Clears printText valueprint; // Returns printer buffer string valueprint; // Returns printer bufferprint; // Get number of characters in one line
Code 128 settings
printer;
Examples
var printer = ;printer;printer;printer;printer;
Docs
- STAR: http://www.starmicronics.com/support/mannualfolder/starline_cm_rev1.15_en.pdf
- EPSON: https://reference.epson-biz.com/modules/ref_escpos/index.php
Tested printers:
- Star TSP700
- Rongta RP80US