與其他組件比較

IronBarcode與Dynamsoft Barcode Reader的比較

發佈 2022年5月27日
分享:

1. 簡介

條碼到底是什麼?條碼是一種由一系列平行的黑線和不同長度的白色空間組成的方形或矩形圖像,可以被掃描器讀取。產品貼上條碼是為了讓它們更容易識別。條碼被應用在各種場所,包括零售店以輔助購物過程,在倉庫中管理庫存,以及在票據上用於輔助會計。

您可以使用 .NET 平台來讀取和生成條碼嗎?是的,您可以使用 .NET 框架來創建和掃描條碼。在本文中,我們將探討開發者如何在 .NET 語言環境中生成和掃描條碼。我們將討論並比較兩個開發者用來處理條碼的軟件程序。這些是您需要的工具:

  • IronBarcode
  • Dynamsoft Barcode Reader SDK

2. IronBarcode

IronBarcode 是一個用於讀取和創建條形碼的 .NET 庫。IronBarcode 是一個受歡迎的 .NET 條形碼庫,它能夠創建多種類型的一維和二維條形碼,以及自定義條形碼。 (彩色和品牌) QR碼。IronBarcode允許程式設計師使用任何 .NET 語言。

IronBarcode相容於 .NET Core 2x 和 3x、.NET Standard、.NET Framework 4x 和Azure。它生成PostScript輸出並使用多種標準代碼轉換文本字串。

2.1. IronBarcode 特性

2.1.1. 條碼格式

  • 二維矩陣條碼格式包括 QR Code、Aztec 和 Data Matrix .NET 讀取和創建。
  • 現代線性條碼格式支持文本、數字和二進制數據,包括 PDF417、Code 39、Code 128 條碼生成器用於 C#。
  • 舊式線性條碼格式僅支持數字代碼,包括 UPC-A、UPC-E、EAN-8、EAN-13、Codabar、ITF、MSI 和 Plessey。

2.1.2. 條碼辨識功能

  • IronBarcode.BarcodeReader 靜態類別 API 將條碼和 QR 碼的讀取簡化為一行代碼。
  • 支援從文件中讀取 Jpeg、Jpeg2000、Png、BMP、多頁 Tiff 和 Gif 圖像格式的條碼。
  • 更高的準確度和性能。為了提高準確度和性能,可以告訴讀取器掃描一種、幾種或所有條碼格式。
  • 影像校正以讀取條碼。為了解讀不良的掃描和影像,可以對文件應用噪音和對比度調整。

2.1.3. 條碼寫入功能

  • BarcodeWriterQRCodeWriter 靜態類別用於創建容錯的條碼和 QR 寫入 API。條碼數據通常可以用兩行代碼提取。
  • IronBarcode 允許用戶導出為圖片、導出到 HTML 頁面、導出為 PDF 或添加到現有的 PDF。
  • 類別 QRCodeWriter 提供了先進的支援,用於使用高級功能渲染 QR 碼。

3. Dynamsoft 條碼識別 SDK

開發人員使用 Dynamsoft 條碼識別器快速將 1D 和 2D 條碼掃描集成到他們在各種平台上運行的程序中。除了掃描線性條碼外,它還可作為強大的 QR 碼識別器或 2D 掃描器使用。

Dynamsoft 提供的條碼掃描 SDK 是業界最好的。它可以輕鬆應對多種情況,包括:

  • 掃描手機上的視頻廣播。
  • 掃描來自工業相機的高解析度靜態圖像。
  • 自動桌面服務,掃描大型圖像和 PDF 文件。

3.1. Dynasoft 條碼讀取器功能

3.1.1. 條碼讀取功能

  • 在多個線程中處理條碼
  • 可以在單張圖片中讀取多個條碼
  • 條碼可在任何方向和旋轉角度下檢測到
  • 從模糊、不對焦的照片中解碼條碼
  • 通過預處理從低質量照片中讀取條碼

3.1.2. 自訂化與靈活性

有了預設掃描設定,這個SDK在很多典型情況下運行良好,但為了讓您的獨特業務需求獲得最佳效能,這個SDK完全可調整,以便為您優化效能。從大量的參數中進行選擇,每個參數都包含多種模式。模式是一個條碼閱讀器可以執行的特定功能,每個模式可以包含多個參數,以便進一步微調或個性化應用程式。

