Skip to footer content
MIGRATION GUIDES

Migrating from Cloudmersive Barcode API to IronBarcode

This is the simplest migration in .NET barcode history. Remove the HTTP client. Add a NuGet package. Delete the API key management. The rest is a find-and-replace.

Cloudmersive's .NET SDK is a generated REST API client — a thin wrapper around HttpClient calls. Every piece of Cloudmersive-specific code in your application is either configuration for that client, calls through that client, or error handling for what happens when network requests fail. None of that infrastructure is needed with IronBarcode, which processes barcodes locally with no network dependency.


Quick Start: Three Steps

Step 1: Swap the Packages

dotnet remove package Cloudmersive.APIClient.NET.Barcode
dotnet add package BarCode
dotnet remove package Cloudmersive.APIClient.NET.Barcode
dotnet add package BarCode
SHELL

Step 2: Replace Namespaces

// Remove these
using Cloudmersive.APIClient.NET.Barcode.Api;
using Cloudmersive.APIClient.NET.Barcode.Client;

// Add this
using IronBarCode;
// Remove these
using Cloudmersive.APIClient.NET.Barcode.Api;
using Cloudmersive.APIClient.NET.Barcode.Client;

// Add this
using IronBarCode;
Imports IronBarCode
$vbLabelText   $csharpLabel

Step 3: Replace API Key Setup with License Key

// Remove this
Configuration.Default.ApiKey.Add("Apikey", "YOUR-CLOUDMERSIVE-API-KEY");

// Replace with this — set once at application startup
IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";
// Remove this
Configuration.Default.ApiKey.Add("Apikey", "YOUR-CLOUDMERSIVE-API-KEY");

// Replace with this — set once at application startup
IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";
' Remove this
Configuration.Default.ApiKey.Add("Apikey", "YOUR-CLOUDMERSIVE-API-KEY")

' Replace with this — set once at application startup
IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY"
$vbLabelText   $csharpLabel

In an ASP.NET Core application, the license key goes in Program.cs before builder.Build():

using IronBarCode;

IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";

var builder = WebApplication.CreateBuilder(args);
// ... rest of startup
using IronBarCode;

IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";

var builder = WebApplication.CreateBuilder(args);
// ... rest of startup
Imports IronBarCode

IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY"

Dim builder = WebApplication.CreateBuilder(args)
' ... rest of startup
$vbLabelText   $csharpLabel

Cost: What You Were Spending vs What You'll Spend

Before migrating, it's worth calculating what the Cloudmersive integration actually costs. The math is straightforward:

Your Daily Volume Monthly Requests Cloudmersive Tier IronBarcode (one-time)
100/day ~3,000 Basic $19.99/mo $749
1,000/day ~30,000 Business $49.99/mo $749
5,000/day ~150,000 Advantage $199.99/mo $749
10,000/day ~300,000 Medium Business $499.99/mo $749
25,000/day ~750,000 Enterprise (custom) $1,499 (Plus, 3 devs)

If you're paying more than ~$63/month for Cloudmersive, IronBarcode's Lite license pays for itself within the first year. After break-even, IronBarcode is a perpetual license with no renewal and no per-request charges.


Code Migration Examples

QR Code Generation

The most common Cloudmersive generation call maps directly to IronBarcode:

Before (Cloudmersive):

using Cloudmersive.APIClient.NET.Barcode.Api;
using Cloudmersive.APIClient.NET.Barcode.Client;

Configuration.Default.ApiKey.Add("Apikey", "YOUR-CLOUDMERSIVE-API-KEY");

var apiInstance = new GenerateBarcodeApi();

byte[] result = apiInstance.GenerateBarcodeQRCode("https://example.com");
File.WriteAllBytes("qr.png", result);
using Cloudmersive.APIClient.NET.Barcode.Api;
using Cloudmersive.APIClient.NET.Barcode.Client;

Configuration.Default.ApiKey.Add("Apikey", "YOUR-CLOUDMERSIVE-API-KEY");

var apiInstance = new GenerateBarcodeApi();

byte[] result = apiInstance.GenerateBarcodeQRCode("https://example.com");
File.WriteAllBytes("qr.png", result);
Imports Cloudmersive.APIClient.NET.Barcode.Api
Imports Cloudmersive.APIClient.NET.Barcode.Client

Configuration.Default.ApiKey.Add("Apikey", "YOUR-CLOUDMERSIVE-API-KEY")

Dim apiInstance As New GenerateBarcodeApi()

Dim result As Byte() = apiInstance.GenerateBarcodeQRCode("https://example.com")
File.WriteAllBytes("qr.png", result)
$vbLabelText   $csharpLabel

After (IronBarcode):

using IronBarCode;

IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";

byte[] result = QRCodeWriter.CreateQrCode("https://example.com", 500)
    .ToPngBinaryData();
