Generating a label and scanning one are both here, behind separate reader and writer interfaces. Output is an image file you can save, compose into a label with the Drawing API, or stamp onto a PDF.
The interfaces below are the part that does not change when you swap the library underneath. Each provider then adds whatever extras its own library exposes.
Code128, Code39, EAN-13, EAN-8, UPC-A, ITF and QR. The format is a value on the input, not a different call.
Content, format and size in; an image file out. QRCodeInput converts implicitly from a string, so the common case is one argument.
Decode from an uploaded photo or scan. The result carries every code found in the image, not only the first.
The result is an image file, so the Drawing API can place it on a canvas with labels and a background in one request.
Install the one that fits your runtime and licensing, and name it once at registration. Every package here is published on nuget.org.
The provider appears where the concrete class is constructed, and nowhere else. Always-current samples live in the package documentation.
// Write a QR code…
IQRCodeService qr = new Regira.Office.Barcodes.ZXing.QRCodeService();
IImageFile code = await qr.Create($"https://example.com/items/{item.Id}");
// …write a Code128 barcode…
IBarcodeService barcodes = new Regira.Office.Barcodes.ZXing.BarcodeService();
IImageFile label = await barcodes.Create(new BarcodeInput
{
Content = shipment.TrackingCode,
Format = BarcodeFormat.Code128,
Size = new ImageSize(400, 120)
});
// …and read one back from a photo.
BarcodeReadResult? scanned = await barcodes.Read(uploaded);
string? content = scanned?.Contents?.FirstOrDefault();Generate barcode and QR images with configurable content, colour and size, and decode one or all codes from an uploaded image.
The free tier needs no key and is rate-limited to 5 requests / 60 s. A trial or commercial key removes the limit — send it in the X-License-Key header.