• Stars
    star
    152
  • Rank 243,602 (Top 5 %)
  • Language
    C#
  • License
    MIT License
  • Created almost 6 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Lightweight Barcode Encoding Library for .NET Framework, .NET Standard and .NET Core.

Barcoder - Barcode Encoding Library

Build status

Lightweight Barcode Encoding Library for .NET Framework, .NET Standard and .NET Core. Additional packages are available for rendering the generated barcode to SVG or an image.

Code ported from the GO project https://github.com/boombuler/barcode by Florian Sundermann.

Supported Barcode Types:

  • 2 of 5
  • Aztec Code
  • Codabar
  • Code 39
  • Code 93
  • Code 128
  • Code 128 GS1
  • Data Matrix (ECC 200)
  • Data Matrix GS1
  • EAN 8
  • EAN 13
  • KIX (used by PostNL)
  • PDF 417
  • QR Code
  • RM4SC (Royal Mail 4 State Code)
  • UPC A
  • UPC E

NuGet package

To install the main package:

PM> Install-Package Barcoder

To install the SVG renderer:

PM> Install-Package Barcoder.Renderer.Svg

To install the image renderer1:

PM> Install-Package Barcoder.Renderer.Image

Usage - render to SVG

var barcode = Code128Encoder.Encode("FOO/BAR/12345");
var renderer = new SvgRenderer();

using (var stream = new MemoryStream())
using (var reader = new StreamReader(stream))
{
    renderer.Render(barcode, stream);
    stream.Position = 0;

    string svg = reader.ReadToEnd();
    Console.WriteLine(svg);
}

Usage - render to PNG, JPEG, GIF or BMP

Example for rendering to PNG:

var barcode = QrEncoder.Encode("Hello World!");
var renderer = new ImageRenderer(new ImageRendererOptions { ImageFormat = ImageFormat.Png });

using (var stream = new FileStream("output.png", FileMode.Create))
{
    renderer.Render(barcode, stream);
}

Supported image formats can be found here

Footnotes

  1. The Barcoder.Renderer.Image package depends on the cross-platform SixLabors.ImageSharp.Drawing library. So when using this package, also respect their LICENSE. ↩

More Repositories

1

SapNwRfc

SAP NetWeaver RFC library for .NET 5, .NET Core and .NET Framework
C#
143
star
2

entity-framework-core-mock

Easy Mock wrapper for mocking EFCore5 DbContext and DbSet using Moq or NSubstitute
C#
132
star
3

print-it

Windows service for printing PDF files to a local or network printer in the background
C#
84
star
4

pem-utils

Managed .NET (C#) utility library for working with PEM files with DER/ASN.1 encoding
C#
68
star
5

win-beacon

Managed BT stack for Windows able to detect and act as an iBeacon.
C#
55
star
6

entity-framework-mock

Easy Mock wrapper for mocking EF6 DbContext and DbSet using Moq or NSubstitute
C#
48
star
7

cash-flow

Application for managing cash flows written in ASP.NET Core 6 and Angular 13 (EF Core, Apollo, GraphQL, CQRS)
C#
37
star
8

oauth2-client-handler

Managed .NET (C#) library for use with HttpClient to transparantly call authorized WebAPI
C#
35
star
9

Aggregator

Managed CQRS/ES fundamentals for dotnet core and dotnet framework
C#
31
star
10

process-manager

Managed library for managing and queing spawned processes
C#
27
star
11

svglib

SVG parser and composer library for .NET Framework and .NET Core
C#
11
star
12

owin-session-middleware

Cookie based session middleware for OWIN
C#
8
star
13

sepa-qr

.NET QR-Code generator for SEPA Payment Transactions
C#
4
star
14

owin-anti-forgery-middleware

OWIN Anti-Forgery (CSRF) middleware
C#
3
star
15

idento

Complete, manageable OpenID Connect server for adding Single Sign On (SSO) functionality to your project
C#
2
star
16

simple-json-api

Simple JSON API server implementation for ASP.NET Web API 2
C#
2
star
17

projecto

Managed .NET (C#) library for handling CQRS/ES projections while maintaining the event sequence order
C#
2
star
18

WaterTube

Library for filling a water tube and detecting the water level
C#
1
star
19

oracle-sql-executor

Executes SQL scripts in a folder against an Oracle database
C#
1
star