3.1.3. 使用圖像處理

Dynamsoft Barcode Reader SDK 包含其他條碼 SDK 沒有的功能。開發人員可以使用它從解碼過程中獲取多個數據點。這些「中間圖像結果」包含的數據可供高級用戶用來提高效率,或用於在其他工作流程中生成新應用。在解碼條碼的過程中,會生成多種不同類型的中間圖像輸出。

3.1.4. 從圖像和PDF解碼條碼

  • 圖像文件類型包括 BMP、jpg、png、gif 和 Tiff。
  • 單頁和多頁PDF。
  • DIB (設備無關位圖) 來自相機或掃描儀的格式。
  • 圖像的 base64 字串編碼。
  • 圖像檔案流的原始緩衝區。

3.1.5. 支援的條碼類型

Dynamsoft 條碼讀取 SDK 是一款可靠的條碼掃描軟體,能夠為各種條碼提供讀取功能。

  • 線性條碼 (1D)
  • 2D條碼
  • GS1複合碼
  • 補丁碼
  • 藥碼
  • GS1資料條形碼
  • 郵政編碼

4. 在 Visual Studio 中創建一個新專案

打開 Visual Studio 軟體並進入檔案選單。選擇“新專案”,然後選擇控制台應用程式。

輸入專案名稱並在相應的文字框中選擇路徑。然後,點擊“建立”按鈕。選擇所需的 .NET 框架,如下圖所示:

Visual Studio 專案現在將為所選應用程式生成結構,如果您選擇了控制台、Windows 和 Web 應用程式,它將打開 program.cs 檔案,您可以在其中輸入程式碼並建構/運行應用程式。

現在我們可以添加庫並測試程序。

5. 安裝 IronBarcode 庫

IronBarcode 庫可以透過四種不同的方式下載和安裝。這些方式是:

  • 使用 Visual Studio NuGet 套件管理器
  • 使用 Visual Studio 命令行
  • 從 NuGet 網頁直接下載
  • 從 IronBarcode 網頁直接下載

5.1 使用 Visual Studio NuGet 套件管理器

Visual Studio 軟體提供 NuGet 套件管理器選項,可以將套件直接安裝到解決方案中。以下螢幕截圖顯示了如何打開 NuGet 套件管理器。

它提供了搜尋框以顯示來自 NuGet 網站的可用套件庫清單。在套件管理器中,我們需要搜尋關鍵字 "IronBarCode",如下圖所示:

從上面的圖片中,我們可以看到搜索列表中的相關套件列表。我們需要選擇 IronBarcode 選項並將該套件安裝到我們的解決方案中。

5.2 使用 Visual Studio 命令列

在 Visual Studio 選單中,前往工具 -> NuGet 套件管理員 -> 套件管理員主控台。

在套件管理主控台標籤中輸入以下行:

Install-Package BarCode

現在套件將下載/安裝到當前專案並準備好使用。

5.3 從NuGet網站直接下載

第三種方法是直接從網站下載套件。

  • 導航到 鏈接.
  • 從右側菜單中選擇下載包選項。
  • 雙擊下載的包。它將自動安裝。
  • 現在重新加載解決方案並開始在項目中使用它。

5.4 從IronBarcode網站直接下載

點擊 連結 從網站下載最新的軟件包。下載完成後,請按照以下步驟將軟件包添加到項目中。

  • 從解決方案窗口中右鍵點擊項目。
  • 然後,選擇引用選項並瀏覽已下載的引用位置。
  • 然後,點擊確定來添加引用。

6. 安裝 Dynamsoft 條碼讀取器

IronBarcode 庫可以通過四種不同的方式下載和安裝。這些方式分別是:

  • 使用 Visual Studio NuGet 套件管理器
  • 使用 Visual Studio 命令行
  • 從 NuGet 網頁直接下載
  • 從 Dynamsoft 網頁直接下載

6.1 使用 Visual Studio NuGet Package Manager

Dynamsoft 條碼讀取器使開發人員能夠輕鬆地使用 Visual Studio NuGet Package Manager 將其工具與 .NET 專案整合。請按照以下步驟操作:

它提供了一個搜索框來顯示來自NuGet網站的可用軟體包庫列表。在軟體包管理器中,我們需要搜索關鍵詞「Dynamsoft」,如下圖所示:

