Skip to footer content
USING IRONBARCODE

C# Generate Barcode from String: Complete Tutorial with IronBarcode

Encoding string data into barcode images is a fundamental requirement for inventory systems, retail applications, and document management. This tutorial demonstrates how to generate barcodes from string values in C# using IronBarcode -- covering everything from installation to saving barcode images in multiple formats, styling them for production use, and processing large batches from database data.

IronBarcode is a .NET library developed by Iron Software that simplifies barcode generation and reading for .NET developers building Windows applications, web services, and cloud-hosted APIs. Start your free trial to follow along with the code examples below.

How Do You Install IronBarcode in a .NET Project?

Installing IronBarcode takes seconds using the .NET CLI or the NuGet Package Manager inside Visual Studio.

Option 1 -- .NET CLI (recommended for .NET 10):

dotnet add package Barcode
dotnet add package Barcode
SHELL

Option 2 -- NuGet Package Manager Console in Visual Studio:

Install-Package BarCode

Alternatively, search for "IronBarCode" in the NuGet Package Manager GUI and install the official package. The library targets .NET Framework 4.6.2+ and .NET 5 through .NET 10, ensuring compatibility with modern .NET workloads.

After installation, add a single using directive at the top of each file that generates or reads barcodes:

using IronBarCode;
using IronBarCode;
Imports IronBarCode
$vbLabelText   $csharpLabel

That directive exposes BarcodeWriter, BarcodeReader, BarcodeEncoding, and the other public types covered in this guide.

How Do You Generate a Simple Barcode from a String in C#?

The BarcodeWriter.CreateBarcode method is the entry point for barcode generation. Pass in the string you want to encode together with a BarcodeEncoding value and you get back a GeneratedBarcode object ready for saving or further manipulation.

using IronBarCode;

// Generate a Code 128 barcode from a product SKU string
string productCode = "SKU-78432-A";
var barcode = BarcodeWriter.CreateBarcode(productCode, BarcodeEncoding.Code128);
barcode.SaveAsPng("product_barcode.png");
using IronBarCode;

// Generate a Code 128 barcode from a product SKU string
string productCode = "SKU-78432-A";
var barcode = BarcodeWriter.CreateBarcode(productCode, BarcodeEncoding.Code128);
barcode.SaveAsPng("product_barcode.png");
Imports IronBarCode

' Generate a Code 128 barcode from a product SKU string
Dim productCode As String = "SKU-78432-A"
Dim barcode = BarcodeWriter.CreateBarcode(productCode, BarcodeEncoding.Code128)
barcode.SaveAsPng("product_barcode.png")
$vbLabelText   $csharpLabel

Barcode Generation Output

C# Generate Barcode from String: Complete Tutorial with IronBarcode: Image 1 - Example output barcode

This creates a Code128 barcode image from the product string and saves it as a PNG file. The CreateBarcode method handles all encoding complexity, so a barcode image can be produced with minimal code. IronBarcode supports saving to PNG, JPEG, GIF, TIFF, BMP, and SVG formats.

The method also accepts optional width and height parameters to control the output dimensions, helping ensure proper scan quality in the target environment:

using IronBarCode;

// Specify width and height in pixels for the barcode image
string productCode = "SKU-78432-A";
var barcode = BarcodeWriter.CreateBarcode(productCode, BarcodeEncoding.Code128, 400, 120);
barcode.SaveAsPng("product_barcode_sized.png");
using IronBarCode;

// Specify width and height in pixels for the barcode image
string productCode = "SKU-78432-A";
var barcode = BarcodeWriter.CreateBarcode(productCode, BarcodeEncoding.Code128, 400, 120);
barcode.SaveAsPng("product_barcode_sized.png");
Imports IronBarCode

' Specify width and height in pixels for the barcode image
Dim productCode As String = "SKU-78432-A"
Dim barcode = BarcodeWriter.CreateBarcode(productCode, BarcodeEncoding.Code128, 400, 120)
barcode.SaveAsPng("product_barcode_sized.png")
$vbLabelText   $csharpLabel

Setting explicit dimensions is especially useful when generating labels for thermal label printers, where the output size must match the label stock exactly.

What Barcode Formats Does IronBarcode Support?

IronBarcode supports more than 20 barcode types for different use cases. Selecting the correct format ensures proper scanning and adequate data capacity for the application.

using IronBarCode;

string url = "https://ironsoftware.com/csharp/barcode/";
string numericId = "0123456789012";

// QR Code -- best for URLs, text data, and mobile scanning
BarcodeWriter.CreateBarcode(url, BarcodeEncoding.QRCode)
    .SaveAsPng("qrcode.png");

// UPC-A -- required for retail point-of-sale systems (12 digits)
BarcodeWriter.CreateBarcode(numericId, BarcodeEncoding.UPCA)
    .SaveAsPng("upc_barcode.png");

// PDF417 -- suited for documents that need higher data capacity
BarcodeWriter.CreateBarcode("Extended product details here", BarcodeEncoding.PDF417)
    .SaveAsJpeg("pdf417_barcode.jpeg");
using IronBarCode;

string url = "https://ironsoftware.com/csharp/barcode/";
string numericId = "0123456789012";

// QR Code -- best for URLs, text data, and mobile scanning
BarcodeWriter.CreateBarcode(url, BarcodeEncoding.QRCode)
    .SaveAsPng("qrcode.png");

// UPC-A -- required for retail point-of-sale systems (12 digits)
BarcodeWriter.CreateBarcode(numericId, BarcodeEncoding.UPCA)
    .SaveAsPng("upc_barcode.png");

// PDF417 -- suited for documents that need higher data capacity
BarcodeWriter.CreateBarcode("Extended product details here", BarcodeEncoding.PDF417)
    .SaveAsJpeg("pdf417_barcode.jpeg");
Imports IronBarCode

Dim url As String = "https://ironsoftware.com/csharp/barcode/"
Dim numericId As String = "0123456789012"

' QR Code -- best for URLs, text data, and mobile scanning
BarcodeWriter.CreateBarcode(url, BarcodeEncoding.QRCode) _
    .SaveAsPng("qrcode.png")

' UPC-A -- required for retail point-of-sale systems (12 digits)
BarcodeWriter.CreateBarcode(numericId, BarcodeEncoding.UPCA) _
    .SaveAsPng("upc_barcode.png")

' PDF417 -- suited for documents that need higher data capacity
BarcodeWriter.CreateBarcode("Extended product details here", BarcodeEncoding.PDF417) _
    .SaveAsJpeg("pdf417_barcode.jpeg")
$vbLabelText   $csharpLabel

Barcode Image Outputs

C# Generate Barcode from String: Complete Tutorial with IronBarcode: Image 2 - Generated Barcodes

The table below summarises when to use each major format:

IronBarcode supported barcode formats by use case
FormatBest ForCharacter Set
QRCodeURLs, text, mobile scanningASCII + Unicode
Code128Alphanumeric product codes, shipping labelsFull ASCII
UPCA / EAN13Retail point-of-sale systemsNumeric only
PDF417ID cards, boarding passes, documentsBinary data
DataMatrixSmall labels, electronicsASCII + Binary
AztecTransport tickets, mobile boardingASCII + Unicode

For the full list of supported encodings visit the IronBarcode barcode types reference.

How Do You Customize and Style Barcode Images in C#?

Beyond basic barcode generation, IronBarcode exposes a fluent styling API for adjusting colors, adding annotations, and resizing barcode images without any external image-processing library.

using IronBarCode;
using IronSoftware.Drawing;

string orderNumber = "ORD-2024-00542";
var styledBarcode = BarcodeWriter.CreateBarcode(orderNumber, BarcodeEncoding.Code128);

// Adjust colors to match brand identity
styledBarcode.ChangeBarCodeColor(Color.DarkBlue);
styledBarcode.ChangeBackgroundColor(Color.White);

// Add readable text annotations above and below the bars
styledBarcode.AddAnnotationTextAboveBarcode("Order Number", new Font("Arial", 12), Color.Black, 5);
styledBarcode.AddBarcodeValueTextBelowBarcode(new Font("Arial", 10), Color.Gray, 5);

// Resize to fit a thermal label at 400 x 150 pixels
styledBarcode.ResizeTo(400, 150);
styledBarcode.SaveAsPng("styled_order_barcode.png");
using IronBarCode;
using IronSoftware.Drawing;

string orderNumber = "ORD-2024-00542";
var styledBarcode = BarcodeWriter.CreateBarcode(orderNumber, BarcodeEncoding.Code128);

// Adjust colors to match brand identity
styledBarcode.ChangeBarCodeColor(Color.DarkBlue);
styledBarcode.ChangeBackgroundColor(Color.White);

