jsBarcode doesn't update when trying to creat multiple barcodes with multiple canvases
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 5.9k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
I am trying to create multiple barcodes to later print in multiple pages. My issue is that when looking on an array of data to put in the barcode, I found out that the barcodes don't change after the first one, so creating 50 barcodes from 50 different data strings, would result in 50 identical barcodes as the first one.
my code is something like this :
```
await Promise.all(dataArray.map(stringData => {
const canvas = createCanvas();
JsBarcode(canvas, stringData, {
displayValue: false,
width: 1,
});
codes.push(canvas.toDataURL());
}))
```
the codes generated are all the same
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the reported Promise.all example with multiple canvas elements and different data strings, starting at the JsBarcode canvas entry point. Check why later renders produce identical data URLs; done means each canvas encodes its own input, with a regression test covering multiple canvases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100