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

Support for rendering top bar/bearer bars #199

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mjamro
Copy link

@mjamro mjamro commented Mar 18, 2024

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

@@ -38,8 +37,11 @@ public static SKImage Label_ITF14(Barcode barcode, SKBitmap img)
pen.ColorF = barcode.ForeColor;
pen.StrokeWidth = (float)img.Height / 16;

canvas.DrawLine(new SKPoint(0, backY - pen.StrokeWidth / 2f),
new SKPoint(img.Width, backY - pen.StrokeWidth / 2f), pen); //bottom
if (barcode.BearerBarsMode != BearerBarsMode.Disabled)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these bearer bars only apply to ITF-14 barcodes I would expect them to be configured only for that type somehow. As if you configure them for other types they wont apply.

@RivenSkaye
Copy link

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
Copy link
Author

mjamro commented Sep 12, 2024

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.

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

Successfully merging this pull request may close these issues.

3 participants