// Add readable text annotations above and below the bars
styledBarcode.AddAnnotationTextAboveBarcode("Order Number", new Font("Arial", 12), Color.Black, 5);
styledBarcode.AddBarcodeValueTextBelowBarcode(new Font("Arial", 10), Color.Gray, 5);

// Resize to fit a thermal label at 400 x 150 pixels
styledBarcode.ResizeTo(400, 150);
styledBarcode.SaveAsPng("styled_order_barcode.png");
Imports IronBarCode
Imports IronSoftware.Drawing

Dim orderNumber As String = "ORD-2024-00542"
Dim styledBarcode = BarcodeWriter.CreateBarcode(orderNumber, BarcodeEncoding.Code128)

' Adjust colors to match brand identity
styledBarcode.ChangeBarCodeColor(Color.DarkBlue)
styledBarcode.ChangeBackgroundColor(Color.White)

' Add readable text annotations above and below the bars
styledBarcode.AddAnnotationTextAboveBarcode("Order Number", New Font("Arial", 12), Color.Black, 5)
styledBarcode.AddBarcodeValueTextBelowBarcode(New Font("Arial", 10), Color.Gray, 5)

' Resize to fit a thermal label at 400 x 150 pixels
styledBarcode.ResizeTo(400, 150)
styledBarcode.SaveAsPng("styled_order_barcode.png")
$vbLabelText   $csharpLabel

Styled Barcode Output

C# Generate Barcode from String: Complete Tutorial with IronBarcode: Image 3 - styled barcode

What Styling Properties Are Available?

The GeneratedBarcode class exposes several categories of styling methods:

  • Color control -- ChangeBarCodeColor, ChangeBackgroundColor accept any Color from IronSoftware.Drawing
  • Text annotations -- add text above or below the barcode with custom font, size, and color
  • Margin control -- set padding around the barcode to improve scanner performance on cluttered labels
  • Rotation -- rotate the barcode image sideways or diagonally for label layouts that require portrait orientation
  • Resize -- fix width and height in pixels without distorting the encoded data

The styling methods chain together naturally, keeping the code readable while producing barcode images that match the application's visual design. For a deeper walkthrough, see the barcode styling how-to guide.

How Do You Generate Multiple Barcodes from Database Data?

Real-world applications frequently require barcode generation for collections of items -- product catalogues, stock replenishment runs, or order dispatch workflows. IronBarcode handles batch processing without any additional configuration.

using IronBarCode;

// Data sourced from a database query result
List<string> productIds =
[
    "PROD-001-X",
    "PROD-002-Y",
    "PROD-003-Z",
    "PROD-004-W"
];

// Generate one barcode image per product ID
foreach (string productId in productIds)
{
    var barcode = BarcodeWriter.CreateBarcode(productId, BarcodeEncoding.Code128, 300, 100);
    barcode.SaveAsPng($"barcodes/{productId}.png");
}
using IronBarCode;

// Data sourced from a database query result
List<string> productIds =
[
    "PROD-001-X",
    "PROD-002-Y",
    "PROD-003-Z",
    "PROD-004-W"
];

// Generate one barcode image per product ID
foreach (string productId in productIds)
{
    var barcode = BarcodeWriter.CreateBarcode(productId, BarcodeEncoding.Code128, 300, 100);
    barcode.SaveAsPng($"barcodes/{productId}.png");
}
Imports IronBarCode

' Data sourced from a database query result
Dim productIds As New List(Of String) From {
    "PROD-001-X",
    "PROD-002-Y",
    "PROD-003-Z",
    "PROD-004-W"
}

' Generate one barcode image per product ID
For Each productId As String In productIds
    Dim barcode = BarcodeWriter.CreateBarcode(productId, BarcodeEncoding.Code128, 300, 100)
    barcode.SaveAsPng($"barcodes/{productId}.png")
Next
$vbLabelText   $csharpLabel

Output Barcodes

C# Generate Barcode from String: Complete Tutorial with IronBarcode: Image 4 - multiple generated barcodes

Scaling to High Volumes

The loop pattern above scales to thousands of records without modification. For high-volume barcode generation, IronBarcode supports async and multithreaded operations to maximize throughput on multi-core servers.

The generated barcode images can be embedded in PDF reports, printed on labels, or stored in a document management system. Each image encodes the original string in a binary pattern that barcode scanners decode back to text.

