跳至頁尾內容
與其他組件的比較

Barcoder 與 IronBarcode:C# 條碼庫對比

Cloudmersive Barcode API v.s. IronBarcode:雲端REST vs 本地.NET

每日處理10,000個條碼——這是發票處理、運輸標籤驗證或文件接收中的現實數字——Cloudmersive Barcode API需要更高級的訂閱層級,而且每個條碼會增加150–400毫秒的網路往返時間。每個文件、每張圖片、每段條碼資料都會離開您的網路,並傳輸到Cloudmersive的伺服器。

這就是Cloudmersive模型的基本陳述。 對於在專案中段遇到的團隊——在整合已經完成之後,在API金鑰已經連接之後——這三個事實往往同時降臨,成為一個不舒服的驚喜。本比較旨在使它們在進行整合之前變得清晰明瞭。

了解Cloudmersive Barcode API

Cloudmersive提供一個涵蓋文件轉換、OCR、圖像處理和條碼操作的REST API集合。 條碼功能是更廣泛API組合中的一部分。 對於.NET開發者,Cloudmersive提供了一個包裝其REST端點的NuGet客戶端套件:

// NuGet: dotnet add package Cloudmersive.APIClient.NET.Barcode
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();

// Each call issues an HTTPS request to Cloudmersive's servers
byte[] result = apiInstance.GenerateBarcodeQRCode("https://example.com");
// NuGet: dotnet add package Cloudmersive.APIClient.NET.Barcode
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();

// Each call issues an HTTPS request to Cloudmersive's servers
byte[] result = apiInstance.GenerateBarcodeQRCode("https://example.com");
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()

' Each call issues an HTTPS request to Cloudmersive's servers
Dim result As Byte() = apiInstance.GenerateBarcodeQRCode("https://example.com")
$vbLabelText   $csharpLabel

對於此程式碼,重要的是要了解它實際上在做什麼:它向Cloudmersive的基礎架構發送HTTPS請求,等待回應,然後返回結果。 在Cloudmersive整合中的每一行條碼工作都遵循這一模式。 沒有本地處理。 沒有離線通道。 每個操作都依賴於有效的網際網路連接和可用的Cloudmersive伺服器。

HTTP客戶端模式

Cloudmersive的.NET SDK是一個生成的API客戶端。 在底層,它是HttpClient進行REST調用。 影響因此而來:

  • 網路延遲是不可避免且不可忽略的(每次調用150–400毫秒)
  • 您的資料在每個操作中往返於外部伺服器
  • API層內強制實施速率限制
  • API金鑰到期,必須輪換
  • Cloudmersive中斷會完全停止您的條碼處理
  • 生產穩定性需要重試邏輯、超時處理和斷路器

對於文件處理管線中的條碼掃描——在這裡您可能每小時處理數百個文件——這些都不是理論上的顧慮。

大規模成本

Cloudmersive使用逐請求收費模式。 請求的確切成本取決於您的訂閱層級,但每個層級的基本模型相同:每次條碼操作都會消耗您每月配額的請求。

將通用生產量映射到Cloudmersive公佈的層級中:

日量 月量 Cloudmersive層級 年成本 IronBarcode
100/天 ~3,000/月 基本($19.99/月) ~$240/年 $749一次性
1,000/天 ~30,000/月 商務($49.99/月) ~$600/年 $749一次性
10,000/天 ~300,000/月 中型商務($499.99/月) ~$6,000/年 $749一次性
50,000/天 ~1,500,000/月 Enterprise(自定義) 自定義 $749一次性
100,000/天 ~3,000,000/月 Enterprise(自定義) 自定義 $749一次性

IronBarcode的永久授權費用為$749(Lite,單開發者),涵蓋無限條碼操作。 任何量級的請求都無需額外收費。 如果一個團隊每天處理10,000個條碼,則在頭六週內,他們在Cloudmersive上年度所花費的費用就能抵銷掉授權成本。

對於三開發者團隊,$1,499的一次性Plus授權與每天10,000個條碼的$6,000每年相比。 IronBarcode的授權費用在三個月的Cloudmersive節省就回本了。

擴展臨界點