File.WriteAllBytes("qr.png", result);

// Or save directly
QRCodeWriter.CreateQrCode("https://example.com", 500)
    .SaveAsPng("qr.png");
using IronBarCode;

IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";

byte[] result = QRCodeWriter.CreateQrCode("https://example.com", 500)
    .ToPngBinaryData();
File.WriteAllBytes("qr.png", result);

// Or save directly
QRCodeWriter.CreateQrCode("https://example.com", 500)
    .SaveAsPng("qr.png");
Imports IronBarCode

IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY"

Dim result As Byte() = QRCodeWriter.CreateQrCode("https://example.com", 500).ToPngBinaryData()
File.WriteAllBytes("qr.png", result)

' Or save directly
QRCodeWriter.CreateQrCode("https://example.com", 500).SaveAsPng("qr.png")
$vbLabelText   $csharpLabel

Code128 Generation

Before (Cloudmersive):

using Cloudmersive.APIClient.NET.Barcode.Api;
using Cloudmersive.APIClient.NET.Barcode.Client;

Configuration.Default.ApiKey.Add("Apikey", "YOUR-CLOUDMERSIVE-API-KEY");
var apiInstance = new GenerateBarcodeApi();

byte[] result = apiInstance.GenerateBarcodeCode128("SHIP-2024031500428");
File.WriteAllBytes("barcode.png", result);
using Cloudmersive.APIClient.NET.Barcode.Api;
using Cloudmersive.APIClient.NET.Barcode.Client;

Configuration.Default.ApiKey.Add("Apikey", "YOUR-CLOUDMERSIVE-API-KEY");
var apiInstance = new GenerateBarcodeApi();

byte[] result = apiInstance.GenerateBarcodeCode128("SHIP-2024031500428");
File.WriteAllBytes("barcode.png", result);
Imports Cloudmersive.APIClient.NET.Barcode.Api
Imports Cloudmersive.APIClient.NET.Barcode.Client

Configuration.Default.ApiKey.Add("Apikey", "YOUR-CLOUDMERSIVE-API-KEY")
Dim apiInstance As New GenerateBarcodeApi()

Dim result As Byte() = apiInstance.GenerateBarcodeCode128("SHIP-2024031500428")
File.WriteAllBytes("barcode.png", result)
$vbLabelText   $csharpLabel

After (IronBarcode):

using IronBarCode;

IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";

BarcodeWriter.CreateBarcode("SHIP-2024031500428", BarcodeEncoding.Code128)
    .SaveAsPng("barcode.png");

// Or get bytes directly
byte[] result = BarcodeWriter.CreateBarcode("SHIP-2024031500428", BarcodeEncoding.Code128)
    .ToPngBinaryData();
using IronBarCode;

IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";

BarcodeWriter.CreateBarcode("SHIP-2024031500428", BarcodeEncoding.Code128)
    .SaveAsPng("barcode.png");

// Or get bytes directly
byte[] result = BarcodeWriter.CreateBarcode("SHIP-2024031500428", BarcodeEncoding.Code128)
    .ToPngBinaryData();
Imports IronBarCode

IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY"

BarcodeWriter.CreateBarcode("SHIP-2024031500428", BarcodeEncoding.Code128) _
    .SaveAsPng("barcode.png")

' Or get bytes directly
Dim result As Byte() = BarcodeWriter.CreateBarcode("SHIP-2024031500428", BarcodeEncoding.Code128) _
    .ToPngBinaryData()
$vbLabelText   $csharpLabel

Barcode Reading

Before (Cloudmersive):

using Cloudmersive.APIClient.NET.Barcode.Api;
using Cloudmersive.APIClient.NET.Barcode.Client;

Configuration.Default.ApiKey.Add("Apikey", "YOUR-CLOUDMERSIVE-API-KEY");
var scanApi = new BarcodeScanApi();

using (var stream = File.OpenRead("barcode.png"))
{
    var result = scanApi.BarcodeScanImage(stream);
    if (result.Successful == true)
    {
        Console.WriteLine($"Value: {result.RawText}");
        Console.WriteLine($"Type: {result.BarcodeType}");
    }
}
using Cloudmersive.APIClient.NET.Barcode.Api;
using Cloudmersive.APIClient.NET.Barcode.Client;

Configuration.Default.ApiKey.Add("Apikey", "YOUR-CLOUDMERSIVE-API-KEY");
var scanApi = new BarcodeScanApi();

using (var stream = File.OpenRead("barcode.png"))
{
    var result = scanApi.BarcodeScanImage(stream);
    if (result.Successful == true)
    {
        Console.WriteLine($"Value: {result.RawText}");
        Console.WriteLine($"Type: {result.BarcodeType}");
    }
}
Imports Cloudmersive.APIClient.NET.Barcode.Api
Imports Cloudmersive.APIClient.NET.Barcode.Client