For production batch jobs that generate thousands of barcodes per run, consider pre-warming the IronBarcode engine before the loop begins. The first call to CreateBarcode initializes internal encoding caches; subsequent calls within the same process complete faster as a result. Wrapping the entire batch in a single timed method also makes it straightforward to log aggregate statistics -- total barcodes generated, any encoding failures, and elapsed time -- before the batch terminates. This pattern integrates cleanly with background job frameworks such as Hangfire or .NET's built-in IHostedService for scheduled generation tasks.

How Do You Save and Export Barcodes in Different File Formats?

GeneratedBarcode offers a range of save methods covering the most common image formats used in business applications:

using IronBarCode;

string value = "EXPORT-TEST-001";
var barcode = BarcodeWriter.CreateBarcode(value, BarcodeEncoding.Code128, 400, 120);

// Save to disk in multiple formats
barcode.SaveAsPng("barcode.png");       // Lossless -- best for print
barcode.SaveAsJpeg("barcode.jpg");      // Compressed -- smaller file size
barcode.SaveAsGif("barcode.gif");       // Compatible with legacy systems
barcode.SaveAsTiff("barcode.tiff");     // Multi-page archival format
barcode.SaveAsBmp("barcode.bmp");       // Uncompressed bitmap

// Export as a byte array for in-memory operations (API responses, database storage)
byte[] pngBytes = barcode.ToStream(ImageFormat.Png).ToArray();
using IronBarCode;

string value = "EXPORT-TEST-001";
var barcode = BarcodeWriter.CreateBarcode(value, BarcodeEncoding.Code128, 400, 120);

// Save to disk in multiple formats
barcode.SaveAsPng("barcode.png");       // Lossless -- best for print
barcode.SaveAsJpeg("barcode.jpg");      // Compressed -- smaller file size
barcode.SaveAsGif("barcode.gif");       // Compatible with legacy systems
barcode.SaveAsTiff("barcode.tiff");     // Multi-page archival format
barcode.SaveAsBmp("barcode.bmp");       // Uncompressed bitmap

// Export as a byte array for in-memory operations (API responses, database storage)
byte[] pngBytes = barcode.ToStream(ImageFormat.Png).ToArray();
Imports IronBarCode

Dim value As String = "EXPORT-TEST-001"
Dim barcode = BarcodeWriter.CreateBarcode(value, BarcodeEncoding.Code128, 400, 120)

' Save to disk in multiple formats
barcode.SaveAsPng("barcode.png")       ' Lossless -- best for print
barcode.SaveAsJpeg("barcode.jpg")      ' Compressed -- smaller file size
barcode.SaveAsGif("barcode.gif")       ' Compatible with legacy systems
barcode.SaveAsTiff("barcode.tiff")     ' Multi-page archival format
barcode.SaveAsBmp("barcode.bmp")       ' Uncompressed bitmap

' Export as a byte array for in-memory operations (API responses, database storage)
Dim pngBytes As Byte() = barcode.ToStream(ImageFormat.Png).ToArray()
$vbLabelText   $csharpLabel

Choosing the right format depends on the downstream consumer. PNG works well for print-ready labels and documents. JPEG suits applications where storage size is a constraint. For embedding barcodes directly in PDF documents, IronBarcode integrates with IronPDF to stamp or insert barcode images programmatically.

The ToStream overload is particularly valuable in web APIs and cloud functions where writing to disk is not desirable. The byte array can be stored in a database BLOB column, uploaded to cloud storage, or streamed directly to an HTTP response without any intermediate file on the filesystem.

How Do You Validate String Data Before Encoding?

Not every string is valid for every barcode format. UPC-A requires exactly 12 numeric digits, EAN-13 requires 13, and some 1D formats reject characters outside of a limited ASCII subset. Passing invalid data to CreateBarcode raises an IronBarCodeEncodingException. Wrapping the call in a try/catch block and validating input upfront prevents unhandled exceptions in production:

using IronBarCode;

bool TryCreateBarcode(string value, BarcodeEncoding encoding, string outputPath)
{
    if (string.IsNullOrWhiteSpace(value))
    {
        Console.WriteLine("Value must not be empty.");
        return false;
    }

    try
    {
        var barcode = BarcodeWriter.CreateBarcode(value, encoding);
        barcode.SaveAsPng(outputPath);
        return true;
    }
    catch (IronBarCodeEncodingException ex)
    {
        Console.WriteLine($"Encoding failed: {ex.Message}");
        return false;
    }
}

// Usage
TryCreateBarcode("SKU-001", BarcodeEncoding.Code128, "output.png");   // succeeds
TryCreateBarcode("NOT-NUMERIC", BarcodeEncoding.UPCA, "output.png");  // encoding exception
using IronBarCode;