逐請求收費隨著使用量的增長會創造一個特定問題:成本隨著量的增長而線性擴展。 如果您的文件處理流水線從每月2,000封增長到20,000封,您的Cloudmersive賬單會增長十倍。 您的工程成本不會增長——相同的程式處理更多的文件——但您的API賬單會。

IronBarcode沒有這個特性。 處理多達十倍的條碼不會增加額外成本。

延遲影響

每個Cloudmersive條碼操作涉及:

  1. 序列化請求(圖像字節或條碼資料)
  2. 建立或重用HTTPS連接
  3. 將資料傳輸到Cloudmersive伺服器
  4. 等待伺服器端處理
  5. 接收回應
  6. 反序列化結果

Cloudmersive公佈的指南和客戶報告將每次調用延遲設定在大約150–400毫秒,具體取決於伺服器負載、地理位置和圖像大小。每次調用250毫秒時:

體量 總網路開銷
10個條碼 2.5秒
100個條碼 25秒
1,000個條碼 4.2分鐘
10,000個條碼 41.7分鐘
100,000個條碼 ~7小時

對於使用者端端點——使用者上傳圖像並期望一個結果的網頁表單——單次條碼掃描的250毫秒延遲可能可以接受。 對於背景文件處理作業,累積的延遲成為工作流程的主要成本。

IronBarcode的本地處理在典型硬體上每個條碼運行10到50毫秒。 對於10,000個條碼,這大約需要8分鐘的總時間,相較於Cloudmersive模型中的41分鐘的網路開銷。

ASP.NET Core中的延遲

對於必須滿足響應時間服務級別協議的網頁API端點,Cloudmersive的延遲是一個固定的底線。 一個讀取條碼並返回數值的端點不能比100毫秒更快地響應,不論伺服器硬體如何,因為到外部API的最小往返時間由網路物理決定。

IronBarcode在本地處理。 延遲底線由您的硬體和圖像複雜性決定。

資料主權

每個Cloudmersive條碼操作都會向Cloudmersive的伺服器傳輸資料。 對於條碼讀取,這意味著您的圖像——可能包含患者識別碼、財務帳號、運送地址、員工ID或專有庫存資料——會離開您的網路。

遵從性影響取決於您的監管環境:

法規 Cloudmersive模型 IronBarcode
HIPAA 條碼圖像中的PHI需要與Cloudmersive簽署BAA;資料離開網路 所有處理均在本地——無需BAA
GDPR 個人資料傳輸到美國伺服器; 需要充分性評估 未進行資料傳輸——GDPR簡化
ITAR 與防務相關的技術資料不能傳輸到外部服務 完全本地——設計上遵從ITAR
CMMC 受控未分類資訊不能在外部網路傳輸 無外部網路調用
FedRAMP 美國政府資料需要FedRAMP認可的雲服務 不適用——本地處理
PCI DSS 條碼中的持卡人資料需要對外部傳輸的特殊處理 資料從不離開您的環境
氣隙網路 不可能——需要網際網路連接 完全支援——無需網路連接
內部資料政策 許多組織禁止將操作資料傳送到第三方API 無第三方傳輸

對於醫療保健、國防、金融服務或政府工作負載,Cloudmersive的雲模型經常在任何功能或成本評估開始之前就被淘汰掉了。資料離開您的網路——那是決定性的事實。

IronBarcode在本地處理所有內容。 條碼圖像從不離開主機。沒有任何型別的資料傳輸。

可靠性

Cloudmersive是一個外部依賴。 您的應用程式的條碼處理可靠性受限於Cloudmersive的正常運行時間。

中斷時發生了什麼

當Cloudmersive發生服務中斷時:

  • 條碼讀取操作失敗或超時
  • 條碼生成請求返回錯誤
  • 文件處理管線停止
  • 您已實施的任何重試邏輯開始消耗計算資源以等待恢復

如果您的條碼處理位於關鍵路徑上——訂單接收系統、收貨流程、患者註冊表單——Cloudmersive的中斷就是您應用程式的中斷。

速率限制

Cloudmersive在每個價格層級上實施速率限制。 在免費層級上,公佈的速率限制是每秒一個調用,這有效地串行化了並行文件處理。 超出您的每月配額將導致操作失敗或排隊。

使用Cloudmersive的生產程式碼必須處理:

using Cloudmersive.APIClient.NET.Barcode.Api;
using Cloudmersive.APIClient.NET.Barcode.Client;
using System;
using System.Threading;
using System.Threading.Tasks;

