JsBarcode icon indicating copy to clipboard operation
JsBarcode copied to clipboard

codabar cannot be initiated via options in the HTML element

Open aidar87 opened this issue 4 years ago • 2 comments

Hi, I tried to init using options in the HTML element:

<svg class="barcode"
  jsbarcode-format="codabar"
  jsbarcode-value="123456789012"
  jsbarcode-textmargin="0"
  jsbarcode-fontoptions="bold">
</svg>

And then initialize it with:
JsBarcode(".barcode").init();

But I get the following error:
Uncaught TypeError: e is not a constructor

Could you assist please?
P.S.
It work's fine with <svg id="barcode3"></svg>
 and JsBarcode("#barcode3", "1234", {
  format: "codabar"
});

aidar87 avatar Jan 25 '22 08:01 aidar87

See also this case. https://github.com/lindell/JsBarcode/issues/336

init() method can't find "codabar" ( and also like "pharmacode", all lower character name)

three kind of solution,

1)don't use init if you need to use codabar and pharmacode ( use only constructor JsBarcode) 2)add code like https://github.com/lindell/JsBarcode/issues/336 3)wait until this problem will be fixed ( did anybody already make pull request?)

fu-foo avatar Apr 08 '24 00:04 fu-foo

ps. I'm using v3.1.15 (not latest v3.1.16)

fu-foo avatar Apr 08 '24 00:04 fu-foo