在上圖中,我們可以看到搜索結果中的相關套件列表。我們需要選擇 Dynamsoft 選項並將套件安裝到我們的解決方案中。

6.2 使用 Visual Studio 命令行

在 Visual Studio 菜单中,依次点击 工具 -> NuGet 套件管理器 -> 套件管理器控制台

在套件管理器控制台选项卡中输入以下代码:

Install-Package Dynamsoft.DotNet.Barcode

該套件現在將下載/安裝到當前項目並準備使用。

6.3 從NuGet網站直接下載

第三種方法是直接從網頁下載NuGet套件。

6.4 從 Dynamsoft 官方網站直接下載

點擊 連結 在此從網頁直接下載最新套件。下載後,請按照以下步驟將套件添加到項目中。

  • 右鍵點擊方案窗口中的項目。
  • 然後,選擇選項 "參考" 並瀏覽已下載參考的位置。
  • 接著,點擊確定以添加參考。

7. 條碼讀取

讀取條碼以獲取內嵌資訊是非常有用的。在本節中,我們將討論這些工具如何讀取不同的條碼。

7.1. 使用 IronBarcode 讀取條碼

條碼讀取器是一個讀取條碼的腳本。IronBarcode 命名空間的 QuicklyReadOneBarcode 函數是 .NET 框架中一個出色的條碼讀取工具。我們可以通過選擇條碼編碼方案顯著提高速度,並且通過將 TryHarder 選項設置為 True,使其自動調整視角和數碼噪聲。

QuicklyReadAllBarcodes 技術類似,但它可以掃描多個條碼,適用於像 PDF 和多頁 TIFF 這樣的多頁面文件。

using IronBarCode;
using System;
using System.Drawing;
BarcodeResult QRResult = BarcodeReader.QuicklyReadOneBarcode("QR.png");
if (QRResult != null)
{
    string Value = QRResult.Value;
    Bitmap Img = QRResult.BarcodeImage;
    BarcodeEncoding BarcodeType = QRResult.BarcodeType;
    byte [] Binary = QRResult.BinaryValue;
    Console.WriteLine(QRResult.Value);
}
using IronBarCode;
using System;
using System.Drawing;
BarcodeResult QRResult = BarcodeReader.QuicklyReadOneBarcode("QR.png");
if (QRResult != null)
{
    string Value = QRResult.Value;
    Bitmap Img = QRResult.BarcodeImage;
    BarcodeEncoding BarcodeType = QRResult.BarcodeType;
    byte [] Binary = QRResult.BinaryValue;
    Console.WriteLine(QRResult.Value);
}
Imports IronBarCode
Imports System
Imports System.Drawing
Private QRResult As BarcodeResult = BarcodeReader.QuicklyReadOneBarcode("QR.png")
If QRResult IsNot Nothing Then
	Dim Value As String = QRResult.Value
	Dim Img As Bitmap = QRResult.BarcodeImage
	Dim BarcodeType As BarcodeEncoding = QRResult.BarcodeType
	Dim Binary() As Byte = QRResult.BinaryValue
	Console.WriteLine(QRResult.Value)
End If
VB   C#

7.2. 使用 Dynamsoft Barcode 讀取條碼

Dynamsoft 條碼讀取器提供了強大的 QR 碼讀取及條碼讀取功能,並且編碼簡單。在這裡,我們將討論從影像檔讀取條碼並輸出條碼格式及文本的最簡單方法。

using System;
using Dynamsoft;
using Dynamsoft.DBR;

namespace HelloWorld
{
    class Program
    {
        static void Main(string [] args)
        {
            try
            {
                // 1.Initialize license.
                EnumErrorCode errorCode = BarcodeReader.InitLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9", out string errorMsg);
                if (errorCode != EnumErrorCode.DBR_SUCCESS)
                {
                    Console.WriteLine(errorMsg);
                }

                // 2. Create an instance of Barcode Reader
                BarcodeReader dbr = new BarcodeReader();

                try
                {
                    TextResult [] results = null;

                    // 3. Read barcode from an image file
                    results = dbr.DecodeFile("../../../../images/AllSupportedBarcodeTypes.png", "");

                    if (results != null && results.Length > 0)
                    {
                        for (int i = 0; i < results.Length; ++i)
                        {
                            Console.WriteLine("Result " + (i + 1).ToString() + ":");

                            // 4. Get format of each barcode
                            if (results [i].BarcodeFormat != EnumBarcodeFormat.BF_NULL)
                                Console.WriteLine("    Barcode Format: " + results [i].BarcodeFormatString);
                            else
                                Console.WriteLine("    Barcode Format: " + results [i].BarcodeFormatString_2);

                            // 5. Get text result of each barcode
                            Console.WriteLine("    Barcode Text: " + results [i].BarcodeText);
                        }
                    }
                    else
                    {
                        Console.WriteLine("No barcode detected.");
                    }
                }
                catch (BarcodeReaderException exp)
                {
                    Console.WriteLine(exp.Message);
                }
            }
            catch (Exception exp)
            {
                Console.WriteLine(exp.Message);
            }
            Console.WriteLine("Press any key to quit...");
            Console.ReadKey();
        }
    }
}
using System;
using Dynamsoft;
using Dynamsoft.DBR;