bool TryCreateBarcode(string value, BarcodeEncoding encoding, string outputPath)
{
    if (string.IsNullOrWhiteSpace(value))
    {
        Console.WriteLine("Value must not be empty.");
        return false;
    }

    try
    {
        var barcode = BarcodeWriter.CreateBarcode(value, encoding);
        barcode.SaveAsPng(outputPath);
        return true;
    }
    catch (IronBarCodeEncodingException ex)
    {
        Console.WriteLine($"Encoding failed: {ex.Message}");
        return false;
    }
}

// Usage
TryCreateBarcode("SKU-001", BarcodeEncoding.Code128, "output.png");   // succeeds
TryCreateBarcode("NOT-NUMERIC", BarcodeEncoding.UPCA, "output.png");  // encoding exception
Imports IronBarCode

Function TryCreateBarcode(value As String, encoding As BarcodeEncoding, outputPath As String) As Boolean
    If String.IsNullOrWhiteSpace(value) Then
        Console.WriteLine("Value must not be empty.")
        Return False
    End If

    Try
        Dim barcode = BarcodeWriter.CreateBarcode(value, encoding)
        barcode.SaveAsPng(outputPath)
        Return True
    Catch ex As IronBarCodeEncodingException
        Console.WriteLine($"Encoding failed: {ex.Message}")
        Return False
    End Try
End Function

' Usage
TryCreateBarcode("SKU-001", BarcodeEncoding.Code128, "output.png")   ' succeeds
TryCreateBarcode("NOT-NUMERIC", BarcodeEncoding.UPCA, "output.png")  ' encoding exception
$vbLabelText   $csharpLabel

Choosing the Right Format for the Input Data

When the barcode format is configurable at runtime, a helper that maps content type to the appropriate encoding avoids silent failures:

  • Use BarcodeEncoding.QRCode when the string contains URLs, email addresses, or multi-byte Unicode characters.
  • Use BarcodeEncoding.Code128 for general alphanumeric strings up to roughly 80 characters.
  • Use BarcodeEncoding.EAN13 or BarcodeEncoding.UPCA only when the data is purely numeric and the length is fixed. The check digit is calculated automatically by IronBarcode.
  • Use BarcodeEncoding.DataMatrix for very short alphanumeric strings that must fit on a physically small label.

Adding format validation before calling CreateBarcode keeps error messages user-facing rather than cryptic stack traces in application logs.

How Do You Read a Barcode Back from a String Value?

Generating a barcode is only half the workflow in many systems. The barcode reading API uses BarcodeReader.Read to decode an image back to the original string.

using IronBarCode;

// Read all barcodes from an image file
var results = BarcodeReader.Read("product_barcode.png");

foreach (var result in results)
{
    // Output the decoded string value
    Console.WriteLine($"Decoded value: {result.Value}");
    Console.WriteLine($"Format detected: {result.BarcodeType}");
}
using IronBarCode;

// Read all barcodes from an image file
var results = BarcodeReader.Read("product_barcode.png");

foreach (var result in results)
{
    // Output the decoded string value
    Console.WriteLine($"Decoded value: {result.Value}");
    Console.WriteLine($"Format detected: {result.BarcodeType}");
}
Imports IronBarCode

' Read all barcodes from an image file
Dim results = BarcodeReader.Read("product_barcode.png")

For Each result In results
    ' Output the decoded string value
    Console.WriteLine($"Decoded value: {result.Value}")
    Console.WriteLine($"Format detected: {result.BarcodeType}")
Next
$vbLabelText   $csharpLabel

This makes it straightforward to build round-trip barcode workflows -- generate a barcode from a product record, save it to disk or a label printer queue, then later scan the physical label and decode the value back to look up the record. For reading barcodes from PDF files or live camera feeds, IronBarcode provides dedicated methods with the same straightforward API.

How Do You Use IronBarcode in ASP.NET Core Web APIs?

IronBarcode works inside ASP.NET Core controllers and minimal API handlers. The most common pattern returns a barcode image as a file result or base64-encoded data URI for rendering in the browser.

using IronBarCode;
using Microsoft.AspNetCore.Mvc;

var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();

// Minimal API endpoint -- returns a barcode PNG for the given value
app.MapGet("/barcode/{value}", (string value) =>
{
    var barcode = BarcodeWriter.CreateBarcode(value, BarcodeEncoding.Code128, 400, 120);
    byte[] imageBytes = barcode.ToStream(ImageFormat.Png).ToArray();
    return Results.File(imageBytes, "image/png");
});