Configuration.Default.ApiKey.Add("Apikey", "YOUR-CLOUDMERSIVE-API-KEY")
Dim scanApi As New BarcodeScanApi()

Using stream = File.OpenRead("barcode.png")
    Dim result = scanApi.BarcodeScanImage(stream)
    If result.Successful = True Then
        Console.WriteLine($"Value: {result.RawText}")
        Console.WriteLine($"Type: {result.BarcodeType}")
    End If
End Using
$vbLabelText   $csharpLabel

After (IronBarcode):

using IronBarCode;

IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";

var results = BarcodeReader.Read("barcode.png");
var result = results.First();
Console.WriteLine($"Value: {result.Value}");
Console.WriteLine($"Type: {result.Format}");
using IronBarCode;

IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";

var results = BarcodeReader.Read("barcode.png");
var result = results.First();
Console.WriteLine($"Value: {result.Value}");
Console.WriteLine($"Type: {result.Format}");
Imports IronBarCode

IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY"

Dim results = BarcodeReader.Read("barcode.png")
Dim result = results.First()
Console.WriteLine($"Value: {result.Value}")
Console.WriteLine($"Type: {result.Format}")
$vbLabelText   $csharpLabel

Async Barcode Reading

If your Cloudmersive integration uses the async API:

Before (Cloudmersive):

using Cloudmersive.APIClient.NET.Barcode.Api;
using Cloudmersive.APIClient.NET.Barcode.Client;

Configuration.Default.ApiKey.Add("Apikey", "YOUR-CLOUDMERSIVE-API-KEY");
var scanApi = new BarcodeScanApi();

using (var stream = File.OpenRead("barcode.png"))
{
    var result = await scanApi.BarcodeScanImageAsync(stream);
    return result.Successful == true ? result.RawText : null;
}
using Cloudmersive.APIClient.NET.Barcode.Api;
using Cloudmersive.APIClient.NET.Barcode.Client;

Configuration.Default.ApiKey.Add("Apikey", "YOUR-CLOUDMERSIVE-API-KEY");
var scanApi = new BarcodeScanApi();

using (var stream = File.OpenRead("barcode.png"))
{
    var result = await scanApi.BarcodeScanImageAsync(stream);
    return result.Successful == true ? result.RawText : null;
}
Imports Cloudmersive.APIClient.NET.Barcode.Api
Imports Cloudmersive.APIClient.NET.Barcode.Client

Configuration.Default.ApiKey.Add("Apikey", "YOUR-CLOUDMERSIVE-API-KEY")
Dim scanApi As New BarcodeScanApi()

Using stream = File.OpenRead("barcode.png")
    Dim result = Await scanApi.BarcodeScanImageAsync(stream)
    Return If(result.Successful = True, result.RawText, Nothing)
End Using
$vbLabelText   $csharpLabel

After (IronBarcode):

using IronBarCode;

IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";

// IronBarcode is synchronous; wrap in Task.Run to free the calling thread for CPU-bound work
var results = await Task.Run(() => BarcodeReader.Read("barcode.png"));
return results.FirstOrDefault()?.Value;
using IronBarCode;

IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";

// IronBarcode is synchronous; wrap in Task.Run to free the calling thread for CPU-bound work
var results = await Task.Run(() => BarcodeReader.Read("barcode.png"));
return results.FirstOrDefault()?.Value;
Imports IronBarCode

IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY"

' IronBarcode is synchronous; wrap in Task.Run to free the calling thread for CPU-bound work
Dim results = Await Task.Run(Function() BarcodeReader.Read("barcode.png"))
Return results.FirstOrDefault()?.Value
$vbLabelText   $csharpLabel

Reading Barcodes from PDF

Cloudmersive has no native PDF support. If your existing code extracts images from PDFs before scanning, replace that entire pipeline with a single IronBarcode call:

Before (Cloudmersive — requires separate PDF extraction):

// Requires a separate PDF library to extract pages as images,
// then one Cloudmersive API call per extracted page image.
var scanApi = new BarcodeScanApi();
foreach (var pageImagePath in ExtractPdfPages("document.pdf"))
{
    using var stream = File.OpenRead(pageImagePath);
    var result = await scanApi.BarcodeScanImageAsync(stream);
    if (result.Successful == true)
    {
        Console.WriteLine($"Found: {result.RawText}");
    }
}
// Requires a separate PDF library to extract pages as images,
// then one Cloudmersive API call per extracted page image.
var scanApi = new BarcodeScanApi();
foreach (var pageImagePath in ExtractPdfPages("document.pdf"))
{
    using var stream = File.OpenRead(pageImagePath);
    var result = await scanApi.BarcodeScanImageAsync(stream);
    if (result.Successful == true)
    {
        Console.WriteLine($"Found: {result.RawText}");
    }
}
Imports System.IO
Imports Cloudmersive.APIClient.NET.BarcodeScan

