diff --git a/README.md b/README.md index 87ddb6e..96d25ff 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ printer.openCashDrawer(); // Kick the cash draw printer.cut(); // Cuts the paper (if printer only supports one mode use this) printer.partialCut(); // Cuts the paper leaving a small bridge in middle (if printer supports multiple cut modes) printer.beep(); // Sound internal beeper/buzzer (if available) +printer.upsideDown(true); // Content is printed upside down (rotated 180 degrees) printer.bold(true); // Set text bold printer.invert(true); // Background/text color inversion diff --git a/configs/epsonConfig.js b/configs/epsonConfig.js index 4149e7b..5829ec3 100644 --- a/configs/epsonConfig.js +++ b/configs/epsonConfig.js @@ -12,6 +12,8 @@ module.exports = { HW_SELECT : new Buffer([0x1b, 0x3d, 0x01]), // Printer select HW_RESET : new Buffer([0x1b, 0x3f, 0x0a, 0x00]), // Reset printer hardware BEEP : new Buffer([0x1b, 0x1e]), // Sounds built-in buzzer (if equipped) + UPSIDE_DOWN_ON : new Buffer([0x1b,0x7b,0x01]), // Upside down printing ON (rotated 180 degrees). + UPSIDE_DOWN_OFF : new Buffer([0x1b,0x7b,0x00]), // Upside down printing OFF (default). // Cash Drawer CD_KICK_2 : new Buffer([0x1b, 0x70, 0x00]), // Sends a pulse to pin 2 [] diff --git a/node-thermal-printer.js b/node-thermal-printer.js index 95eeefc..183b36c 100644 --- a/node-thermal-printer.js +++ b/node-thermal-printer.js @@ -125,6 +125,15 @@ module.exports = { else append(config.TXT_UNDERL_OFF); }, + upsideDown: function(enabled){ + if (printerConfig.type == 'star'){ + console.error("Upside down not supported on STAR yet"); + return; + } + if(enabled) append(config.UPSIDE_DOWN_ON); + else append(config.UPSIDE_DOWN_OFF); + }, + invert: function(enabled){ if (printerConfig.type == 'star'){ console.error("Invert not supported on STAR yet");