namespace HelloWorld
{
    class Program
    {
        static void Main(string [] args)
        {
            try
            {
                // 1.Initialize license.
                EnumErrorCode errorCode = BarcodeReader.InitLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9", out string errorMsg);
                if (errorCode != EnumErrorCode.DBR_SUCCESS)
                {
                    Console.WriteLine(errorMsg);
                }

                // 2. Create an instance of Barcode Reader
                BarcodeReader dbr = new BarcodeReader();

                try
                {
                    TextResult [] results = null;

                    // 3. Read barcode from an image file
                    results = dbr.DecodeFile("../../../../images/AllSupportedBarcodeTypes.png", "");

                    if (results != null && results.Length > 0)
                    {
                        for (int i = 0; i < results.Length; ++i)
                        {
                            Console.WriteLine("Result " + (i + 1).ToString() + ":");

                            // 4. Get format of each barcode
                            if (results [i].BarcodeFormat != EnumBarcodeFormat.BF_NULL)
                                Console.WriteLine("    Barcode Format: " + results [i].BarcodeFormatString);
                            else
                                Console.WriteLine("    Barcode Format: " + results [i].BarcodeFormatString_2);

                            // 5. Get text result of each barcode
                            Console.WriteLine("    Barcode Text: " + results [i].BarcodeText);
                        }
                    }
                    else
                    {
                        Console.WriteLine("No barcode detected.");
                    }
                }
                catch (BarcodeReaderException exp)
                {
                    Console.WriteLine(exp.Message);
                }
            }
            catch (Exception exp)
            {
                Console.WriteLine(exp.Message);
            }
            Console.WriteLine("Press any key to quit...");
            Console.ReadKey();
        }
    }
}
Imports System
Imports Dynamsoft
Imports Dynamsoft.DBR

Namespace HelloWorld
	Friend Class Program
		Shared Sub Main(ByVal args() As String)
			Try
				' 1.Initialize license.
				Dim errorMsg As String
				Dim errorCode As EnumErrorCode = BarcodeReader.InitLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9", errorMsg)
				If errorCode <> EnumErrorCode.DBR_SUCCESS Then
					Console.WriteLine(errorMsg)
				End If

				' 2. Create an instance of Barcode Reader
				Dim dbr As New BarcodeReader()

				Try
					Dim results() As TextResult = Nothing

					' 3. Read barcode from an image file
					results = dbr.DecodeFile("../../../../images/AllSupportedBarcodeTypes.png", "")

					If results IsNot Nothing AndAlso results.Length > 0 Then
						For i As Integer = 0 To results.Length - 1
							Console.WriteLine("Result " & (i + 1).ToString() & ":")

							' 4. Get format of each barcode
							If results (i).BarcodeFormat <> EnumBarcodeFormat.BF_NULL Then
								Console.WriteLine("    Barcode Format: " & results (i).BarcodeFormatString)
							Else
								Console.WriteLine("    Barcode Format: " & results (i).BarcodeFormatString_2)
							End If

							' 5. Get text result of each barcode
							Console.WriteLine("    Barcode Text: " & results (i).BarcodeText)
						Next i
					Else
						Console.WriteLine("No barcode detected.")
					End If
				Catch exp As BarcodeReaderException
					Console.WriteLine(exp.Message)
				End Try
			Catch exp As Exception
				Console.WriteLine(exp.Message)
			End Try
			Console.WriteLine("Press any key to quit...")
			Console.ReadKey()
		End Sub
	End Class
End Namespace
VB   C#