public class CloudmersiveBarcodeService
{
    private readonly BarcodeScanApi _scanApi;
    private static int _requestCount = 0;

    public CloudmersiveBarcodeService()
    {
        Configuration.Default.ApiKey.Add("Apikey", "YOUR-CLOUDMERSIVE-API-KEY");
        _scanApi = new BarcodeScanApi();
    }

    public async Task<string> ScanWithRetry(byte[] imageBytes, int maxRetries = 3)
    {
        for (int attempt = 1; attempt <= maxRetries; attempt++)
        {
            try
            {
                Interlocked.Increment(ref _requestCount);

                using var stream = new System.IO.MemoryStream(imageBytes);
                var result = await _scanApi.BarcodeScanImageAsync(stream);

                if (result.Successful == true)
                    return result.RawText;

                throw new InvalidOperationException("Scan unsuccessful");
            }
            catch (ApiException ex) when (ex.ErrorCode == 429)
            {
                if (attempt < maxRetries)
                    await Task.Delay(TimeSpan.FromSeconds(Math.Pow(2, attempt)));
                else
                    throw;
            }
            catch (Exception) when (attempt < maxRetries)
            {
                await Task.Delay(TimeSpan.FromMilliseconds(500 * attempt));
            }
        }
        throw new InvalidOperationException("All retry attempts failed");
    }
}
using Cloudmersive.APIClient.NET.Barcode.Api;
using Cloudmersive.APIClient.NET.Barcode.Client;
using System;
using System.Threading;
using System.Threading.Tasks;

public class CloudmersiveBarcodeService
{
    private readonly BarcodeScanApi _scanApi;
    private static int _requestCount = 0;

    public CloudmersiveBarcodeService()
    {
        Configuration.Default.ApiKey.Add("Apikey", "YOUR-CLOUDMERSIVE-API-KEY");
        _scanApi = new BarcodeScanApi();
    }

    public async Task<string> ScanWithRetry(byte[] imageBytes, int maxRetries = 3)
    {
        for (int attempt = 1; attempt <= maxRetries; attempt++)
        {
            try
            {
                Interlocked.Increment(ref _requestCount);

                using var stream = new System.IO.MemoryStream(imageBytes);
                var result = await _scanApi.BarcodeScanImageAsync(stream);

                if (result.Successful == true)
                    return result.RawText;

                throw new InvalidOperationException("Scan unsuccessful");
            }
            catch (ApiException ex) when (ex.ErrorCode == 429)
            {
                if (attempt < maxRetries)
                    await Task.Delay(TimeSpan.FromSeconds(Math.Pow(2, attempt)));
                else
                    throw;
            }
            catch (Exception) when (attempt < maxRetries)
            {
                await Task.Delay(TimeSpan.FromMilliseconds(500 * attempt));
            }
        }
        throw new InvalidOperationException("All retry attempts failed");
    }
}
Imports Cloudmersive.APIClient.NET.Barcode.Api
Imports Cloudmersive.APIClient.NET.Barcode.Client
Imports System
Imports System.Threading
Imports System.Threading.Tasks

Public Class CloudmersiveBarcodeService
    Private ReadOnly _scanApi As BarcodeScanApi
    Private Shared _requestCount As Integer = 0

    Public Sub New()
        Configuration.Default.ApiKey.Add("Apikey", "YOUR-CLOUDMERSIVE-API-KEY")
        _scanApi = New BarcodeScanApi()
    End Sub

    Public Async Function ScanWithRetry(imageBytes As Byte(), Optional maxRetries As Integer = 3) As Task(Of String)
        For attempt As Integer = 1 To maxRetries
            Try
                Interlocked.Increment(_requestCount)

                Using stream As New System.IO.MemoryStream(imageBytes)
                    Dim result = Await _scanApi.BarcodeScanImageAsync(stream)

                    If result.Successful = True Then
                        Return result.RawText
                    End If

                    Throw New InvalidOperationException("Scan unsuccessful")
                End Using
            Catch ex As ApiException When ex.ErrorCode = 429
                If attempt < maxRetries Then
                    Await Task.Delay(TimeSpan.FromSeconds(Math.Pow(2, attempt)))
                Else
                    Throw
                End If
            Catch ex As Exception When attempt < maxRetries
                Await Task.Delay(TimeSpan.FromMilliseconds(500 * attempt))
            End Try
        Next
        Throw New InvalidOperationException("All retry attempts failed")
    End Function
