barnhill / barcodelib

C# Barcode Image Generation Library
Apache License 2.0
744 stars 239 forks source link

Support for rendering top bar/bearer bars #199

Open mjamro opened 8 months ago

mjamro commented 8 months ago

This PR adds support for including top bar when rendering barcodes and configurable bearer bar mode for ITF-14.

Top-bar off (default)

EAN13_TopBar_Off

Top bar enabled

EAN13_TopBar_On

ITF-14 Bearer mode: frame (default)

ITF14_BearerBar_Frame

ITF-14 Bearer mode: bearer bars

ITF14_BearerBar

ITF-14 Bearer mode: disabled

ITF14_BearerBar_Disabled

RivenSkaye commented 2 months ago

frames/bearers are used as part of the spec or allowed for several types of barcode. Some recommend them and none actively forbid them (though some do mention it should always be wider than the widest bar distance). And they're even used in several 2D barcodes (Beetag, Color Code, Cronto Visual, HCCB) and allowed around many others.

The only thing I can't confirm being widely used or allowed is the horizontal top bar, but I can imagine that being a useful way to delineate the area a scanner actually looks at. In effect we've seen shipping labels with horizontal lines on them be less prone to scanning the wrong code if several are in the frame.

mjamro commented 2 months ago

frames/bearers are used as part of the spec or allowed for several types of barcode. Some recommend them and none actively forbid them (though some do mention it should always be wider than the widest bar distance). And they're even used in several 2D barcodes (Beetag, Color Code, Cronto Visual, HCCB) and allowed around many others.

The only thing I can't confirm being widely used or allowed is the horizontal top bar, but I can imagine that being a useful way to delineate the area a scanner actually looks at. In effect we've seen shipping labels with horizontal lines on them be less prone to scanning the wrong code if several are in the frame.

Top/Bottom bars are not for scanning - they're used during printing on thermal printers. If after printing the bar is not continous that means that the print head has some dirt on and needs to be cleaned or it has some dead dots and needs to be replaced. We use it extensively in food industry as it provides a quick check for the staff if the print head is ok. That also means they're useful on almost any 1D code.