reportbro-designer
reportbro-designer copied to clipboard
Barcode bursts frame.
When using frame to group the elements, the barcode overflows the frame limits, not respecting. In the example below I tested with a random data, but here I test locally with a code with 13 digits and it still pops.
what is the expected behavior? I only see the following options
- abort report generation with error
- crop bar code at frame end (would result in invalid barcode)
- scale bar code so it fits into the frame width (would probably also result in invalid / unreadable bar code because it is too small)
- generate full bar code and allow overflow (current behavior)
unlike a text the bar code cannot be wrapped into multiple lines. I only see the first and last option als viable options. The first option would be technically correct but I don't know if this is actually any better because then a report can easily fail depending on given parameter input.
I don't know how it goes down in the library. But I understand that the barcode could be transformed into an image and then resize the image without losing its characteristics or deforming it. Decrease while maintaining proportionality.
Of course it could be scaled (option three I mentioned above) but this would result in unreadable bar codes. A bar code is not useful if it cannot be scanned. That's why you only define the height and the width depends on the generated bar code.
The only other option is to abort with an error but I doubt this makes it any better. When you generate a report you have to make sure that a) the bar code area is large enough in the report template b) the bar code value contains valid data
I think my problem is with the barcode type, I would need ean13. is there any way to generate instead of code128 ?
currently not but once we drop support for Python 2 we should be able include other bar code formats.
@alhman waiting anxiously.
@alhman I would urgently need to be able to use EAN13, can I implement something? Because I understand that we could use font. https://www.netfontes.com.br/view/ean13/
But I would like something through the barcode component.
To get around the problem of not having EAN13, I generated a base64 image and it worked. I believe that this could be done with the barcode and it would still be valid, as I have tested it in practice.
Additional barcodes such as EAN13 are now available in v3.2.0