' Requires a separate PDF library to extract pages as images,
' then one Cloudmersive API call per extracted page image.
Dim scanApi As New BarcodeScanApi()
For Each pageImagePath In ExtractPdfPages("document.pdf")
    Using stream As FileStream = File.OpenRead(pageImagePath)
        Dim result = Await scanApi.BarcodeScanImageAsync(stream)
        If result.Successful = True Then
            Console.WriteLine($"Found: {result.RawText}")
        End If
    End Using
Next
$vbLabelText   $csharpLabel

After (IronBarcode):

using IronBarCode;

IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";

// One call — all pages, all barcodes, no image extraction step
var results = BarcodeReader.Read("document.pdf");
foreach (var result in results)
{
    Console.WriteLine($"Page {result.PageNumber}: {result.Value}");
}
using IronBarCode;

IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";

// One call — all pages, all barcodes, no image extraction step
var results = BarcodeReader.Read("document.pdf");
foreach (var result in results)
{
    Console.WriteLine($"Page {result.PageNumber}: {result.Value}");
}
Imports IronBarCode

IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY"

' One call — all pages, all barcodes, no image extraction step
Dim results = BarcodeReader.Read("document.pdf")
For Each result In results
    Console.WriteLine($"Page {result.PageNumber}: {result.Value}")
Next
$vbLabelText   $csharpLabel

Multi-Barcode Detection

If you have code that scans documents with multiple barcodes:

Before (Cloudmersive — multiple calls required):

// Cloudmersive returns one barcode per scan — multiple calls for multiple barcodes
var scanApi = new BarcodeScanApi();
var barcodeValues = new List<string>();

foreach (var croppedRegion in CropBarcodeRegions("invoice.png"))
{
    using var stream = new MemoryStream(croppedRegion);
    var result = await scanApi.BarcodeScanImageAsync(stream);
    if (result.Successful == true)
        barcodeValues.Add(result.RawText);
}
// Cloudmersive returns one barcode per scan — multiple calls for multiple barcodes
var scanApi = new BarcodeScanApi();
var barcodeValues = new List<string>();

foreach (var croppedRegion in CropBarcodeRegions("invoice.png"))
{
    using var stream = new MemoryStream(croppedRegion);
    var result = await scanApi.BarcodeScanImageAsync(stream);
    if (result.Successful == true)
        barcodeValues.Add(result.RawText);
}
Imports System.IO
Imports System.Collections.Generic
Imports System.Threading.Tasks

' Cloudmersive returns one barcode per scan — multiple calls for multiple barcodes
Dim scanApi As New BarcodeScanApi()
Dim barcodeValues As New List(Of String)()

For Each croppedRegion In CropBarcodeRegions("invoice.png")
    Using stream As New MemoryStream(croppedRegion)
        Dim result = Await scanApi.BarcodeScanImageAsync(stream)
        If result.Successful = True Then
            barcodeValues.Add(result.RawText)
        End If
    End Using
Next
$vbLabelText   $csharpLabel

After (IronBarcode):

using IronBarCode;

IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";

var options = new BarcodeReaderOptions
{
    Speed = ReadingSpeed.Balanced,
    ExpectMultipleBarcodes = true,
};

// One call — returns all barcodes in the image
var results = BarcodeReader.Read("invoice.png", options);
var barcodeValues = results.Select(r => r.Value).ToList();
using IronBarCode;

IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";

var options = new BarcodeReaderOptions
{
    Speed = ReadingSpeed.Balanced,
    ExpectMultipleBarcodes = true,
};

// One call — returns all barcodes in the image
var results = BarcodeReader.Read("invoice.png", options);
var barcodeValues = results.Select(r => r.Value).ToList();
Imports IronBarCode

IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY"

Dim options As New BarcodeReaderOptions With {
    .Speed = ReadingSpeed.Balanced,
    .ExpectMultipleBarcodes = True
}

' One call — returns all barcodes in the image
Dim results = BarcodeReader.Read("invoice.png", options)
Dim barcodeValues = results.Select(Function(r) r.Value).ToList()
$vbLabelText   $csharpLabel

Removing Infrastructure That's No Longer Needed

This is the part of the migration where you delete more code than you write.

Remove HTTP Exception Handling

Cloudmersive operations can fail with network errors, HTTP 4xx/5xx responses, and timeout exceptions. This typically produces try/catch infrastructure that IronBarcode doesn't need:

