Coder Social home page Coder Social logo

escposencoder's People

Contributors

dependabot[bot] avatar liangminhua avatar nielsleenheer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

escposencoder's Issues

how to implement code128

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 ?

I can't install the package

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

print multiple commands

hello
i want print a image and text or array how can i use image command with another command and send it to print

Not Printing English

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

How to print Cyrillic text

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('Привет мир')

Error when using EscPosEncoder

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

Unable to print arabic

Its printing ????. I can able to print chines...But arabic is not printing Please help

encoder
.codepage('cp864')
.text('جريدة')
.newline()
.cut('partial')
.encode()

print an image in react-native

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=='}}
    />

Print large text (bigger than normal)

Hi.
Thanks for the great plugin.
My print layout needs to print large text in addition to small and normal text.
I have been searching, but with no luck.
Something similar to the following image. Sorry for low res image.
Any help appreciated.
i1

Image unable to load

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

Image and QRCode printing problem with bluetooth printer

I'm trying to print image and qrcode with our bluetooth device. But there're some problems.

Problems

  • When printing image, it seems that the width and height must be limited to less than 64, or it will print part of the image or some codes or characters I can not read.
  • When printing qrcode, it will print texts like 1A21C1E11P0https://nielsleenheer.com1Q0 instead of the qrcode image.

Printer & Codes

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.

Node script to get Base64 string for printing:

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()

The './seller_5.png' image:

seller_5.png

RN printing module:

// ...
// base64 string generated by node script
// seller_5.png
const s = 'G0AbYQEddjAAHABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=';

// qrcode
// const s = 'G0AbYQEKHShrBAAxQTIAHShrAwAxQwYdKGsDADFFMR0oaxwAMVAwaHR0cHM6Ly9uaWVsc2xlZW5oZWVyLmNvbR0oawMAMVEw';

device.writeCharacteristicWithResponseForService(
  d.serviceUUID,
  d.uuid,
  s,
);
// ...

Does not seem to work with ionic 5

core.js:6014 ERROR 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

Printer only accept 64 characters each time,how to split result buffer?

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?

How can we make a tabular view for the list of the ordered products?

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?

javascript-print-esc-pos-sample-receipt

Problem trying print with image [Bluetooth printer]

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:

  1. https://youtu.be/9hh5Y9gjEaQ
  2. https://youtu.be/ht_6EegPWU4

Can anyone give me an idea why you may be presenting this and how to fix it?

Thank you very much for your help.

how can i do for loop with EscPosEncoder

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());

Can it work with AngularJS ?

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.

Use multiple raw commands at same time

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

how can include Codepage:CP874?

i want to print thai characters (CP874) such as "กำลังทดสอบ" . Is possible to specify CP874?
help me please. thank

Send to printer

Hi,
how can I send the resulting encoding to the printer?
Thanks

Change font size?

Great project, thanks for your efforts. Does anyone know if it's possible to increase/decrease the font size?

How to print ¥

I've tried print text with GB18030 encoder. But the sign ¥ is printed as 0 6 .
I have no idear what is wrong.

Not able to print arabic in swift

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?

Table

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!

Uncaught Error: Encoding '_sbcs' has incorrect 'chars'

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.