Skip to content

Commit 16c2f0f

Browse files
committed
Added example on how to print text with whitespaces
1 parent dcfe45c commit 16c2f0f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ const xml = `
106106
<small>
107107
<text-line>Date: {{moment date format="DD/MM/YYYY HH:mm:ss"}}</text-line>
108108
<text-line size="1:0">{{numeral price format="$ 0,0.00"}}</text-line>
109+
<text-line size="1:0">{{paddedString}}</text-line>
109110
</small>
110111
<line-feed />
111112
<underline>
@@ -144,6 +145,7 @@ const data = {
144145
description: 'This is a description',
145146
date: new Date(),
146147
price: 1.99,
148+
paddedString: '&nbsp;&nbsp;&nbsp;&nbsp;Line padded with 4 spaces',
147149
condictionA: false,
148150
condictionB: true,
149151
barcode: '12345678',
@@ -155,4 +157,3 @@ const buffer = EscPos.getBufferFromTemplate(xml, data);
155157
// send this buffer to a stream (eg.: bluetooth)
156158

157159
```
158-

0 commit comments

Comments
 (0)