End Class
$vbLabelText   $csharpLabel

IronBarcode不需要這些。 沒有速率限制,沒有API金鑰,沒有重試基礎架構,沒有配額追蹤:

// NuGet: dotnet add package IronBarcode
using IronBarCode;

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

// Generate locally
BarcodeWriter.CreateBarcode("https://example.com", BarcodeEncoding.QRCode)
    .SaveAsPng("qr.png");

// Read locally
var result = BarcodeReader.Read("barcode.png").First();
Console.WriteLine(result.Value);
// NuGet: dotnet add package IronBarcode
using IronBarCode;

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

// Generate locally
BarcodeWriter.CreateBarcode("https://example.com", BarcodeEncoding.QRCode)
    .SaveAsPng("qr.png");

// Read locally
var result = BarcodeReader.Read("barcode.png").First();
Console.WriteLine(result.Value);
Imports IronBarCode

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

' Generate locally
BarcodeWriter.CreateBarcode("https://example.com", BarcodeEncoding.QRCode) _
    .SaveAsPng("qr.png")

' Read locally
Dim result = BarcodeReader.Read("barcode.png").First()
Console.WriteLine(result.Value)
$vbLabelText   $csharpLabel

無重試邏輯。 無速率限制處理。 無HTTP異常處理。 無配額管理。

理解IronBarcode

IronBarcode是一個完整的.NET本地程式庫,在主機上完全處理條碼。它支援讀寫超過50種條碼格式,原生處理PDF,運行於從.NET Framework 4.6.2到.NET 9的每個.NET平台上。

主要特徵:

  • 完全本地處理:在任何條碼操作中沒有網路調用
  • 無逐請求成本:一個授權覆蓋無限條碼操作
  • 無速率限制:以您的硬體支援處理任意多的條碼
  • 運行時無外部依賴:不需要網際網路連接
  • 原生PDF支援:讀取PDF中的條碼無需先提取圖像
  • 完整讀取和寫入:生成所有主要格式的條碼,從圖像、PDF和流中讀取
// NuGet: dotnet add package IronBarcode
using IronBarCode;

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

// QR code generation
QRCodeWriter.CreateQrCode("https://example.com", 500)
    .SaveAsPng("qr.png");

// QR code with brand logo
QRCodeWriter.CreateQrCode("https://example.com", 500)
    .AddBrandLogo("logo.png")
    .SaveAsPng("branded-qr.png");

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

// Get bytes for embedding in document or API response
byte[] bytes = BarcodeWriter.CreateBarcode("data", BarcodeEncoding.Code128)
    .ToPngBinaryData();

// Read from image
var results = BarcodeReader.Read("barcode.png");
foreach (var r in results)
{
    Console.WriteLine($"{r.Format}: {r.Value}");
}

// Read from PDF — native, no image extraction step
var pdfResults = BarcodeReader.Read("invoices.pdf");
foreach (var r in pdfResults)
{
    Console.WriteLine($"Page {r.PageNumber}: {r.Value}");
}

// Multi-barcode detection
var options = new BarcodeReaderOptions
{
    Speed = ReadingSpeed.Balanced,
    ExpectMultipleBarcodes = true,
};
var multiResults = BarcodeReader.Read("manifest.png", options);
// NuGet: dotnet add package IronBarcode
using IronBarCode;

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

// QR code generation
QRCodeWriter.CreateQrCode("https://example.com", 500)
    .SaveAsPng("qr.png");

// QR code with brand logo
QRCodeWriter.CreateQrCode("https://example.com", 500)
    .AddBrandLogo("logo.png")
    .SaveAsPng("branded-qr.png");

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

// Get bytes for embedding in document or API response
byte[] bytes = BarcodeWriter.CreateBarcode("data", BarcodeEncoding.Code128)
    .ToPngBinaryData();

// Read from image
var results = BarcodeReader.Read("barcode.png");
foreach (var r in results)
{
    Console.WriteLine($"{r.Format}: {r.Value}");
}

