Open ma-zal opened 1 year ago
After the bitmap image drawing the next writeln() command does not add a new line after the text. But the second text is incorrectly placed directly after the first one.
writeln()
writeln('line1.'); writeln('line2.'); draw(image); writeln('line3.'); writeln('line4.');
line1. line2. [Image] line3.line4.
I have found the incorrect ESC command in draw() function after each bitmap line.
draw()
File: src/profile/index.ts
Current (incorrect implementation):
yield this.connection.write(Buffer.from('\x1BJ\x00', 'ascii'));
Should be 0x0A only:
0x0A
yield this.connection.write(Buffer.from('\x0A', 'ascii'));
escpos
I have tested my offered change. It corrects the issue on my side.
Issue
After the bitmap image drawing the next
writeln()
command does not add a new line after the text. But the second text is incorrectly placed directly after the first one.Example of code with issue:
Example causes the output with issue:
Root cause
I have found the incorrect ESC command in
draw()
function after each bitmap line.File: src/profile/index.ts
Current (incorrect implementation):
Should be
0x0A
only:ESC commands documentation
escpos
Testing:
I have tested my offered change. It corrects the issue on my side.