-
-
Notifications
You must be signed in to change notification settings - Fork 424
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from uyu423/feature/set-encode
global character encoding setting method.
- Loading branch information
Showing
3 changed files
with
49 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const escpos = require('../'); | ||
|
||
const device = new escpos.USB(); | ||
// const device = new escpos.Network('localhost'); | ||
// const device = new escpos.Serial('/dev/usb/lp0'); | ||
const printer = new escpos.Printer(device); | ||
|
||
device.open(function(err){ | ||
|
||
printer | ||
.font('a') | ||
.align('ct') | ||
.size(1, 1) | ||
.text('敏捷的棕色狐狸跳过懒狗') // default encoding set is GB18030 | ||
.encode('EUC-KR') // set encode globally | ||
.text('동해물과 백두산이 마르고 닳도록') | ||
.text('こんにちは', 'EUC-JP') // set encode functional | ||
.cut(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters