The C# Code 128 Reader SDK is a high performance linear and 2D barcode recognition SDK for Microsoft Visual Studio .NET platforms. Scanning and reading Code 128 barcodes from image files is one of the barcode decoding functions provided by the .NET Barcode Scanner component. To assist .NET developers in integrating the barcode reader control into their projects, detailed online tutorials are available.
C# Code 128 Barcode Reader Library
QR Code, Data Matrix, Code 128, GS1, EAN/UPC. Multi-thread reading in C# ASP.NET, Windows application.
How to Retrieve Scanned Code 128 Barcode Properties in C#
Using the Barcode Reader library, scanned Code 128 barcode information can be retrieved, including the decoded text message, verified barcode format, position within the image, start code set, and checksum codeword value.
Extract Code 128 Core Information from BarCode
The following core information is accessible from the BarCode object:
GetTypeName(): Verifies that the scanned barcode is Code 128.
GetMessage(): Returns the decoded Code 128 text string.
GetMessageInASCII(): Returns the decoded Code 128 ASCII text string, with non printable characters replaced by visible labels.
IsGS1Compitable: Verifies that the Code 128 barcode is GS1-128
Corners: Pixel coordinates defining the Code 128 barcode region within the image.
How to Read, Process Scanned Code 128 ASCII Text in C#
Code 128 supports full 128 ASCII character encoding, including 95 printable characters and 33 control (non printable) characters. The following example demonstrates scanning a Code 128 barcode that contains the carriage return character ([CR]), which has ASCII value 13.
To obtain non printing ASCII characters replaced with visible text labels, use the GetMessageInASCII() method.
Verifying Scanned Code 128 Barcode Data Using the Check Character
Code 128 includes a mandatory check character. When using the Barcode Reader library, only the data characters are returned; the check character is not included. The library automatically verifies the scanned data against the check character, and if verification fails, the data is not returned.
Summary
This tutorial has provided a comprehensive guide to integrating Code 128 barcode reading capabilities into .NET applications using C# and VB.NET.
Developers can use the BarcodeLib Barcode Reader SDK to scan and decode Code 128 symbols from image files, extract detailed barcode properties including position, rotation, and encoding information, and handle ASCII text with control characters.
The barcode scanner component seamlessly integrates into ASP.NET web applications, WinForms desktop applications, and WPF based solutions, enabling robust Code 128 barcode reading functionality across multiple .NET environments. For challenging images, techniques such as zoom scaling and quiet zone enhancement can significantly improve recognition success rates.