https://github.com/jordao76/nbarcodes
.NET library to generate common 1D barcodes
https://github.com/jordao76/nbarcodes
barcode c-sharp code128 code39 ean ean13 ean8 interleaved2of5 standard2of5 upc upca upce
Last synced: 26 days ago
JSON representation
.NET library to generate common 1D barcodes
- Host: GitHub
- URL: https://github.com/jordao76/nbarcodes
- Owner: jordao76
- License: other
- Created: 2015-03-14T03:30:43.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2017-12-14T22:47:42.000Z (about 8 years ago)
- Last Synced: 2025-11-02T05:24:58.719Z (4 months ago)
- Topics: barcode, c-sharp, code128, code39, ean, ean13, ean8, interleaved2of5, standard2of5, upc, upca, upce
- Language: C#
- Homepage:
- Size: 4.06 MB
- Stars: 12
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# NBarCodes
[](https://www.nuget.org/packages/NBarCodes/)
[](https://ci.appveyor.com/project/jordao76/nbarcodes)
[](https://github.com/jordao76/nbarcodes/blob/master/LICENSE.txt)
**NBarCodes** is a .NET library to generate common one-dimensional barcodes. Supported barcode types include Code 128, Code 39, Standard 2 of 5, Interleaved 2 of 5, EAN-13, EAN-8, UPC-A, UPC-E and Postnet.
## Quick intro

```csharp
using NBarCodes;
...
var settings = new BarCodeSettings {
Type = BarCodeType.Code128,
Data = "NBarCodes"
};
var generator = new BarCodeGenerator(settings);
using (var barcodeImage = generator.GenerateImage()) {
// use the generated barcodeImage
}
```
The `BarCodeSettings` object holds the barcode information. This class has many properties that affect the rendering of the barcode, like the barcode type, the data to render, bar measures, text position and colors. Required properties are simply `Type`, for the barcode type, and `Data`, for the data to render. The `BarCodeGenerator` class is used to generate the right barcode from the provided barcode settings.
A `BarCodeFormatException` can be thrown if the settings provided have errors for the target barcode. The settings can be checked before calling `GenerateImage` with the method `TestRender` on the `BarCodeGenerator` class.
## License
Licensed under the [MIT license](https://github.com/jordao76/nbarcodes/blob/master/LICENSE.txt).