// Read from PDF — native, no image extraction step
var pdfResults = BarcodeReader.Read("invoices.pdf");
foreach (var r in pdfResults)
{
    Console.WriteLine($"Page {r.PageNumber}: {r.Value}");
}

// Multi-barcode detection
var options = new BarcodeReaderOptions
{
    Speed = ReadingSpeed.Balanced,
    ExpectMultipleBarcodes = true,
};
var multiResults = BarcodeReader.Read("manifest.png", options);
Imports IronBarCode

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

' QR code generation
QRCodeWriter.CreateQrCode("https://example.com", 500).SaveAsPng("qr.png")

' QR code with brand logo
QRCodeWriter.CreateQrCode("https://example.com", 500) _
    .AddBrandLogo("logo.png") _
    .SaveAsPng("branded-qr.png")

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

' Get bytes for embedding in document or API response
Dim bytes As Byte() = BarcodeWriter.CreateBarcode("data", BarcodeEncoding.Code128) _
    .ToPngBinaryData()

' Read from image
Dim results = BarcodeReader.Read("barcode.png")
For Each r In results
    Console.WriteLine($"{r.Format}: {r.Value}")
Next

' Read from PDF — native, no image extraction step
Dim pdfResults = BarcodeReader.Read("invoices.pdf")
For Each r In pdfResults
    Console.WriteLine($"Page {r.PageNumber}: {r.Value}")
Next

' Multi-barcode detection
Dim options As New BarcodeReaderOptions With {
    .Speed = ReadingSpeed.Balanced,
    .ExpectMultipleBarcodes = True
}
Dim multiResults = BarcodeReader.Read("manifest.png", options)
$vbLabelText   $csharpLabel

特性比較

特性 Cloudmersive Barcode API IronBarcode
處理位置 Cloudmersive伺服器 本地——僅您的機器
需要網際網路 是——每個操作
資料傳輸 所有圖像/資料發送到Cloudmersive None
每操作延遲 150–400毫秒(網路) 10–50毫秒(本地)
成本模型 逐請求,每月配額 一次性永久授權
10,000個條碼/天成本 ~$6,000/年(中型商務層級) $749一次性付費
速率限制 是——並發和每月 None
離線/氣隙 不可能 完全支援
HIPAA 需要BAA; 資料離開網路 僅本地——無需BAA
GDPR 資料傳輸到美國伺服器 未有資料傳輸
ITAR / CMMC 外部傳輸被禁止 設計上的遵從
中斷影響 您的處理停止 無外部依賴
條碼生成
條碼讀取
原生PDF支援 否——需單獨提取圖像 是——直接PDF閱讀
多條碼偵測 單結果BarcodeScanResult每次調用 是——ExpectMultipleBarcodes = true
損壞條碼修復 伺服器端解碼器 機械學習支持,ReadingSpeed.ExtremeDetail
支援格式 六種1D/2D格式生成; 更廣泛的讀取範圍 50餘種格式
重試/錯誤處理 生產程式碼中必需 不需要
.NET Framework支援 .NET Framework和.NET Core(通過REST客戶端) .NET Framework 4.6.2+至.NET 9
Docker / Linux 通過HTTP客戶端 原生的
Azure功能 通過HTTP客戶端 原生的

API對映參考

Cloudmersive IronBarcode
Configuration.Default.ApiKey.Add("Apikey", "key") IronBarCode.License.LicenseKey = "key"
new GenerateBarcodeApi() 靜態——無需實例
new BarcodeScanApi() 靜態——無需實例
apiInstance.GenerateBarcodeQRCode(value) BarcodeWriter.CreateBarcode(value, BarcodeEncoding.QRCode).ToPngBinaryData()
apiInstance.GenerateBarcodeCode128(value) BarcodeWriter.CreateBarcode(value, BarcodeEncoding.Code128).ToPngBinaryData()
apiInstance.GenerateBarcodeEAN13(value) BarcodeWriter.CreateBarcode(value, BarcodeEncoding.EAN13).ToPngBinaryData()
scanApi.BarcodeScanImage(imageFile) BarcodeReader.Read(imageBytes)
result.RawText result.Value
result.BarcodeType result.Format
result.Successful == true 結果集合非空
HTTPS至Cloudmersive伺服器 本地處理——無網路需求
150–400毫秒延遲 本地10–50毫秒
每月配額消耗 無限——無配額
需要API金鑰輪換 一次性授權金鑰
需要重試邏輯 不需要

