node-escpos icon indicating copy to clipboard operation
node-escpos copied to clipboard

Printing QR-code, but only half appears

Open Xsmael opened this issue 7 years ago • 8 comments

Printing QR-code, but only half appears image

Xsmael avatar Aug 02 '18 12:08 Xsmael

I have the exact same issue (output) on the HOIN HOP-H58. Could this be related to the encoding settings?

cybertim avatar Aug 05 '18 11:08 cybertim

no, clue, but the HOIN HOP-H58 uses the same encoding than the one in the example, i really dont understand

Xsmael avatar Aug 06 '18 07:08 Xsmael

I guess you have to specify the barcode's width

Psychopoulet avatar Aug 06 '18 08:08 Psychopoulet

Tried to change the values using: .barcode('1234567', 'EAN8', { width: 50, height: 3 }) but the printer will print text with only 'undefinedundefined' etc.. and i need to turn it on/off to get it working again. also tried the legacy method: .barcode('1234567', 'EAN8', 50, 2, 'off', 'b') but this will not change anything (like, text is still printed below the small barcode which should be off).

My first impression is the barcode function has some bugs. Maybe later I have some time to dive into the code to see what is happening.

Btw. the default valus as per H58's programming docs is a default width of 50 and a height of 3.

cybertim avatar Aug 06 '18 09:08 cybertim

mmm, felt like peeping into the code too, but am under stress right now...

Xsmael avatar Aug 06 '18 21:08 Xsmael

I was actually using that part of the code as well, but could not center the QR Code. Alternatively, I just generated the QR code using another package called qrcode (npm) and just used the image function and it worked.

Having problems though on my printer in that it cannot print consecutive times.

ograva avatar Sep 08 '18 06:09 ograva

I was actually using that part of the code as well, but could not center the QR Code. Alternatively, I just generated the QR code using another package called qrcode (npm) and just used the image function and it worked.

Having problems though on my printer in that it cannot print consecutive times.

can you please elaborate on the work around?

jchandr avatar Oct 12 '19 08:10 jchandr

you can use the qrimage function from this package, just add some options to set the margin and the size.

printer.align('ct').qrimage('https://youtu.be/W2ZmTMzN5NY', { type: 'png', margin:4, size:10}, function(err){ this.close();});

just look at qr-image imageSync function options (https://github.com/alexeyten/qr-image) on which depends escpos

aureleduda avatar Nov 25 '19 21:11 aureleduda