nielsleenheer / escposencoder Goto Github PK
View Code? Open in Web Editor NEWCreate a set of commands that can be send to any receipt printer that supports ESC/POS
License: MIT License
Create a set of commands that can be send to any receipt printer that supports ESC/POS
License: MIT License
Everything is fine until I exceed 251 characters in the string for Qr.
Any ideas?
thanks,
Esteban
My printer supports code128 and I'm using your package as it's very good and easy to use. but the package does not support code128.
could you please guide me to add code128 ?
Hello, I'm trying to print an image in my ionic app.
var img = new Image();
img.src = 'https://sguru.org/wp-content/uploads/2018/02/facebook-logo-jpg-facebook-logo-1.jpg';
.image(img, 40, 40, 'threshold')
This is part of the code, but when I try to print there isn't any image on the receipt, it's all blank and in the ispection there aren't any errors. Can you give me support on this problem? Thank you.
I'm trying to install the ionic package but I'm getting the following
$ npm install esc-pos-encoder-ionic --save > [email protected] install C:\Users\User\Documents\Crown-Project\Ayad\node_modules\ canvas-browserify\node_modules\canvas > node-gyp rebuild C:\Users\User\Documents\Crown-Project\Ayad\node_modules\canvas-browserify\node_m odules\canvas>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\ node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\nod e-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modul es\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) Warning: Missing input files: C:\GTK\bin\zlib1.dll C:\GTK\bin\libexpat-1.dll C:\GTK\bin\libpng14-14.dll C:\GTK\bin\libcairo-2.dll C:\GTK\bin\libfontconfig-1.dll C:\GTK\bin\libfreetype-6.dll Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. Canvas.cc CanvasGradient.cc CanvasPattern.cc CanvasRenderingContext2d.cc color.cc Image.cc ImageData.cc init.cc win_delay_load_hook.cc c:\users\user\documents\crown-project\ayad\node_modules\canvas-browserify\node_m odules\canvas\src\canvas.h(19): fatal error C1083: Cannot open include file: 'ca iro.h': No such file or directory (compiling source file ..\src\Canvas.cc) [C:\U sers\User\Documents\Crown-Project\Ayad\node_modules\canvas-browserify\node_modul es\canvas\build\canvas.vcxproj] c:\users\user\documents\crown-project\ayad\node_modules\canvas-browserify\node_m odules\canvas\src\canvas.h(19): fatal error C1083: Cannot open include file: 'ca iro.h': No such file or directory (compiling source file ..\src\CanvasGradient.c c) [C:\Users\User\Documents\Crown-Project\Ayad\node_modules\canvas-browserify\no de_modules\canvas\build\canvas.vcxproj] c:\users\user\documents\crown-project\ayad\node_modules\canvas-browserify\node_m odules\canvas\src\canvas.h(19): fatal error C1083: Cannot open include file: 'ca iro.h': No such file or directory (compiling source file ..\src\Image.cc) [C:\Us ers\User\Documents\Crown-Project\Ayad\node_modules\canvas-browserify\node_module s\canvas\build\canvas.vcxproj] c:\users\user\documents\crown-project\ayad\node_modules\canvas-browserify\node_m odules\canvas\src\canvas.h(19): fatal error C1083: Cannot open include file: 'ca iro.h': No such file or directory (compiling source file ..\src\ImageData.cc) [C :\Users\User\Documents\Crown-Project\Ayad\node_modules\canvas-browserify\node_mo dules\canvas\build\canvas.vcxproj] c:\users\user\documents\crown-project\ayad\node_modules\canvas-browserify\node_m odules\canvas\src\canvas.h(19): fatal error C1083: Cannot open include file: 'ca iro.h': No such file or directory (compiling source file ..\src\CanvasPattern.cc ) [C:\Users\User\Documents\Crown-Project\Ayad\node_modules\canvas-browserify\nod e_modules\canvas\build\canvas.vcxproj] c:\users\user\documents\crown-project\ayad\node_modules\canvas-browserify\node_m odules\canvas\src\canvas.h(19): fatal error C1083: Cannot open include file: 'ca iro.h': No such file or directory (compiling source file ..\src\init.cc) [C:\Use rs\User\Documents\Crown-Project\Ayad\node_modules\canvas-browserify\node_modules \canvas\build\canvas.vcxproj] c:\users\user\documents\crown-project\ayad\node_modules\canvas-browserify\node_m odules\canvas\src\canvas.h(19): fatal error C1083: Cannot open include file: 'ca iro.h': No such file or directory (compiling source file ..\src\CanvasRenderingC ontext2d.cc) [C:\Users\User\Documents\Crown-Project\Ayad\node_modules\canvas-bro wserify\node_modules\canvas\build\canvas.vcxproj] gyp ERR! build error gyp ERR! stack Error:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Build Tools\MSBuild\15.0\Bin\MSBuild.exefailed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\ npm\node_modules\node-gyp\lib\build.js:262:23) gyp ERR! stack at ChildProcess.emit (events.js:182:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_proces s.js:240:12) gyp ERR! System Windows_NT 10.0.17763 gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodej s\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" gyp ERR! cwd C:\Users\User\Documents\Crown-Project\Ayad\node_modules\canvas-brow serify\node_modules\canvas gyp ERR! node -v v10.15.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok > [email protected] install C:\Users\User\Documents\Crown-Project\Ayad\node_modules\c anvas > node-pre-gyp install --fallback-to-build node-pre-gyp WARN Using request for node-pre-gyp https download [canvas] Success: "C:\Users\User\Documents\Crown-Project\Ayad\node_modules\canva s\build\Release\canvas.node" is installed via remote npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fse vents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@ 1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"} ) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\canv as-browserify\node_modules\canvas): npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install:
node-gyp rebuild npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
hello
i want print a image and text or array how can i use image command with another command and send it to print
Hi
Could you please add PC857 for the next release?
Tnxx
Hi, I'm using this module with "QS-5801" printer in React Native. It is printing everything in Chinese characters. Barcode and QR are also not working.
I've tried different codepages, but no luck.
Is there something I'm missing?
Thanks
P.S. This module works but is not printing Barcode and QR
https://github.com/ingoncalves/escpos-xml
add cp720 arabic lang plz
Is there a way to print Cyrillic text using this package? I tried to use many variants, but got question marks or unreadable text. Please help me with this issue.
not worked for me
let result = encoder.codepage('cp866').text('Привет мир')
let result = encoder.codepage('windows1251').text('Привет мир')
Even if the images are white background jpg, or transparent background png.
I am using the following.
.align('left').text('Left side').align('right').text('right side').newline()
But it aligns the whole text to the left.
Hi, iam trzing to use EscPosEncoder for ionic in my ionic 5 app, but iam not able to make it work. I succesfully installed package, import it in my provider, but when i try to use it i get "Unknown Codepage" error, even if iam entering right string for codepage:
`import EscPosEncoder from 'esc-pos-encoder-ionic';
...
testEncode(){
let encoder=new EscPosEncoder();
let result=encoder.codepage('cp852')
.text('Iñtërnâtiônàlizætiøn')
.codepage('cp936')
.text('简体中文')
.encode();
console.log(result);
}
`
Any ideas whats wrong? When i try to run it on mobile device, i get "Runtime compiler is not loaded" Error, when iam trying to access page, to which is my printService provider injected(ESCPosEncoder is imported inside that provider). Iam using ionic 5 with angular 8.2.14
Hello Niels,
How to send ECS-POS Command for open cash drawer?
I use ionic 5 and bluetooth-serial plugin
Thanks
Its printing ????. I can able to print chines...But arabic is not printing Please help
encoder
.codepage('cp864')
.text('جريدة')
.newline()
.cut('partial')
.encode()
hi i got this error
ionic5 angular9
many thanks
import EscPosEncoder from 'esc-pos-encoder-ionic';
const encoder = new EscPosEncoder();
this.printDatas = encoder
.initialize()
.text('The quick brown fox jumps over the lazy dog')
.newline()
.qrcode('https://nielsleenheer.com', 100 , 100, 'h' )
.encode();
Hi,
First of all, thanks very much for your package.
It is great!
I am trying to print an image via react-native, but I don't know how to define a suitable argument (img) for the image function in react-native.
.image(img, 300, 300, 'atkinson').
As far as I know, we can include images in react-native via one of the following codes:
would you be able to help me?
Thanks
<Image
source={require('/react-native/img/favicon.png')}
/>
<Image
style={{width: 50, height: 50}}
source={{uri: 'https://facebook.github.io/react-native/docs/assets/favicon.png'}}
/>
<Image
style={{width: 66, height: 58}}
source={{uri: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADMAAAAzCAYAAAA6oTAqAAAAEXRFWHRTb2Z0d2FyZQBwbmdjcnVzaEB1SfMAAABQSURBVGje7dSxCQBACARB+2/ab8BEeQNhFi6WSYzYLYudDQYGBgYGBgYGBgYGBgYGBgZmcvDqYGBgmhivGQYGBgYGBgYGBgYGBgYGBgbmQw+P/eMrC5UTVAAAAABJRU5ErkJggg=='}}
/>
I have followed your documentation .. The error is (Image not defined) . Then i tried to load image using fs.readFile even though I unable to load image
I'm trying to print image and qrcode with our bluetooth device. But there're some problems.
1A21C1E11P0https://nielsleenheer.com1Q0
instead of the qrcode image.BTW, the printer I've used is Xprinter XP-Q200.
The printing data, which is in Base64 formation and is generated by a node script, is writen to printer with react-native-ble-plx which accept Base64 string.
const EscPosEncoder = require('esc-pos-encoder');
const {loadImage} = require('canvas')
const encoder = new EscPosEncoder();
async function main() {
const img = await loadImage('./seller_5.png')
const result = encoder
.initialize()
.align('center')
// image
.image(img, 224, 64)
// qrcode
// .qrcode('https://nielsleenheer.com')
.encode();
console.log(Buffer.from(result).toString('base64'));
}
main()
// ...
// base64 string generated by node script
// seller_5.png
const s = 'G0AbYQEddjAAHABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///AAAAAAAAAAAAAAAAAAAAAH/4AAAAAAAAAP///+AAHAAAQAAAYAAACAAAAAP//4AAAAAAAAf////wAB8AAM/4AGfwABwAAAAf///gAAAAAAAP////8AAHgAH/3AH/8AAOAAAAP///8AAAAAAAD/////gAHwAB/cgD+zAD//AAAP/4A/wAAAAAAB/vwP/4AD4YAOf4AOdwAB4AAAH/wAA+A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error: Uncaught (in promise): ReferenceError: Cannot access 'HomePageModule' before initialization
ReferenceError: Cannot access 'HomePageModule' before initialization
but once I take off the import, app runs smoothly
I have a printer, if I send to much data, it prints incomplete.
If I send a url longer than 64 characters, then the qrcode it printed is not the same as the url I send, it ends with scrambled code.
For example,
https://order.keguanll.com/scan-order?orderId=169&twoDCId=19&authInfo=h_PFh-1V_rCzHUpYJqHvqmuCvf8%3D
becomes
https://order.keguanll.com/scan-order?orderId=169&twoDCId=19&auth�@�a� �(k�
It doesn't print correctlly either if I send data of an image.
How to resolve this problem, how to slice the result buffer, and send them individually?
The package is very similar with node-escpos but the advantage of this package is that you can use it directly to your Web App and print using a thermal printer with Web Bluetooth API, unlike the node-escpos it is not design to be used directly with your web app, unless you use express.js. But they have a complete set of features that can be use to your nodejs project like the table feature which is the one that was currently missing on this package.
Is there a way to achieve the output below? Or is there an upcoming updates in the future for this?
Instead of text, printer prints out the codepage name, like 'ascii' or 'cp850'.
Hello everyone.
I have been trying to print a receipt using this package to send the data to the printer, however when I try to print with an image it is not working properly, the printer stops at a certain point and does not keep printing. This is my code:
var impresora = this.printerService;
const encoder = new EscPosEncoder();
let img = new Image();
img.src = 'assets/imgs/colsaisa3.png';
img.onload = function () {
const encoder = new EscPosEncoder();
let result = encoder
.codepage('cp852')
// .newline()
.image(img, 120, 120, 'atkinson')
.newline()
.newline()
.align('center')
.line('Recibo de caja')
.line(resp.id)
.newline()
.newline()
.align('left')
.line('CLIENTE: ' + resp.cliente)
.line('IDEN: ' + resp.iden)
.line('FECHA: ' + resp.fecha)
.line('VENDEDOR: ' + resp.vendedor)
.newline()
.newline()
.bold(true)
.line('FACTURA SALDO PAGO')
.bold(false);
for (const item of resp.facturas) {
const cantFactura = (item.numeroFactura.toString().length <= 11) ? 11 - item.numeroFactura.toString().length : 0;
const cantSaldo = (formatNumber(item.saldo, 'en-US').length <= 11) ? 11 - formatNumber(item.saldo, 'en-US').length : 0;
const cantPago = (formatNumber(item.valorConsignar, 'en-US').length <= 11) ? 11 - formatNumber(item.valorConsignar, 'en-US').length : 0;
const line = item.numeroFactura + ' '.repeat(cantFactura) + ' $' + formatNumber(item.saldo, 'en-US') + ' '.repeat(cantSaldo) + ' $' + formatNumber(item.valorConsignar, 'en-US') + ' '.repeat(cantPago);
// console.log({cantFactura, cantSaldo, cantPago, line});
result = result.line(line);
}
result = result
.line('-------------------------------')
.line('TOTAL PAGADO ' + resp.totalPagado)
.newline()
.newline()
.line('Formas Pago')
.line('-------------------------------');
for (const item of resp.formasPago) {
result = result.line(item.tipo + ' $' + item.valor);
}
result = result
.line('-------------------------------')
.line('TOTAL PAGADO ' + resp.totalPagado)
.newline()
.line('Estimado cliente.')
.line('Su pago lo podrá ver reflejado')
.line('en el portal de clientes')
.line('www.tiendacolsaisa.com')
.line('en las próximas 48 horas.')
.newline()
.line('Recuerde que los descuentos por')
.line('pronto pago sólo son')
.line('aplicados si usted se encuentra')
.line('al día en cartera.')
.newline()
.bold(true)
.line('Gracias por preferir a COLSAISA.')
.bold(false)
.newline()
.newline()
.encode();
// console.log({ result });
impresora.imprimirEnImpresoraBluetooth(item.id, result);
The funny thing about all this is that if I comment on the line where I use the image, the receipt prints completely.
I attach some videos where you can see the behavior. The first is when the image is used and the second is when I comment the line where the image is used:
Can anyone give me an idea why you may be presenting this and how to fix it?
Thank you very much for your help.
this is my code its not working any help
const encoder = new EscPosEncoder();
const result = encoder.initialize();
result
.codepage('iso88596')
.align('center')
.raw(commands.TEXT_FORMAT.TXT_4SQUARE)
.line(this.restname)
.newline()
for (let index = 0; index < this.data.length; index++) {
const element = this.data[index];
result.raw(commands.TEXT_FORMAT.TXT_ALIGN_LT)
.align('left')
.line(element['order_number']+'#')
.raw(commands.TEXT_FORMAT.TXT_ALIGN_RT)
.align('right')
.line('رقم الوصل')
.text(commands.HORIZONTAL_LINE.HR_58MM)
.newline()
}
result.align('center')
.raw(commands.HORIZONTAL_LINE.HR4_58MM)
.line(this.phone)
.newline()
.line(this.msg)
.newline()
this.mountAlertBt(result.encode());
Hi Guys, is this compatible with Angular?
If can, could you help me to share your code from starting add in the module and so on..
Your help will be appreciated sirs.
im trying to printer a double width and double height text which decimal commands are 27 33 32 and 27 33 16 respectively.
i have tried:
.raw([27, 33, 16]).raw([27, 33, 32]) (JUST MAKE A DOUBLE WIDTH, BECAUSE IT IS THE LAST ONE)
then i tried:
.raw([27, 33, 16],[27, 33, 32])
and:
.raw([27, 33, 16, 32])
and:
.raw([27, 33, 16, 27, 33, 32])
nothing works... any clue? thx you so much
i want to print thai characters (CP874) such as "กำลังทดสอบ" . Is possible to specify CP874?
help me please. thank
Thank for very useful library.
I am writing mobile POS app in nativescript.
and i use your encoder. QR code encoded but not printing with 340 characters ?
do you have any solution for long text #qrcode?
i implemented Margin but its not working ,can you provide the sample code
for add left margin bases on pixel or character
Hi,
how can I send the resulting encoding to the printer?
Thanks
Printing text on Epson TM-U220(LAN) works fine, but printing image results garbled text.
The problem is because this printer does not support GS v command (obsolete). To print image, we have to use ESC * command instead.
If it's possible please add support to this print image feature. Thank you.
Reference:
(https://reference.epson-biz.com/modules/ref_escpos/index.php?content_id=85)
Após muitos tempo descobri o que causava o erro.
Favor corrigirem
EscPosEncoder/src/esc-pos-encoder.js
Line 325 in 8bfe18c
Great project, thanks for your efforts. Does anyone know if it's possible to increase/decrease the font size?
The encode
appears to generate an Uint8Array
array containing all the bytes. How can I generate ESC/POS
commands instead of the byte array?
I've tried print text with GB18030
encoder. But the sign ¥ is printed as 0 6
.
I have no idear what is wrong.
after decoding to utf8, utf16, base64, unicode, I'm not able to print in arabic using EPSON TM-T88IV, the output is coming something like chinese ,any help?
Hi, is it possible to implement table soon?
There is table in documentation (READ.ME) but when you try to use it it return an error "undefined is not a function (near '...-'.repeat(42)).table(['Item 1', '10,00']...')".
I see that table really don't exists in class:
align(value: alignType): EscPosEncoder;
barcode(value: string, symbology: symbologyType, height: number): EscPosEncoder;
bold(value?: boolean): EscPosEncoder;
codepage(value: codepageType): EscPosEncoder;
cut(value?: cutType): EscPosEncoder;
encode(): Uint8Array;
image(element: any, width: number, height: number, algorithm?: imgAlgType, threshold?: number): EscPosEncoder;
initialize(): EscPosEncoder;
italic(value?: boolean): EscPosEncoder;
line(value: string, wrap?: number): EscPosEncoder;
newline(): EscPosEncoder;
qrcode(value: string, model?: 1 | 2, size?: qrSizeType, errorLevel?: qrErrorLevelType): EscPosEncoder;
raw(data: ReadonlyArray | Uint8Array): EscPosEncoder;
size(value: sizeType): EscPosEncoder;
text(value: string, wrap?: number): EscPosEncoder;
underline(value?: boolean | 2): EscPosEncoder;
I don't see how can I put one text align left and other align right on same line. Not to mention situation where I have QUANTITY | PRICE | TOTAL
Can we have something like this soon?
Thanks a lot, good work and keep on rocking!
I'm trying the samples but when I use the text samples I get this error log:
Uncaught Error: Encoding '_sbcs' has incorrect 'chars' (must be of len 128 or 256) at new n (esc-pos-encoder.js:1) at Object.s.getCodec (esc-pos-encoder.js:1) at Object.s.getEncoder (esc-pos-encoder.js:1) at Object.s.encode (esc-pos-encoder.js:1) at c._encode (esc-pos-encoder.js:1) at c.text (esc-pos-encoder.js:1) at testStampa (index.html:8) at HTMLButtonElement.onclick (index.html:16)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.