Skip to content

Commit

Permalink
Changed new line breaks at drawLine, table and tableCustom functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Klemen Kastelic committed Jun 29, 2016
1 parent 1e118e3 commit 0b340ed
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
8 changes: 5 additions & 3 deletions example.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ printer.drawLine();
printer.setTypeFontB();
printer.println("Type font B");
printer.setTypeFontA();
printer.print("Type font A");
printer.println("Type font A");
printer.drawLine();

printer.alignCenter();
printer.println("This text is in the middle");
printer.alignRight();
printer.println("This text is on the right");
printer.alignLeft();
printer.print("This text is on the left");
printer.println("This text is on the left");
printer.drawLine();

printer.setTextDoubleHeight();
Expand All @@ -37,7 +37,7 @@ printer.println("Double width wooo!");
printer.setTextQuadArea();
printer.println("Quad text!");
printer.setTextNormal();
printer.print("Back to normal");
printer.println("Back to normal");
printer.drawLine();

printer.printBarcode("4126570807191");
Expand All @@ -49,6 +49,8 @@ printer.code128("4126570807191", {
// printer.pdf417("4126565129008670807191");
printer.printQR("4170807191412657080719141265708");

printer.newLine();

printer.leftRight("Left", "Right");

printer.table(["One", "Two", "Three", "Four"]);
Expand Down
6 changes: 5 additions & 1 deletion node-thermal-printer.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ module.exports = {
},

drawLine: function(){
module.exports.newLine();
// module.exports.newLine();
for(var i=0; i<printerConfig.width; i++){
append(new Buffer("-"));
}
Expand All @@ -174,6 +174,7 @@ module.exports = {
append(new Buffer(" "));
}
append(right.toString());
module.exports.newLine();
},

table: function(data){
Expand All @@ -185,6 +186,7 @@ module.exports = {
append(new Buffer(" "));
}
}
module.exports.newLine();
},


Expand Down Expand Up @@ -248,6 +250,8 @@ module.exports = {
}
}

module.exports.newLine();

// Print the second line
if(secondLineEnabled){
module.exports.tableCustom(secondLine);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-thermal-printer",
"version": "0.0.22",
"version": "0.0.23",
"description": "Made to work with Epson and Star thermal printers",
"main": "node-thermal-printer.js",
"scripts": {
Expand Down

0 comments on commit 0b340ed

Please sign in to comment.