當團隊轉換

從Cloudmersive轉換到IronBarcode的觸發幾乎總是以下四種情況之一:

遵從性要求:安全審查、客戶合同或法規審核識別出含有敏感資料條碼圖像離開了網路。 HIPAA、GDPR或ITAR遵從性要求本地處理。 不論成本或便利,Cloudmersive整合必須替換。

大規模的成本驚訝:該項目伊始,Cloudmersive的免費或低成本層級覆蓋使用。 隨著應用獲得使用者或文件處理流水線增長,每月賬單按比例增加。 在某個時候——通常是每月100到200美元——團隊計算了IronBarcode永久授權的收支平衡數學,並決定遷移。

氣隙環境:應用需要在沒有網際網路接入的環境中運行——如工廠車間、政府設施、受網路限制的醫療場所。 Cloudmersive在這些環境中不可能實現。 IronBarcode在沒有任何網路連接下運行。

延遲在SLA中:服務級別協議要求的響應時間是Cloudmersive的網路開銷使得不可能保證。 IronBarcode的本地處理使得條碼操作在SLA覆蓋範圍內。

文件處理流水線範例

一個現實的企業場景:應付賬款團隊每天處理2,000張發票。 每張發票都是一個PDF,其中包含一個或多個用於PO號、供應商程式碼和分項引用的條碼。

Cloudmersive方法:

  • 2,000張發票×平均3個條碼=每天6,000個API調用
  • 每次調用250毫秒:每天25分鐘的網路等待時間
  • 每月:~180,000請求→顯著的訂閱層級
  • 年成本:約$2,000–$4,000
  • 風險:如果Cloudmersive不可用,處理會停止
  • 依從性:應付賬款發票可能包含外部傳輸的賬號

IronBarcode方法:

using IronBarCode;

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

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

string[] invoicePaths = Directory.GetFiles("invoices", "*.pdf");

foreach (var invoicePath in invoicePaths)
{
    // One call per invoice processes all pages and all barcodes
    var barcodes = BarcodeReader.Read(invoicePath, options);

    foreach (var barcode in barcodes)
    {
        Console.WriteLine($"Invoice: {invoicePath} | Page: {barcode.PageNumber} | {barcode.Format}: {barcode.Value}");
    }
}
using IronBarCode;

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

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

string[] invoicePaths = Directory.GetFiles("invoices", "*.pdf");

foreach (var invoicePath in invoicePaths)
{
    // One call per invoice processes all pages and all barcodes
    var barcodes = BarcodeReader.Read(invoicePath, options);

    foreach (var barcode in barcodes)
    {
        Console.WriteLine($"Invoice: {invoicePath} | Page: {barcode.PageNumber} | {barcode.Format}: {barcode.Value}");
    }
}
Imports IronBarCode

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

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

Dim invoicePaths As String() = Directory.GetFiles("invoices", "*.pdf")

For Each invoicePath In invoicePaths
    ' One call per invoice processes all pages and all barcodes
    Dim barcodes = BarcodeReader.Read(invoicePath, options)

    For Each barcode In barcodes
        Console.WriteLine($"Invoice: {invoicePath} | Page: {barcode.PageNumber} | {barcode.Format}: {barcode.Value}")
    Next
Next
$vbLabelText   $csharpLabel
  • 2,000張發票在本地處理於幾分鐘內,而不是25分鐘的網路開銷
  • 年成本:$749一次性付費(一名開發者)
  • 風險:無外部依賴
  • 遵從性:發票資料從不離開網路

結論

Cloudmersive Barcode API是一個雲端REST服務。其價格隨您的使用量而變化。 其延遲由網際網路決定。 其可用性取決於Cloudmersive的基礎架構。 您的資料在每次條碼操作中都會到達外部伺服器。

這些是雲API模型的結構屬性,而不是對Cloudmersive的具體抱怨。 該模型在低量原型或這些屬性無關痛癢的應用中運行良好。 隨著量的增長和需求的變緊,價格會變高、速度會變慢、並且可能不符合規範。