8. 授權

IronBarcode 是一個提供開發者免費授權的庫。IronBarcode 也有一個獨特的定價結構:Lite 授權包起價為 $749,沒有隱藏費用。還可以重新分發 SaaS 和 OEM 產品。所有授權均有30天退款保證、一年的軟體支援和升級、開發/測試/生產環境的有效性,並且是永久授權。 (一次性購買)IronBarcode 也提供免費版本。要查看 IronBarcode 的完整價格結構和許可證,請點擊 這裡

Dynamsoft 条码阅读器根据“每条码读取”和“每活跃浏览器客户端”提供灵活的许可选项。Dynamsoft 条码阅读器的价格如下:

每次条码扫描

  • 统计 SDK 一年内成功扫描的条码总数,并相应收费。
  • 10,000 次条码扫描包的费用为 $1,249/年。
  • 50,000 次条码扫描包的费用为 $2,999/年。
  • 100,000 次条码扫描包的费用为 $4,999/年。

每个活跃浏览器客户端

  • 统计访问条码扫描功能的唯一浏览器客户端总数,并相应收费。
  • 15 个浏览器客户端包的费用为 $1,249/年。
  • 50 个浏览器客户端包的费用为 $2,999/年。
  • 100 个浏览器客户端包的费用为 $4,999/年。

Dynamsoft 条码阅读器提供完善的许可和支持选项,以鼓励开发人员选择 Dynamsoft 条码阅读器 SDK。

9. 結論

IronBarcode 是一個領先的 .NET 條碼庫,讓程式設計師可以讀取和創建條碼。它支持廣泛的 1 維和 2 維條碼,以及定制的條碼。 (彩色和品牌) QR碼。IronBarcode允許開發人員使用所有.NET相關語言。IronBarcode比任何其他C#條碼讀取器和生成器都快。它採用獨特的演算法,可以輕鬆掃描皺褶的QR碼,並具有卓越的條碼識別精度。它還提供強大的QR碼讀取器,只需幾行程式碼即可讀取任何類型的條碼和QR碼。IronBarcode在從模糊圖像中讀取條碼方面表現出色,並提供技術支援以提供終身協助。

Dynamsoft條碼讀取SDK在一次掃描多個條碼方面也具有競爭優勢。它有不同的使用場景,例如用於Android移動應用程序、Linux桌面、Linux移動應用程序和iPhone移動應用程序的條碼讀取功能,以及支援多個瀏覽器。它還幫助掃描低質量圖像的條碼。它提供嵌入式條碼讀取功能,僅需幾行程式碼即可在您的網頁、桌面或移動應用程序中使用。Dynamsoft條碼讀取器滿足開發人員對自定義掃描器解析度設置的需求,提供及時且有幫助的回應,並實現1D和2D解碼條碼。只要許可證有效,Dynamsoft條碼讀取器支援團隊隨時可用。它還能通過嵌入式條碼讀取功能高精度地掃描低質量圖像。

相比之下,IronBarcode的價格結構相對較低,而Dynamsoft的許可選項通常較高,這可能是Dynamsoft條碼讀取器對用戶吸引力較低的原因之一。Dynamsoft的收費結構是基於計數的,這意味著它取決於跨不同平台(如Windows桌面和Mac桌面)掃描的條碼數量。而IronBarcode則提供一次性購買,無需持續付款,而Dynamsoft條碼讀取器的價格基於每年購買。

在比較了IronBarcode和Dynamsoft條碼讀取器之後,我們可以得出結論,IronBarcode不僅在條碼讀取方面提供額外功能,還提供條碼生成的功能,而且價格更低。Dynamsoft條碼讀取器在讀取方面提供更多功能,而IronBarcode則提供所有類型與條碼相關的服務。對於.NET編程,IronBarcode只需幾行程式碼即可提供所有功能,而其競爭對手無法提供這一點。最重要的是,Iron Software目前提供其五款軟體的價格僅相當於兩個的價格。這些工具如下:

  • IronBarcode
  • IronXL
  • IronOCR
  • IronPDF
  • IronWebScraper

請訪問此連結了解更多信息 IronSuite.

< 上一頁
IronBarcode 和 OnBarcode 之間的比較

準備開始了嗎? 版本: 2024.10 剛剛發布

免費 NuGet 下載 總下載次數: 1,203,227 查看許可證 >