Hubertformin / electron-pos-printer

Electron-pos-printer is a plugin that works to ease paper formatting and printing to thermal printers. it currently supports 80mm, 78mm, 76mm, 58mm, 57mm and 44mm printers thermal printers. it is built with Electron.js and Node.js
Apache License 2.0
318 stars 102 forks source link

Barcode position doesn't work #85

Closed tguillaume02 closed 1 year ago

tguillaume02 commented 1 year ago

I would like center barcode but this doesn't work (work only with image and qrCode)

{ type: 'barCode', value: '4810574', height: 20, width: 1, displayValue: false, fontsize: 8, style:{position: 'center'}, position: 'center } image

Hubertformin commented 1 year ago

Hello, The problem with this is you set the position in the style object. You could just specify that in the root object.

{ type: 'barCode', ... position: 'center' }
tguillaume02 commented 1 year ago

@Hubertformin Same issue { type: 'barCode', value: '4810574', height: 20, width: 1, displayValue: false, fontsize: 8, position: 'center }

Hubertformin commented 1 year ago

Hello again, You forgot to add a trailing ' at the end of center. Try this

{ type: 'barCode', value: '4810574', height: 20, width: 1, displayValue: false, fontsize: 8, position: 'center' }
sKY02644 commented 1 year ago

@Hubertformin @Hubertformin @Hubertformin

{
      type: 'barCode',
      value: '023456789010',
      height: "46",                     // height of barcode, applicable only to bar and QR codes
      width: "2",                       // width of barcode, applicable only to bar and QR codes
      displayValue: false,             // Display value below barcode
      fontsize: 24,
      position: "center",
    },

barCode doesnt center on 80mm

its urgent i have to have it ready by tomorrow and this is the only thing left