IronBarcode的$749一次性授權涵蓋無限的條碼操作,本地運行且無資料傳輸,自然處理PDF,並且不需要Cloudmersive整合要求的重試基礎架構。 對於每天10,000個條碼,IronBarcode在前兩個月的數學計算中勝出。

常見問題

什麼是Cloudmersive Barcode API?

Cloudmersive Barcode API是一個.NET條碼程式庫,用於在C#應用程式中生成和讀取條碼。它是開發人員在選擇.NET專案條碼解決方案時評估的幾個替代方案之一。

Cloudmersive Barcode API和IronBarcode的主要區別是什麼?

IronBarcode使用靜態、無狀態API,不需要實例管理,而Cloudmersive Barcode API通常需要在使用前建立和配置實例。IronBarcode還提供原生PDF支持、自動格式檢測以及跨所有環境的單鍵授權。

IronBarcode是否比Cloudmersive Barcode API更易於授權?

IronBarcode使用一個覆蓋開發和生產部署的單一授權金鑰。相比於將SDK金鑰與運行時金鑰分開的授權系統,這簡化了CI/CD管道和Docker配置。

IronBarcode是否支持Cloudmersive Barcode API支持的所有條碼格式?

IronBarcode支持超過30種條碼符號,包括QR Code、Code 128、Code 39、DataMatrix、PDF417、Aztec、EAN-13、UPC-A、GS1等。格式自動檢測意味著不需要顯式的格式枚舉。

IronBarcode支持原生PDF條碼讀取嗎?

是的。IronBarcode可以直接從PDF文件中讀取條碼,使用BarcodeReader.Read("document.pdf"),無需單獨的PDF渲染程式庫。每頁結果包括頁碼、條碼格式、值和置信分數。

IronBarcode如何處理批次處理與Cloudmersive Barcode API相比?

IronBarcode的靜態方法無狀態且天然執行緒安全,可以直接使用Parallel.ForEach而無需每個執行緒的實例管理。任何價格級別下都沒有吞吐量上限。

IronBarcode支持哪些.NET版本?

IronBarcode支持.NET Framework 4.6.2+、.NET Core 3.1,以及.NET 5、6、7、8和9,單一NuGet包。平台目標包括Windows x64/x86、Linux x64和macOS x64/ARM。

如何在.NET專案中安裝IronBarcode?

通過NuGet安裝IronBarcode:在Package Manager Console中運行 'Install-Package IronBarCode',或在CLI中運行 'dotnet add package IronBarCode'。不需要額外的SDK安裝程式或運行時文件。

我可以在購買之前評估IronBarcode,不像Cloudmersive嗎?

可以。IronBarcode的試用模式返回完整解碼的條碼值——只有生成的輸出圖像上有水印。您可以在自己的文件上評估讀取準確性,然後再決定購買。

Cloudmersive Barcode API和IronBarcode之間的價格差異是什麼?

IronBarcode起價為$749,為單開發者所適用的永久授權,覆蓋開發和生產。價格詳情和批量選項可在IronBarcode授權頁面獲得。無需單獨的運行時授權。

從Cloudmersive Barcode API遷移到IronBarcode是否直接?

從Cloudmersive Barcode API遷移到IronBarcode主要涉及將基於實例的API呼叫替換為IronBarcode的靜態方法,去除授權樣板,並更新結果屬性名稱。大多數遷移涉及減少程式碼而不是新增它。

IronBarcode可以生成帶有Logo的QR碼嗎?

可以。QRCodeWriter.CreateQrCode().AddBrandLogo("logo.png") 可以原生嵌入品牌圖像進QR碼,並可配置錯誤更正。也支持通過ChangeBarCodeColor() 生成彩色QR碼。

Curtis Chau
技術作家

Curtis Chau擁有Carleton大學的電腦科學學士學位,專精於前端開發,擁有Node.js、TypeScript、JavaScript和React的專業知識。Curtis熱衷於建立直觀且美觀的使用者介面,喜愛使用現代框架並建立結構良好、視覺吸引力的手冊。

除了開發,Curtis對物聯網(IoT)有濃厚的興趣,探索創新的方法來整合硬體和軟體。在空閒時間,他喜歡玩遊戲和建立Discord機器人,結合他對技術的熱愛與創造力。

Iron 支援團隊

我們線上24小時,每週5天。
聊天
電子郵件
給我打電話