// Remove all of this
try
{
    var result = await scanApi.BarcodeScanImageAsync(stream);
    // ...
}
catch (ApiException ex) when (ex.ErrorCode == 429)
{
    // Rate limited — wait and retry
    await Task.Delay(TimeSpan.FromSeconds(2));
    // retry logic...
}
catch (ApiException ex) when (ex.ErrorCode == 503)
{
    // Service unavailable — Cloudmersive is down
    _logger.LogError("Cloudmersive unavailable: {Message}", ex.Message);
    throw;
}
catch (HttpRequestException ex)
{
    // Network error
    _logger.LogError("Network failure: {Message}", ex.Message);
    throw;
}
catch (TaskCanceledException)
{
    // Timeout
    _logger.LogError("Cloudmersive request timed out");
    throw;
}
// Remove all of this
try
{
    var result = await scanApi.BarcodeScanImageAsync(stream);
    // ...
}
catch (ApiException ex) when (ex.ErrorCode == 429)
{
    // Rate limited — wait and retry
    await Task.Delay(TimeSpan.FromSeconds(2));
    // retry logic...
}
catch (ApiException ex) when (ex.ErrorCode == 503)
{
    // Service unavailable — Cloudmersive is down
    _logger.LogError("Cloudmersive unavailable: {Message}", ex.Message);
    throw;
}
catch (HttpRequestException ex)
{
    // Network error
    _logger.LogError("Network failure: {Message}", ex.Message);
    throw;
}
catch (TaskCanceledException)
{
    // Timeout
    _logger.LogError("Cloudmersive request timed out");
    throw;
}
Imports System
Imports System.Threading.Tasks

' Remove all of this
Try
    Dim result = Await scanApi.BarcodeScanImageAsync(stream)
    ' ...
Catch ex As ApiException When ex.ErrorCode = 429
    ' Rate limited — wait and retry
    Await Task.Delay(TimeSpan.FromSeconds(2))
    ' retry logic...
Catch ex As ApiException When ex.ErrorCode = 503
    ' Service unavailable — Cloudmersive is down
    _logger.LogError("Cloudmersive unavailable: {Message}", ex.Message)
    Throw
Catch ex As HttpRequestException
    ' Network error
    _logger.LogError("Network failure: {Message}", ex.Message)
    Throw
Catch ex As TaskCanceledException
    ' Timeout
    _logger.LogError("Cloudmersive request timed out")
    Throw
End Try
$vbLabelText   $csharpLabel

IronBarcode doesn't throw network exceptions. It throws BarcodeException if a barcode cannot be decoded from the input, which is a content issue rather than an infrastructure issue. The simplified error handling:

using IronBarCode;

var results = BarcodeReader.Read("barcode.png");
if (!results.Any())
{
    _logger.LogWarning("No barcode detected in image");
}
using IronBarCode;

var results = BarcodeReader.Read("barcode.png");
if (!results.Any())
{
    _logger.LogWarning("No barcode detected in image");
}
Imports IronBarCode

Dim results = BarcodeReader.Read("barcode.png")
If Not results.Any() Then
    _logger.LogWarning("No barcode detected in image")
End If
$vbLabelText   $csharpLabel

Remove Retry Logic

If your Cloudmersive integration includes retry policies — Polly, custom retry loops, or exponential backoff — remove them entirely:

// Remove retry infrastructure
// var retryPolicy = Policy
//     .Handle<ApiException>()
//     .WaitAndRetryAsync(3, retryAttempt =>
//         TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)));

// IronBarcode — no retry needed
var results = BarcodeReader.Read("barcode.png");
// Remove retry infrastructure
// var retryPolicy = Policy
//     .Handle<ApiException>()
//     .WaitAndRetryAsync(3, retryAttempt =>
//         TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)));

// IronBarcode — no retry needed
var results = BarcodeReader.Read("barcode.png");
' Remove retry infrastructure
' Dim retryPolicy = Policy _
'     .Handle(Of ApiException)() _
'     .WaitAndRetryAsync(3, Function(retryAttempt) _
'         TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)))

' IronBarcode — no retry needed
Dim results = BarcodeReader.Read("barcode.png")
$vbLabelText   $csharpLabel

Remove Rate Limit Tracking

If your code tracks API call counts to stay within Cloudmersive's monthly quota:

// Remove quota tracking
// private static int _monthlyCallCount = 0;
// private const int MonthlyLimit = 30000;
//
// if (Interlocked.Increment(ref _monthlyCallCount) > MonthlyLimit)
//     throw new InvalidOperationException("Monthly Cloudmersive quota exceeded");

// IronBarcode — no quota
var results = BarcodeReader.Read("barcode.png");
// Remove quota tracking
// private static int _monthlyCallCount = 0;
// private const int MonthlyLimit = 30000;
//
// if (Interlocked.Increment(ref _monthlyCallCount) > MonthlyLimit)
//     throw new InvalidOperationException("Monthly Cloudmersive quota exceeded");

