reportbro-designer icon indicating copy to clipboard operation
reportbro-designer copied to clipboard

Barcode bursts frame.

Open GlauberF opened this issue 2 years ago • 8 comments

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.

Captura de Tela_selecionar área_20220704102133

Captura de Tela_selecionar área_20220704102146

GlauberF avatar Jul 04 '22 13:07 GlauberF

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.

alhman avatar Jul 07 '22 12:07 alhman

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.

GlauberF avatar Jul 07 '22 17:07 GlauberF

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

alhman avatar Jul 08 '22 14:07 alhman

I think my problem is with the barcode type, I would need ean13. is there any way to generate instead of code128 ?

GlauberF avatar Jul 08 '22 18:07 GlauberF

currently not but once we drop support for Python 2 we should be able include other bar code formats.

alhman avatar Jul 11 '22 11:07 alhman

@alhman waiting anxiously.

GlauberF avatar Jul 11 '22 16:07 GlauberF

@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.

GlauberF avatar Aug 04 '22 20:08 GlauberF

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.

GlauberF avatar Aug 05 '22 14:08 GlauberF

Additional barcodes such as EAN13 are now available in v3.2.0

alhman avatar May 12 '23 18:05 alhman