diff --git a/README.md b/README.md index ce9ad78e..260b96a4 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,7 @@ Many thermal receipt printers support ESC/POS to some degree. This driver has be - Epson TM-T20 - Epson TM-T70II - Epson TM-U220 +- Epson TM-U295 (requires `release()` to release slip). - Epson FX-890 (requires `feedForm()` to release paper). - Excelvan HOP-E58 - Excelvan HOP-E200 @@ -320,6 +321,9 @@ Parameters: ### feedForm() Some printers require a form feed to release the paper. On most printers, this command is only useful in page mode, which is not implemented in this driver. +### release() +Some slip printers require release command to release the paper. + ### feedReverse($lines) Print and reverse feed n lines. diff --git a/src/Mike42/Escpos/Printer.php b/src/Mike42/Escpos/Printer.php index 6be19536..bddddc0f 100644 --- a/src/Mike42/Escpos/Printer.php +++ b/src/Mike42/Escpos/Printer.php @@ -539,6 +539,14 @@ public function feedForm() $this -> connector -> write(self::FF); } + /** + * Some slip printers require `ESC q` sequence to release the paper. + */ + public function release() + { + $this -> connector -> write(self::ESC . chr(113)); + } + /** * Print and reverse feed n lines. * diff --git a/test/unit/EscposTest.php b/test/unit/EscposTest.php index 186f0f6b..5ac5f263 100644 --- a/test/unit/EscposTest.php +++ b/test/unit/EscposTest.php @@ -980,6 +980,13 @@ public function testFeedForm() $this -> checkOutput("\x1b@\x0c"); } + /* Release */ + public function testRelease() + { + $this -> printer -> release(); + $this -> checkOutput("\x1b@\x1b\x71"); + } + /* Set text size */ public function testSetTextSizeNormal() {