app.Run();
using IronBarCode;
using Microsoft.AspNetCore.Mvc;

var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();

// Minimal API endpoint -- returns a barcode PNG for the given value
app.MapGet("/barcode/{value}", (string value) =>
{
    var barcode = BarcodeWriter.CreateBarcode(value, BarcodeEncoding.Code128, 400, 120);
    byte[] imageBytes = barcode.ToStream(ImageFormat.Png).ToArray();
    return Results.File(imageBytes, "image/png");
});

app.Run();
Imports IronBarCode
Imports Microsoft.AspNetCore.Mvc

Dim builder = WebApplication.CreateBuilder(args)
Dim app = builder.Build()

' Minimal API endpoint -- returns a barcode PNG for the given value
app.MapGet("/barcode/{value}", Function(value As String)
                                   Dim barcode = BarcodeWriter.CreateBarcode(value, BarcodeEncoding.Code128, 400, 120)
                                   Dim imageBytes As Byte() = barcode.ToStream(ImageFormat.Png).ToArray()
                                   Return Results.File(imageBytes, "image/png")
                               End Function)

app.Run()
$vbLabelText   $csharpLabel

The endpoint generates a barcode on demand for any value passed in the URL path. For production deployments, add caching so that repeated requests for the same barcode value do not regenerate the image. See the full ASP.NET barcode generation tutorial for a more detailed walkthrough including dependency injection and response caching.

What Are Your Next Steps?

Generating barcodes from string data in C# is straightforward with IronBarcode. The fluent API handles the complexity of barcode encoding while providing flexibility for customization and batch processing. Whether the target is simple Code 128 barcodes for inventory or QR codes for mobile applications, IronBarcode delivers reliable barcode functionality for .NET applications.

To go further:

Get stated with IronBarcode now.
green arrow pointer

Frequently Asked Questions

How do you install IronBarcode for generating barcodes in C#?

Run 'dotnet add package Barcode' from the .NET CLI, or open the NuGet Package Manager in Visual Studio, search for 'IronBarCode', and install the official package.

What barcode formats can be generated from a string using IronBarcode?

IronBarcode supports more than 20 formats including QR Code, Code 128, UPC-A, EAN-13, PDF417, Data Matrix, and Aztec. The format is specified via the BarcodeEncoding enum.

Can the appearance of barcodes generated with IronBarcode be customized?

Yes. IronBarcode exposes methods to change bar color, background color, add text annotations above or below the barcode, set margins, resize, and rotate the output image.

Does IronBarcode support batch barcode generation?

Yes. Iterate over a list or database result set and call BarcodeWriter.CreateBarcode for each value. For very high volumes, IronBarcode also supports async and multithreaded operations.

What image formats can IronBarcode save barcodes to?

IronBarcode can save barcodes as PNG, JPEG, GIF, TIFF, BMP, and SVG. The ToStream method returns a byte array for in-memory usage without writing to disk.

How do you encode a string into a barcode using IronBarcode?

Call BarcodeWriter.CreateBarcode(value, BarcodeEncoding.Code128) where value is the string and BarcodeEncoding specifies the format. Then call SaveAsPng or another save method on the returned GeneratedBarcode object.

What .NET versions does IronBarcode support?

IronBarcode supports .NET Framework 4.6.2 and later, plus .NET 5 through .NET 10, covering both legacy and modern .NET workloads.

Can IronBarcode be used in ASP.NET Core web applications?

Yes. IronBarcode works inside controllers and minimal API handlers. A common pattern calls CreateBarcode, converts the result to a byte array with ToStream, and returns it as a file result from the endpoint.

How do you read a barcode back to its original string in C#?

Use BarcodeReader.Read(filePath) to decode an image. The method returns a collection of BarcodeResult objects each containing the decoded Value string and the detected BarcodeType.

Is there a free trial for IronBarcode?

Yes. IronBarcode offers a free trial license that allows full evaluation of all features before committing to a paid license for production deployment.

Jordi Bardia
Software Engineer
Jordi is most proficient in Python, C# and C++, when he isn’t leveraging his skills at Iron Software; he’s game programming. Sharing responsibilities for product testing, product development and research, Jordi adds immense value to continual product improvement. The varied experience keeps him challenged and engaged, and he ...
Read More

Iron Support Team

We're online 24 hours, 5 days a week.
Chat
Email
Call Me