Closed GuilhermeReda closed 2 years ago
Fala guilherme beleza ? rapaz eu resolvi esse problema com esse codigo:
escpos.Image.load(dirImage, function(img){ window.device.open(function(){ window.printer .font('b') .align('ct') .size(1, 1) .text('\n')//48 .raster(img, 'dwdh').close(); }); });
A proposito cuidado se estiver usando impressoras EPSON, elas costumam não funcionar o print de imagens.
This is the output. The image being printed is the zip below. (.png) 999999999.zip
Essa impressora é uma datecs DPP-350, na epson que tenho em casa ela funciona perfeita.
Try this code and see if any of theese cmd work as intend btw
For PT-BR printing use const options = { encoding: "CP860" };// Allows you to use Special Characters as Ç ã á and so on. const printer = new escpos.Printer(device, options);
printer .align('ct')
.image(image, 's8')
.image(image, 'd8')
.image(image, 's24')
.image(image, 'd24')
.raster(image)
.raster(image, 'dw')
.raster(image, 'dh')
.raster(image, 'dwdh')
.cut();
Btw, why you're not using the qrImage function from the escpos ?
only the .image one works all the raster give me that output, and qrImage use raster.
@GuilhermeReda R u using Zadig drivers ? probably after build your application will not work as intend.
using zadig drivers. I think it's a problem to this printer. it's very limited.
Probably, as I could see in the manual the commands are very limited but you can change the qrImage to Bitmap instead of raster, try read the qr-image npm repo
best of lucky for you.