// IronBarcode — no quota
var results = BarcodeReader.Read("barcode.png");
' Remove quota tracking
' Private Shared _monthlyCallCount As Integer = 0
' Private Const MonthlyLimit As Integer = 30000
'
' If Interlocked.Increment(_monthlyCallCount) > MonthlyLimit Then
'     Throw New InvalidOperationException("Monthly Cloudmersive quota exceeded")

' IronBarcode — no quota
Dim results = BarcodeReader.Read("barcode.png")
$vbLabelText   $csharpLabel

Remove Network Timeout Configuration

Cloudmersive clients often include timeout configuration. Remove it:

// Remove timeout configuration
// Configuration.Default.Timeout = 30000; // 30 second timeout
// Configuration.Default.ConnectionTimeout = 5000;

// IronBarcode has no network timeout — no network
// Remove timeout configuration
// Configuration.Default.Timeout = 30000; // 30 second timeout
// Configuration.Default.ConnectionTimeout = 5000;

// IronBarcode has no network timeout — no network
' Remove timeout configuration
' Configuration.Default.Timeout = 30000 ' 30 second timeout
' Configuration.Default.ConnectionTimeout = 5000

' IronBarcode has no network timeout — no network
$vbLabelText   $csharpLabel

Remove API Key Rotation

If your application rotates API keys on a schedule or stores them in secret management:

// Simplify this pattern
// private string GetCloudmersiveApiKey() =>
//     _secretManager.GetSecret("cloudmersive-api-key-current");
//
// Configuration.Default.ApiKey["Apikey"] = GetCloudmersiveApiKey();

// IronBarcode — set once at startup
IronBarCode.License.LicenseKey = _configuration["IronBarcode:LicenseKey"];
// or literal: "YOUR-LICENSE-KEY"
// Simplify this pattern
// private string GetCloudmersiveApiKey() =>
//     _secretManager.GetSecret("cloudmersive-api-key-current");
//
// Configuration.Default.ApiKey["Apikey"] = GetCloudmersiveApiKey();

// IronBarcode — set once at startup
IronBarCode.License.LicenseKey = _configuration["IronBarcode:LicenseKey"];
// or literal: "YOUR-LICENSE-KEY"
' Simplify this pattern
' Private Function GetCloudmersiveApiKey() As String
'     Return _secretManager.GetSecret("cloudmersive-api-key-current")
' End Function
'
' Configuration.Default.ApiKey("Apikey") = GetCloudmersiveApiKey()

' IronBarcode — set once at startup
IronBarCode.License.LicenseKey = _configuration("IronBarcode:LicenseKey")
' or literal: "YOUR-LICENSE-KEY"
$vbLabelText   $csharpLabel

Common Migration Issues

Cloudmersive Returned byte[] for Generation

Cloudmersive's generation methods return byte[] directly. IronBarcode returns a GeneratedBarcode object that gives you more options:

// Cloudmersive returned byte[] directly
byte[] cloudmersiveResult = apiInstance.GenerateBarcodeQRCode("data");

// IronBarcode — call ToPngBinaryData() for the equivalent byte[]
byte[] ironBarcodeResult = BarcodeWriter.CreateBarcode("data", BarcodeEncoding.QRCode)
    .ToPngBinaryData();

// Or save directly (often simpler)
BarcodeWriter.CreateBarcode("data", BarcodeEncoding.QRCode)
    .SaveAsPng("output.png");

// Or get other formats
byte[] jpegBytes = BarcodeWriter.CreateBarcode("data", BarcodeEncoding.QRCode)
    .ToJpegBinaryData();
// Cloudmersive returned byte[] directly
byte[] cloudmersiveResult = apiInstance.GenerateBarcodeQRCode("data");

// IronBarcode — call ToPngBinaryData() for the equivalent byte[]
byte[] ironBarcodeResult = BarcodeWriter.CreateBarcode("data", BarcodeEncoding.QRCode)
    .ToPngBinaryData();

// Or save directly (often simpler)
BarcodeWriter.CreateBarcode("data", BarcodeEncoding.QRCode)
    .SaveAsPng("output.png");

// Or get other formats
byte[] jpegBytes = BarcodeWriter.CreateBarcode("data", BarcodeEncoding.QRCode)
    .ToJpegBinaryData();
Imports Cloudmersive.APIClient
Imports IronBarCode

' Cloudmersive returned byte() directly
Dim cloudmersiveResult As Byte() = apiInstance.GenerateBarcodeQRCode("data")

' IronBarcode — call ToPngBinaryData() for the equivalent byte()
Dim ironBarcodeResult As Byte() = BarcodeWriter.CreateBarcode("data", BarcodeEncoding.QRCode) _
    .ToPngBinaryData()

