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
[Feature]: Fixed Width Barcodes #3955
Comments
@objecttothis . This code works for me.
I can now have 5 different barcode widths. Hope i am not comiting a sin here. |
It appears that what you are proposing is to use 'barcode_width' as a 'widthFactor'. This doesn't create fixed width barcodes though. For example Code128 type barcodes 9781234567890 and 6000005345 will produce two different width barcodes with your implementation. |
I had a thrift store at one time so the way I think is will it print properly on the Labels and Tags that were being used. Always depended on the software to create a barcode from the Item_id. |
In that respect what we have currently will work just fine. It displays on the screen and it prints. The height is fixed, but the difference from our previous implementation is that the width will vary based on the barcode content length. It most likely won't be a breaking change for anyone. On the upside there are now many more barcode formats supported, including Pharmacy barcodes which I believe has been requested before. |
? The height is fixed, You mean it is already working or it is not adjustable? |
Sorry, I meant that you can set the height of the barcode in config and all barcodes will be that height. This is and has been working because picquer/php-barcode-generator allows height to be entered. I just meant fixed as in 'set and it doesn't vary like the width. |
I pushed a commit that works if picquer will add |
Type of Feature
✨ New Feature
OpensourcePOS Version
opensourcepos 3.4.0-dev
Description
The new barcode generator is lightweight and reasonably easy to use, but has one major weakness. It cannot generate fixed width barcodes like the previous library could. It can generate them via BarcodeGeneratorHTMLDynamic which uses DIV's to show the barcode in HTML, however those barcodes don't render when printed. All other barcode generators use a width factor rather than width and they don't expose the getBarcodeData()->getWidth() function (protected), so calculating the widthFactor dynamically isn't possible. We are currently using the BarcodeGeneratorSVG class which generates an inline SVG, and while SVG's are meant to scale, their code is hard-coding the width, so even putting it inside a DIV with CSS doesn't scale it. I created a feature request, but changes are still a ways off and the dev isn't convinced he wants to make fixed width possible due to the complexity added. picqer/php-barcode-generator#195
There are three options
Additional Information
No response
Verify you searched open requests in OpensourcePOS
The text was updated successfully, but these errors were encountered: