Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set total width instead of bar's width ? #4

Open
chanai-m opened this issue Sep 5, 2017 · 1 comment
Open

How to set total width instead of bar's width ? #4

chanai-m opened this issue Sep 5, 2017 · 1 comment

Comments

@chanai-m
Copy link

chanai-m commented Sep 5, 2017

Hello,
I am doing a page to print batch of barcodes and each one will be same size but different text and length of text. anyway to do this ?

@yobryon
Copy link
Owner

yobryon commented Oct 17, 2017

The underlying library doesn't support this mode of rendering (as I see you commented on it's project)... it's not a great answer, but you could render as IMG and set the width of the img element using styles... I've given this some thought overall -- the one thing we can play with is the base width of individual bars... in theory we could do some math to determine how to scale this number to achieve an overall width target, but we would have to know the encoded output first to do that. Alternatively, we could do some fiddling with JS I suppose - render, resolve the resulting width, modify width, resolve the result again, until we hit our target -- but I suspect that would result in poor performance if you're rendering a lot of barcodes.

I don't have any great ideas at present..... anyone else have any?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants