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

IronBarcode和Dynamsoft條碼閱讀器之間的比較

條碼到底是什麼? 條碼是一種由一系列平行的黑線和不同比例白色空格組成的方形或矩形圖片,可以被掃描器讀取。 產品上貼有條碼以便於識別。它們被用於各種地方,包括零售商店以方便購物過程、倉庫以管理庫存,並在賬單中幫助會計計算。

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

  • IronBarcode
  • Dynamsoft Barcode Reader SDK

2. IronBarcode

IronBarcode是一個用於讀取和建立條碼的.NET程式庫。 IronBarcode,一個流行的.NET條碼程式庫,可以建立多種型別的1和2維條碼,以及客製化(彩色和品牌化)的QR碼。 IronBarcode允許程式員使用任何.NET語言。

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

2.1. IronBarcode功能

2.1.1. 條碼格式

  • 2維矩陣條碼格式包括QR碼、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 Static Class API將條碼和QR碼讀取簡化為一行程式碼。
  • 支援從文件中的Jpeg、Jpeg2000、Png、BMP、多頁Tiff和Gif圖像格式讀取條碼。
  • 提升準確性和性能。 為了提高準確性和性能,告訴讀取器掃描一個、幾個或所有條碼格式。
  • 圖像校正以讀取條碼。 為了解釋錯誤的掃描和圖像,對文件應用噪音和對比度調整。

2.1.3. 條碼寫入功能

  • 使用QRCodeWriter靜態類建立容錯條碼及QR寫入API。 條碼資料通常可以只需要兩行程式碼就被提取。
  • IronBarcode允許使用者匯出為圖像,匯出到HTML頁面,並匯出到PDF或新增到現有PDF中。
  • QRCodeWriter類提供了對使用高級功能渲染QR碼的高級支持。

3. Dynamsoft條碼讀取SDK

開發人員使用Dynamsoft條碼讀取器迅速將1D和2D條碼掃描整合到運行於多種平台的程式中。 除了掃描線性條碼以外,它還可以作為強大的QR碼讀取器或2D成像器使用。

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

  • 掃描手機上的影片廣播。
  • 使用高解析度的工業相机掃描靜態圖像。
  • 自動桌面服務掃描大型照片和PDF文件。

3.1. Dynamsoft條碼讀取功能

3.1.1. 條碼讀取功能性

  • 多執行緒條碼處理
  • 可以在單個圖片中讀取多個條碼。
  • 條碼在任何方向和旋轉角度被檢測。
  • 解碼模糊的、失焦的照片中的條碼。
  • 使用預處理,從低品質照片中讀取條碼。

3.1.2. 定制化和靈活性

在預設掃描設置下,這個SDK在許多典型情況下表現良好,但為了獲得最適合您獨特業務需求的性能,這個SDK是完全可調整的,可以專門為您優化性能。 從龐大的參數列表中選擇,每個參數都包含多種模式。 一種模式是條碼閱讀器可以執行的特定功能,每個模式都可以包含多個參數,這些參數可以用以進一步微調或個性化應用。

3.1.3. 使用圖像處理

Dynamsoft條碼讀取SDK包含其他任何條碼SDK中都沒有的功能。 開發人員可以使用它從解碼過程中獲取多個資料點。 這些"中間圖像結果"包含資料,進階使用者可以利用這些資料提高效率或產生其他工作流程中新應用。 在解碼條碼過程中生成了多種不同型別的中間圖像輸出。

3.1.4. 從圖像和PDF解碼條碼

  • 圖像文件型別包括BMP、jpg、png、gif和Tiff。
  • 單頁和多頁PDF。
  • 從相机或掃描器派生的DIB(裝置獨立位元圖)格式。
  • 圖像的base64字串編碼。
  • 圖像文件流的原始緩衝。

3.1.5. 支援的條碼型別

Dynamsoft條碼讀取SDK是一個可靠的條碼掃描軟體,提供各類條碼的讀取功能。

  • 線性條碼(1D)
  • 2D條碼
  • GS1合成碼
  • 補丁碼
  • 顯影藥碼
  • GS1 DataBar
  • 郵政編碼

4. 在Visual Studio中建立新專案

打開Visual Studio軟體並轉到文件選單。 選擇"新專案",然後選擇控制台應用程式。

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

Onbarcode Generator Alternatives 1 related to 4. 在Visual Studio中建立新專案

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

Onbarcode Generator Alternatives 2 related to 4. 在Visual Studio中建立新專案

現在我們可以新增程式庫並測試程式。

5. 安裝IronBarcode程式庫

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

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

5.1 使用Visual Studio NuGet套件管理器

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

Onbarcode Generator Alternatives 3 related to 5.1 使用Visual Studio NuGet套件管理器

它提供搜索框來顯示來自NuGet網站的可用套件程式庫列表。在套件管理器中,我們需要搜索關鍵字"IronBarcode",如以下截圖所示:

Onbarcode Generator Alternatives 4 related to 5.1 使用Visual Studio NuGet套件管理器

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

5.2使用Visual Studio命令行

在Visual Studio選單中,轉到Tools-> NuGet套件管理器-> 套件管理器控制台。

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

Install-Package BarCode

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

Onbarcode Generator Alternatives 5 related to 5.2使用Visual Studio命令行
Onbarcode Generator Alternatives 6 related to 5.2使用Visual Studio命令行

5.3從NuGet網站直接下載

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

  • 縱覽IronOCR NuGet套件頁面
  • 從右側選單選擇下載套件選項。
  • 雙擊下載的套件。 它將自動安裝。
  • 現在重新載入解決方案並開始在項目中使用。

5.4從IronBarcode網站直接下載

從IronBarcode網站下載最新的IronBarcode套件。下載後,按照下面的步驟將套件新增到項目中。

  • 從解決方案窗口中右擊專案。
  • 然後,選擇參考選項並瀏覽下載參考的位置。
  • 再點擊OK以新增參考。

6. 安裝Dynamsoft條碼讀取器

Dynamsoft條碼讀取SDK可以通過四種不同的方式下載和安裝。 這些是:

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

6.1 使用Visual Studio NuGet套件管理器

Dynamsoft條碼讀取器使開發人員能夠輕鬆地使用Visual Studio NuGet套件管理器將其工具整合到.NET項目中。 按照以下步驟操作:

Dynamsoft Barcode Reader Alternatives 1 related to 6.1 使用Visual Studio NuGet套件管理器

它提供搜索框來顯示從NuGet網站提供的可用套件程式庫列表。在套件管理器中,我們需要搜索關鍵字"Dynamsoft",如下圖所示:

Dynamsoft Barcode Reader Alternatives 2 related to 6.1 使用Visual Studio NuGet套件管理器

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

6.2 使用Visual Studio命令行

在Visual Studio選單中,轉到Tools-> NuGet套件管理器-> 套件管理器控制台

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

Install-Package Dynamsoft.DotNet.Barcode

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

Dynamsoft Barcode Reader Alternatives 3 related to 6.2 使用Visual Studio命令行
Dynamsoft Barcode Reader Alternatives 4 related to 6.2 使用Visual Studio命令行

6.3 從NuGet網站直接下載

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

6.4 從Dynamsoft網站直接下載

從網頁直接下載最新的套件。 下載後,按照下面的步驟將套件新增到項目中。

  • 從解決方案窗口中右擊專案。
  • 然後,選擇選項參考並瀏覽下載參考的位置。
  • 接下來,點擊OK以新增參考。

7. 讀取條碼

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

7.1 使用IronBarcode讀取條碼

條碼讀取器是一個讀取條碼的腳本。 IronBarcode命名空間的QuicklyReadOneBarcode功能是用於在.NET框架中讀取條碼的絕佳工具。 我們可以通過選擇條碼編碼方案大大提高速度,我們可以通過將True強制其自動調整視角和數位噪音。

QuicklyReadAllBarcodes方法類似,但它能夠掃描多條碼以支持如PDF和多頁TIFF的多頁文件。

using IronBarCode;
using System;
using System.Drawing;

class Program
{
    static void Main(string[] args)
    {
        // Read a single barcode from an image file
        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;

            // Output the barcode value to the console
            Console.WriteLine("Barcode Value: " + value);
        }
        else
        {
            // Output message when no barcode is found
            Console.WriteLine("No barcode detected.");
        }
    }
}
using IronBarCode;
using System;
using System.Drawing;