' Or save directly (often simpler)
BarcodeWriter.CreateBarcode("data", BarcodeEncoding.QRCode) _
    .SaveAsPng("output.png")

' Or get other formats
Dim jpegBytes As Byte() = BarcodeWriter.CreateBarcode("data", BarcodeEncoding.QRCode) _
    .ToJpegBinaryData()
$vbLabelText   $csharpLabel

Cloudmersive Reading Returned a JSON Response Model

Cloudmersive's scan result is a response model with properties like Successful, RawText, and BarcodeType. IronBarcode returns typed result objects:

// Cloudmersive result model
if (cloudmersiveResult.Successful == true)
{
    string value = cloudmersiveResult.RawText;
    string type = cloudmersiveResult.BarcodeType;
}

// IronBarcode result — use .Value and .Format directly
var results = BarcodeReader.Read("barcode.png");
if (results.Any())
{
    string value = results.First().Value;
    string format = results.First().Format.ToString();
}
// Cloudmersive result model
if (cloudmersiveResult.Successful == true)
{
    string value = cloudmersiveResult.RawText;
    string type = cloudmersiveResult.BarcodeType;
}

// IronBarcode result — use .Value and .Format directly
var results = BarcodeReader.Read("barcode.png");
if (results.Any())
{
    string value = results.First().Value;
    string format = results.First().Format.ToString();
}
' Cloudmersive result model
If cloudmersiveResult.Successful = True Then
    Dim value As String = cloudmersiveResult.RawText
    Dim type As String = cloudmersiveResult.BarcodeType
End If

' IronBarcode result — use .Value and .Format directly
Dim results = BarcodeReader.Read("barcode.png")
If results.Any() Then
    Dim value As String = results.First().Value
    Dim format As String = results.First().Format.ToString()
End If
$vbLabelText   $csharpLabel

Multiple Cloudmersive API Instance Types

Cloudmersive separates generation and scanning into GenerateBarcodeApi and BarcodeScanApi instances. IronBarcode uses static classes — no instances needed:

// Cloudmersive — two separate API instances
var generateApi = new GenerateBarcodeApi();
var scanApi = new BarcodeScanApi();

// IronBarcode — static, no instances
// BarcodeWriter for generation
// BarcodeReader for reading
// QRCodeWriter for QR codes specifically
// Cloudmersive — two separate API instances
var generateApi = new GenerateBarcodeApi();
var scanApi = new BarcodeScanApi();

// IronBarcode — static, no instances
// BarcodeWriter for generation
// BarcodeReader for reading
// QRCodeWriter for QR codes specifically
' Cloudmersive — two separate API instances
Dim generateApi As New GenerateBarcodeApi()
Dim scanApi As New BarcodeScanApi()

' IronBarcode — static, no instances
' BarcodeWriter for generation
' BarcodeReader for reading
' QRCodeWriter for QR codes specifically
$vbLabelText   $csharpLabel

Migration Checklist

Run these searches in your codebase before and after migration to verify you've caught every Cloudmersive reference:

# Find all Cloudmersive references
grep -r "Cloudmersive" --include="*.cs" .
grep -r "GenerateBarcodeApi" --include="*.cs" .
grep -r "BarcodeScanApi" --include="*.cs" .
grep -r "Configuration.Default.ApiKey" --include="*.cs" .
grep -r '"Apikey"' --include="*.cs" .
grep -r "GenerateBarcodeQRCode" --include="*.cs" .
grep -r "GenerateBarcodeCode128" --include="*.cs" .
grep -r "BarcodeScanImage" --include="*.cs" .
grep -r "cloudmersive" --include="*.csproj" .
grep -r "cloudmersive" --include="*.json" .
# Find all Cloudmersive references
grep -r "Cloudmersive" --include="*.cs" .
grep -r "GenerateBarcodeApi" --include="*.cs" .
grep -r "BarcodeScanApi" --include="*.cs" .
grep -r "Configuration.Default.ApiKey" --include="*.cs" .
grep -r '"Apikey"' --include="*.cs" .
grep -r "GenerateBarcodeQRCode" --include="*.cs" .
grep -r "GenerateBarcodeCode128" --include="*.cs" .
grep -r "BarcodeScanImage" --include="*.cs" .
grep -r "cloudmersive" --include="*.csproj" .
grep -r "cloudmersive" --include="*.json" .
SHELL

After migration, all searches should return zero results. Then verify IronBarcode is correctly referenced:

grep -r "IronBarCode" --include="*.cs" .
grep -r "BarcodeReader" --include="*.cs" .
grep -r "BarcodeWriter" --include="*.cs" .
grep -r "IronBarCode" --include="*.cs" .
grep -r "BarcodeReader" --include="*.cs" .
grep -r "BarcodeWriter" --include="*.cs" .
SHELL

