Skip to content

Commit

Permalink
release paper function for tm-u295
Browse files Browse the repository at this point in the history
  • Loading branch information
f committed Aug 29, 2017
1 parent 9bbc673 commit a3510c6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.

Expand Down
8 changes: 8 additions & 0 deletions src/Mike42/Escpos/Printer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
7 changes: 7 additions & 0 deletions test/unit/EscposTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down

0 comments on commit a3510c6

Please sign in to comment.