class Program
{
    static void Main(string[] args)
    {
        // Read a single barcode from an image file
        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;

            // Output the barcode value to the console
            Console.WriteLine("Barcode Value: " + value);
        }
        else
        {
            // Output message when no barcode is found
            Console.WriteLine("No barcode detected.");
        }
    }
}
Imports IronBarCode
Imports System
Imports System.Drawing

Friend Class Program
	Shared Sub Main(ByVal args() As String)
		' Read a single barcode from an image file
		Dim 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

			' Output the barcode value to the console
			Console.WriteLine("Barcode Value: " & value)
		Else
			' Output message when no barcode is found
			Console.WriteLine("No barcode detected.")
		End If
	End Sub
End Class
$vbLabelText   $csharpLabel

7.2 使用Dynamsoft條碼讀取

Dynamsoft條碼讀取器提供強大的QR碼和條碼讀取功能,使用程式碼簡單。 在此我們將討論從圖像文件讀取條碼並輸出條碼格式和文字的最簡單方法。

using System;
using Dynamsoft;
using Dynamsoft.DBR;

namespace HelloWorld
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                // 1. Initialize license. Replace the license key below with your own.
                EnumErrorCode errorCode = BarcodeReader.InitLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9", out string errorMsg);
                if (errorCode != EnumErrorCode.DBR_SUCCESS)
                {
                    Console.WriteLine("License Error: " + errorMsg);
                    return;
                }

                // 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("Barcode Reader Error: " + exp.Message);
                }
            }
            catch (Exception exp)
            {
                Console.WriteLine("Error: " + exp.Message);
            }
            finally
            {
                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. Replace the license key below with your own.
                EnumErrorCode errorCode = BarcodeReader.InitLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9", out string errorMsg);
                if (errorCode != EnumErrorCode.DBR_SUCCESS)
                {
                    Console.WriteLine("License Error: " + errorMsg);
                    return;
                }

                // 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("Barcode Reader Error: " + exp.Message);
                }
            }
            catch (Exception exp)
            {
                Console.WriteLine("Error: " + exp.Message);
            }
            finally
            {
                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. Replace the license key below with your own.
				Dim errorMsg As String
				Dim errorCode As EnumErrorCode = BarcodeReader.InitLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9", errorMsg)
				If errorCode <> EnumErrorCode.DBR_SUCCESS Then
					Console.WriteLine("License Error: " & errorMsg)
					Return
				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("Barcode Reader Error: " & exp.Message)
				End Try
			Catch exp As Exception
				Console.WriteLine("Error: " & exp.Message)
			Finally
				Console.WriteLine("Press any key to quit...")
				Console.ReadKey()
			End Try
		End Sub
	End Class
End Namespace
$vbLabelText   $csharpLabel

8. 授權

IronBarcode是一個提供開發人員免費授權的程式庫。 IronBarcode還具有不同的定價結構:Lite套餐從$liteLicense開始,沒有隱藏費用。 SaaS和OEM產品的再分發也是可能的。 所有授權都有30天退款保證、一年軟體支援和升級、開發/測試/生產的有效性,以及永久性授權(一次性購買)。 IronBarcode還提供免費版本。 查看IronBarcode的完整定價結構和授權選項

Dynamsoft條碼讀取器提供基於年度的授權,具有固定費用結構。 Dynamsoft的授權基於年間訂閱,而不是按每次掃描或每個客戶端的使用次數。 定價自大約$1,371每年開始,具體視授權型別和版本而定,經由授權經銷商如ComponentSource和官方供應商定價認證。

Dynamsoft條碼讀取器提供優秀的授權和支援選項,鼓勵開發人員選擇Dynamsoft條碼讀取SDK。

9. 結論

IronBarcode是一個領先的.NET條碼程式庫,它讓程式員能夠讀取和建立條碼。 它支持多種型別的1和2維條碼,以及客製化(彩色和品牌化)的QR碼。 IronBarcode允許開發者使用所有.NET相關語言。 IronBarcode提供優化的高性能條碼讀取和生成能力,適用於.NET環境。 它使用一種獨特的算法,能夠輕鬆掃描皺褶的QR碼,擁有卓越的條碼識別準確性。 它還提供一個強大的QR碼讀取器,只需幾行程式碼即可讀取任何型別的條碼和QR碼。 IronBarcode非常擅長從模糊的圖片中讀取條碼,並提供終身技術支持。

當同時掃描多個條碼時,Dynamsoft條碼讀取SDK在競爭中也有一定優勢。 它有不同的使用場景,如用於安卓手機應用程式、Linux桌面、Linux手機應用和iPhone手機應用的條碼讀取功能,還支持多個瀏覽器。 它也可以幫助掃描低質量的圖像條碼。 它在您的網頁、桌面或手機應用程式中,以嵌入條碼讀取功能,只需幾行程式碼即可。 Dynamsoft條碼讀取器滿足開發人員對自定義掃描器解析度設置的需求,提供及時和有幫助的回應,並實現1D和2D解碼條碼。 只要授權有效,Dynamsoft條碼讀取器支援團隊會一直在場。 它還使用內嵌條碼讀取功能,高精度掃描低質量圖片。

與Dynamsoft授權選項相比,IronBarcode定價結構相對較低,可能是Dynamsoft條碼讀取器較不受使用者歡迎的原因之一。 Dynamsoft的收費結構基於年度訂閱,且定價為固定費用,具體取決於授權型別。 而IronBarcode則提供一次性購買,無持續費用,而Dynamsoft條碼讀取器的定價基於年度訂閱。

在比較IronBarcode和Dynamsoft條碼讀取器之後,我們可以得出結論,IronBarcode提供了額外功能,不僅在條碼讀取方面,還在條碼生成功能方面,並且價格更低。Dynamsoft條碼讀取器在讀取方面提供更多,而IronBarcode提供所有類別的條碼相關服務。 對於.NET程式設計,IronBarcode僅需幾行程式碼即可提供所有功能,而其競爭對手卻未能提供。在這一切之上,Iron Software目前提供其所有五種軟體工具,僅需兩種的價格。 這些工具如下:

請存取此連結探索Iron Suite

請注意Dynamsoft條碼讀取SDK是其相應所有者的註冊商標。 這個網站和Dynamsoft條碼讀取SDK沒有聯繫、授權或贊助。 所有產品名稱、標誌和品牌均為其各自所有者的財產。 比較僅供資訊參考,並反映了撰寫時公開可用的資訊。

常見問題

如何在C#應用程式中建立和讀取條碼?

您可以在C#應用程式中使用IronBarcode來建立和讀取各種型別的條碼,包括一維和二維條碼。該程式庫支持與.NET平臺的輕鬆整合,並提供匯出和匯入條碼資料的方法。

IronBarcode相較於Dynamsoft對於.NET開發人員來說是一個更好的選擇是什麼?

IronBarcode提供更廣泛的功能,如條碼生成和讀取,且成本較低,提供一次性購買選項。此外,它支持多個.NET平臺,使之對開發人員而言非常靈活。

IronBarcode如何處理條碼生成和讀取?

IronBarcode允許開發人員使用簡單的GenerateBarcodeReadBarcode方法來建立和讀取條碼。它支持不同的圖像格式,並提供條碼設計的自訂選項。

對於C#開發人員而言,有沒有成本效益的Dynamsoft條碼讀取器替代方案?

有,IronBarcode是一個具成本效益的替代方案,為C#開發人員提供豐富的條碼處理功能,其成本比Dynamsoft的使用量定價模型更低。

IronBarcode有哪些安裝方法可以使用?

IronBarcode可以通過Visual Studio的NuGet套件管理器安裝,也可以使用Visual Studio命令列,或者從IronBarcode網站直接下載。

IronBarcode支持哪些平臺?

IronBarcode支持多個.NET平臺,包括.NET Core、.NET Framework和Azure,使其可以適應各種C#開發環境。

IronBarcode能否處理低質量圖像掃描?

可以,IronBarcode專為從各種圖像質量中讀取條碼而設計,包括低質量圖像,確保在不同條件下的穩健性能。

使用IronBarcode進行條碼掃描有哪些好處?

IronBarcode提供高精度和高性能的條碼掃描,支持多種條碼格式,並能使用簡單的程式碼片段輕鬆整合到.NET專案中。

Curtis Chau
技術作家

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

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

Iron 支援團隊

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