Configuration Checklist

  • Remove Cloudmersive.APIClient.NET.Barcode from all .csproj files
  • Remove Cloudmersive API key from appsettings.json, environment variables, and secret stores
  • Add IronBarcode NuGet package
  • Add IronBarCode.License.LicenseKey initialization at application startup
  • Remove retry policies and circuit breakers for Cloudmersive calls
  • Remove rate limit tracking code
  • Remove network timeout configuration

Testing Checklist

After completing the migration:

  • Verify QR code generation produces valid, scannable output
  • Verify Code128 and other linear barcode generation
  • Verify barcode reading from common image formats (PNG, JPEG, BMP)
  • Test PDF reading if you process PDF documents
  • Test multi-barcode detection if applicable
  • Confirm no Cloudmersive API calls appear in network traffic
  • Confirm the application runs correctly with no internet connection

What You Gain After Migration

Beyond cost savings, the migration removes an entire class of operational concerns:

No more network-dependent barcode processing. Your document processing pipeline runs regardless of Cloudmersive's availability, your internet connection quality, or network latency spikes.

No more quota management. Month-end spikes in document volume don't create surprise overages or processing failures.

No more data leaving your network. Barcode images containing sensitive customer, financial, or health information stay on your infrastructure.

Simpler code. The retry infrastructure, timeout handling, and HTTP exception management that production Cloudmersive integrations require is gone. What replaces it is a direct method call.

The migration is mechanical. The benefits are structural — eliminating the dependency on an external network service from a workflow that doesn't need one.

Frequently Asked Questions

Why should I migrate from Cloudmersive Barcode API to IronBarcode?

Common reasons include simplifying licensing (removing SDK + runtime key complexity), eliminating throughput limits, gaining native PDF support, improving Docker/CI/CD deployment, and reducing API boilerplate in production code.

How do I replace Cloudmersive API calls with IronBarcode?

Replace instance creation and licensing boilerplate with IronBarCode.License.LicenseKey = "key". Replace reader calls with BarcodeReader.Read(path) and writer calls with BarcodeWriter.CreateBarcode(data, encoding). Static methods require no instance management.

How much code changes when migrating from Cloudmersive Barcode API to IronBarcode?

Most migrations result in fewer lines of code. Licensing boilerplate, instance constructors, and explicit format configuration are removed. Core read/write operations map to shorter IronBarcode equivalents with cleaner result objects.

Do I need to keep both Cloudmersive Barcode API and IronBarcode installed during migration?

No. Most migrations are direct replacements rather than parallel operation. Migrate one service class at a time, replace the NuGet reference, and update the instantiation and API call patterns before moving to the next class.

What is the NuGet package name for IronBarcode?

The package is 'IronBarCode' (with capital B and C). Install it with 'Install-Package IronBarCode' or 'dotnet add package IronBarCode'. The using directive in code is 'using IronBarCode;'.

How does IronBarcode simplify Docker deployment compared to Cloudmersive Barcode API?

IronBarcode is a NuGet package with no external SDK files or mounted license configuration. In Docker, set the IRONBARCODE_LICENSE_KEY environment variable and the package handles license validation at startup.

Does IronBarcode detect all barcode formats automatically after migrating from Cloudmersive?

Yes. IronBarcode auto-detects symbology across all supported formats. Explicit BarcodeTypes enumeration is not required. If format is already known and performance matters, BarcodeReaderOptions allows restricting the search space as an optimization.

Can IronBarcode read barcodes from PDFs without a separate library?

Yes. BarcodeReader.Read("document.pdf") processes PDF files natively. Results include PageNumber, Format, Value, and Confidence for each barcode found. No external PDF rendering step is required.

How does IronBarcode handle parallel barcode processing?

IronBarcode's static methods are stateless and thread-safe. Use Parallel.ForEach directly over file lists without per-thread instance management. BarcodeReaderOptions.MaxParallelThreads controls the internal thread budget.

What result properties change when migrating from Cloudmersive Barcode API to IronBarcode?

Common renames: BarcodeValue becomes Value, BarcodeType becomes Format. IronBarcode results also add Confidence and PageNumber. A solution-wide search-and-replace handles the renames in existing result-processing code.

How do I set up IronBarcode licensing in a CI/CD pipeline?

Store IRONBARCODE_LICENSE_KEY as a pipeline secret and assign IronBarCode.License.LicenseKey in application startup code. One secret covers all environments including development, test, staging, and production.

Does IronBarcode support QR code generation with custom styling?

Yes. QRCodeWriter.CreateQrCode() supports custom colors via ChangeBarCodeColor(), logo embedding via AddBrandLogo(), configurable error correction levels, and multiple output formats including PNG, JPG, PDF, and stream.

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