yobryon / ngx-barcode

An angular component for Angular 4+ for creating 1-D barcodes based on Lindell's JsBarcode
https://yobryon.github.io/ngx-barcode
81 stars 53 forks source link

Cannot use other formats than the default one #7

Open Motassem-MK opened 6 years ago

Motassem-MK commented 6 years ago

Hi, I'm trying to use the Codabar format, this is my code: <ngx-barcode [bc-value]="'something'" [bc-display-value]="true" [bc-format]="'codabar'"></ngx-barcode>

I got this error:

ERROR TypeError: api.options(...)[options.format] is not a function

(same for most other formats)

Am I doing it wrong?

drullo commented 6 years ago

Confirmed. The only formats that work are CODE128, CODE39, and MSI. All others throw an error.

yesiman commented 6 years ago

Just try it with EAN8, EAN13 seems to be ok. codabar too. For me the problem was that i was setting format as 'EAN-13' instead of 'EAN13'

kwkr commented 5 years ago

Before using a specific barcode format look for its specification. In case of ITF-14 it must be exactly 14 digits long. Otherwise it won't show.