samt / barcode

barcode generation for nodejs
MIT License
69 stars 59 forks source link

Error: Width will result in a degenerate barcode #12

Closed Karabi-Choudhury closed 9 years ago

Karabi-Choudhury commented 9 years ago

I have generated a barcode of dimensions width: 200, height: 50. But i am getting an error "Error: Width will result in a degenerate barcode". Can we generate a barcode of this dimension?

samt commented 9 years ago

This means that the data you're trying to put in that barcode will not fit in 200px. You need to increase the pixel width or decrease the amount of data.

Karabi-Choudhury commented 9 years ago

In my barcode i have data like "WBC2C2746012" and my dimensions are width: 150,height: 50.I am getting this error Can you provide any resolution

samt commented 9 years ago

You need to increase the width of the barcode. In this particular case, the smallest bar pattern (1px) will be indistinguishable from the next smallest, removing its ability to be read effectively by a barcode reader.

danielflippance commented 8 years ago

FYI - I saw this error when accidentally passing an integer to the data field. Converting it to a string fixed the issue: var codeAsString = ""+codeAsInteger;