与其他组件比较

IronBarcode和ZXing.NET的比较

乔尔迪·巴尔迪亚
乔尔迪·巴尔迪亚
2022年十二月12日
分享:

BarCode 扫描仪不一定总是适合我们的应用。 您可能已经有了条形码的数字图像,想知道它在英文文本中代表什么。 此外,这款扫描仪只能读取一维 BarCode,其中包含的数据量有限,只能在 Windows RT 类库中使用。 二维条码(也称为二维码)现在很常见,并且可以容纳更多信息。

使用简单的 API 调用和几个编码步骤,就可以创建一个基于 C# 的应用程序来读取 BarCode。 支持 .NET 的应用程序可在 Windows、macOS 或 Linux 上运行,无需依赖任何第三方工具或 API。

本文将比较两个功能最强大的 .NET Core 应用程序库,以便以编程方式读取 BarCode。 这两个库是 IronBarcode 和 ZXing.NET。 我们将看到 IronBarcode for .NET 比 ZXing.NET 更强大、更稳健的地方。


什么是 ZXing.NET

ZXing.NET 是一个用于解码和生成条形码的库(例如 QR Code, PDF 417, EAN, UPC, Aztec, Data Matrix, Codabar)。 ZXing 是 "斑马线 "的缩写,是一个基于 Java 的开源库,支持多种一维和二维条形码格式。

其基本特征如下:

  • 它能够存储 URL、联系方式、日历事件等内容
  • 它是为 Java SE 应用程序量身定制的
  • 它允许通过意图集成 BarCode 扫描仪
  • 这是一个简单明了的谷歌眼镜应用程序

什么是 IronBarcode?

IronBarcode 是一个 C# 库,允许程序员读取和生成条形码。 作为领先的条码库,IronBarcode 支持多种一维和二维条码,包括装饰(彩色和品牌)二维码。 它支持 .NET Standard 和 Core 2 及更高版本,可在 Azure、Linux、macOS、Windows 和 Web 上跨平台使用。 IronBarcode 是 .NET 系统的知名类库或组件,可让 C#、VB.NET 和 F# 开发人员使用标准化编程语言工作。 它将使客户能够浏览扫描仪标签并创建新的标准化标签。 它对二维条形码和其他三维标准化条形码的处理效果特别好。

IronBarcode 现在支持二维条码。 它提供了优化这些代码的着色、样式和像素化的功能,并能为它们添加徽标,以便在印刷品或广告材料中使用。 该库还可以读取倾斜和变形的条形码,这是其他条形码软件可能无法读取的。

安装 IronBarcode 和 ZXing.NET

安装 ZXing.NET

要使用 ZXing.NET 库,请使用 NuGet 软件包管理器控制台在 ASP.NET Core 应用程序中安装以下两个软件包:

1.ZXing.Net

Install-Package ZXing.Net

2.ZXing.Net.Bindings.CoreCompat.System.Drawing

Install-Package ZXing.Net.Bindings.CoreCompat.System.Drawing -Version 0.16.5-beta

或者,使用 NuGet 软件包管理器在您的项目中安装 ZXing.NET。 要执行此操作,请转到工具 > NuGet 包管理器 > 管理解决方案的 NuGet 包...,然后切换到 "浏览" 标签并搜索 "ZXing.NET"。

IronBarcode与Zxing.NET的比较,图1:ASP.NET Web应用程序

ASP.NET 网络应用程序

安装 IronBarcode

使用 NuGet 包管理器安装 IronBarcode,或者直接从产品网站下载 DLL。 IronBarcode 命名空间包含所有的 IronBarcode 类。

可使用 Visual Studio 的 NuGet 软件包管理器安装 IronBarcode:软件包名称为 "Barcode"。

Install-Package BarCode

创建二维条形码

使用 ZXing.NET

首先,在项目文件的根目录下新建一个名为 "qrr "的文件夹。

然后,我们将继续创建 QR 文件,并将图像系统文件存储在 "qrr "文件夹中。

在控制器内部,添加GenerateFile()方法,如下面的源代码所示。

public ActionResult GenerateFile()
{
    return View();
}

[HttpPost]
public ActionResult GenerateFile(string qrText)
{
    Byte [] byteArray;
    var width = 250; // width of the QR Code
    var height = 250; // height of the QR Code
    var margin = 0;
    var qrCodeWriter = new ZXing.BarcodeWriterPixelData
    {
        Format = ZXing.BarcodeFormat.QR_CODE,
        Options = new QrCodeEncodingOptions
        {
            Height = height,
            Width = width,
            Margin = margin
        }
    };
    var pixelData = qrCodeWriter.Write(qrText);

    // creating a PNG bitmap from the raw pixel data; if only black and white colors are used it makes no difference if the raw pixel data is BGRA oriented and the bitmap is initialized with RGB
    using (var bitmap = new System.Drawing.Bitmap(pixelData.Width, pixelData.Height, System.Drawing.Imaging.PixelFormat.Format32bppRgb))
    {
        using (var ms = new MemoryStream())
        {
            var bitmapData = bitmap.LockBits(new System.Drawing.Rectangle(0, 0, pixelData.Width, pixelData.Height), System.Drawing.Imaging.ImageLockMode.WriteOnly, System.Drawing.Imaging.PixelFormat.Format32bppRgb);
            try
            {
                // we assume that the row stride of the bitmap is aligned to 4 byte multiplied by the width of the image
                System.Runtime.InteropServices.Marshal.Copy(pixelData.Pixels, 0, bitmapData.Scan, pixelData.Pixels.Length);
            }
            finally
            {
                bitmap.UnlockBits(bitmapData);
            }

            // save to folder
            string fileGuid = Guid.NewGuid().ToString().Substring(0, 4);
            bitmap.Save(Server.MapPath("~/qrr") + "/file-" + fileGuid + ".png", System.Drawing.Imaging.ImageFormat.Png);

            // save to stream as PNG
            bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
            byteArray = ms.ToArray();
        }
    }
    return View(byteArray);
}
public ActionResult GenerateFile()
{
    return View();
}

[HttpPost]
public ActionResult GenerateFile(string qrText)
{
    Byte [] byteArray;
    var width = 250; // width of the QR Code
    var height = 250; // height of the QR Code
    var margin = 0;
    var qrCodeWriter = new ZXing.BarcodeWriterPixelData
    {
        Format = ZXing.BarcodeFormat.QR_CODE,
        Options = new QrCodeEncodingOptions
        {
            Height = height,
            Width = width,
            Margin = margin
        }
    };
    var pixelData = qrCodeWriter.Write(qrText);

    // creating a PNG bitmap from the raw pixel data; if only black and white colors are used it makes no difference if the raw pixel data is BGRA oriented and the bitmap is initialized with RGB
    using (var bitmap = new System.Drawing.Bitmap(pixelData.Width, pixelData.Height, System.Drawing.Imaging.PixelFormat.Format32bppRgb))
    {
        using (var ms = new MemoryStream())
        {
            var bitmapData = bitmap.LockBits(new System.Drawing.Rectangle(0, 0, pixelData.Width, pixelData.Height), System.Drawing.Imaging.ImageLockMode.WriteOnly, System.Drawing.Imaging.PixelFormat.Format32bppRgb);
            try
            {
                // we assume that the row stride of the bitmap is aligned to 4 byte multiplied by the width of the image
                System.Runtime.InteropServices.Marshal.Copy(pixelData.Pixels, 0, bitmapData.Scan, pixelData.Pixels.Length);
            }
            finally
            {
                bitmap.UnlockBits(bitmapData);
            }

            // save to folder
            string fileGuid = Guid.NewGuid().ToString().Substring(0, 4);
            bitmap.Save(Server.MapPath("~/qrr") + "/file-" + fileGuid + ".png", System.Drawing.Imaging.ImageFormat.Png);

            // save to stream as PNG
            bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
            byteArray = ms.ToArray();
        }
    }
    return View(byteArray);
}
Public Function GenerateFile() As ActionResult
	Return View()
End Function

<HttpPost>
Public Function GenerateFile(ByVal qrText As String) As ActionResult
	Dim byteArray() As Byte
	Dim width = 250 ' width of the QR Code
	Dim height = 250 ' height of the QR Code
	Dim margin = 0
	Dim qrCodeWriter = New ZXing.BarcodeWriterPixelData With {
		.Format = ZXing.BarcodeFormat.QR_CODE,
		.Options = New QrCodeEncodingOptions With {
			.Height = height,
			.Width = width,
			.Margin = margin
		}
	}
	Dim pixelData = qrCodeWriter.Write(qrText)

	' creating a PNG bitmap from the raw pixel data; if only black and white colors are used it makes no difference if the raw pixel data is BGRA oriented and the bitmap is initialized with RGB
	Using bitmap = New System.Drawing.Bitmap(pixelData.Width, pixelData.Height, System.Drawing.Imaging.PixelFormat.Format32bppRgb)
		Using ms = New MemoryStream()
			Dim bitmapData = bitmap.LockBits(New System.Drawing.Rectangle(0, 0, pixelData.Width, pixelData.Height), System.Drawing.Imaging.ImageLockMode.WriteOnly, System.Drawing.Imaging.PixelFormat.Format32bppRgb)
			Try
				' we assume that the row stride of the bitmap is aligned to 4 byte multiplied by the width of the image
				System.Runtime.InteropServices.Marshal.Copy(pixelData.Pixels, 0, bitmapData.Scan, pixelData.Pixels.Length)
			Finally
				bitmap.UnlockBits(bitmapData)
			End Try

			' save to folder
			Dim fileGuid As String = Guid.NewGuid().ToString().Substring(0, 4)
			bitmap.Save(Server.MapPath("~/qrr") & "/file-" & fileGuid & ".png", System.Drawing.Imaging.ImageFormat.Png)

			' save to stream as PNG
			bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Png)
			byteArray = ms.ToArray()
		End Using
	End Using
	Return View(byteArray)
End Function
$vbLabelText   $csharpLabel

剩下的唯一改动就是将 QR 代码文件保存在 "qrr "文件夹内。 这可以通过下面的两行代码来实现。

string fileGuid = Guid.NewGuid().ToString().Substring(0, 4);
bitmap.Save(Server.MapPath("~/qrr") + "/file-" + fileGuid + ".png", System.Drawing.Imaging.ImageFormat.Png);
string fileGuid = Guid.NewGuid().ToString().Substring(0, 4);
bitmap.Save(Server.MapPath("~/qrr") + "/file-" + fileGuid + ".png", System.Drawing.Imaging.ImageFormat.Png);
Dim fileGuid As String = Guid.NewGuid().ToString().Substring(0, 4)
bitmap.Save(Server.MapPath("~/qrr") & "/file-" & fileGuid & ".png", System.Drawing.Imaging.ImageFormat.Png)
$vbLabelText   $csharpLabel

您还必须创建GenerateFile视图,并在其中包含以下代码。 GenerateFile视图与Index视图相同。

@model Byte []
@using (Html.BeginForm(null, null, FormMethod.Post))
{
    <table>
        <tbody>
            <tr>
                <td>
                    <label>Enter text for creating QR Code</label>
                </td>
                <td>
// text box to enter text...
                    <input type="text" name="qrText" />
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <button>Submit</button>
                </td>
            </tr>
        </tbody>
    </table>
}
@{
    if (Model != null)
    {
        <h3>QR Code Successfully Generated</h3>
// img tag to display generated QR code...
        <img src="@String.Format("data:image/png;base64,{0}", Convert.ToBase64String(Model))" />
    }
}
@model Byte []
@using (Html.BeginForm(null, null, FormMethod.Post))
{
    <table>
        <tbody>
            <tr>
                <td>
                    <label>Enter text for creating QR Code</label>
                </td>
                <td>
// text box to enter text...
                    <input type="text" name="qrText" />
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <button>Submit</button>
                </td>
            </tr>
        </tbody>
    </table>
}
@{
    if (Model != null)
    {
        <h3>QR Code Successfully Generated</h3>
// img tag to display generated QR code...
        <img src="@String.Format("data:image/png;base64,{0}", Convert.ToBase64String(Model))" />
    }
}
model Function [using](Html.BeginForm ByVal As (Nothing, Nothing, FormMethod.Post)) As Byte()
'INSTANT VB WARNING: An assignment within expression was extracted from the following statement:
'ORIGINAL LINE: <table> <tbody> <tr> <td> <label> Enter text for creating QR Code</label> </td> <td> <input type="text" name="qrText" /> </td> </tr> <tr> <td colspan="2"> <button> Submit</button> </td> </tr> </tbody> </table>
	"qrText" /> </td> </tr> (Of tr) <td colspan="2"> (Of button) Submit</button> </td> </tr> </tbody> </table>
'INSTANT VB WARNING: An assignment within expression was extracted from the following statement:
'ORIGINAL LINE: <table> <tbody> <tr> <td> <label> Enter text for creating QR Code</label> </td> <td> <input type="text" name="qrText" /> </td> </tr> <tr> <td colspan
	"text" name="qrText" /> </td> </tr> (Of tr) <td colspan
	(Of table) (Of tbody) (Of tr) (Of td) (Of label) Enter text for creating QR Code</label> </td> (Of td) <input type="text" name
End Function
@
If True Then
	If Model IsNot Nothing Then
'INSTANT VB WARNING: Instant VB cannot determine whether both operands of this division are integer types - if they are then you should use the VB integer division operator:
		(Of h3) QR Code Successfully Generated</h3> <img src="@String.Format("data:image/png
		base64,
		If True Then
			0
		End If
		", Convert.ToBase64String(Model))" />
	End If
End If
$vbLabelText   $csharpLabel

在文本框中输入任何值,然后单击 "提交 "按钮。 QR 代码将生成并以 .PNG 文件格式保存在 "qrr "文件夹中。

IronBarcode与ZXing.NET的比较,图2:QR码生成器

QR 代码生成器

IronBarcode与ZXing.NET的比较,图3:显示的二维码文件

显示 QR 码文件

支持的条码格式

IronBarcode 支持多种常用条码格式,包括

  • 带有标志和颜色的二维码(包括装饰和品牌代码)
  • 多格式条形码包括 Aztec、Data Matrix、CODE 93、CODE 128、RSS Expanded Databar、UPS MaxiCode 和 USPS、IMB(OneCode)条形码
  • RSS-14 和 PDF-417 堆叠线性条形码
  • UPCA、UPCE、EAN-8、EAN-13、Codabar、ITF、MSI 和 Plessey 是传统的数字条形码格式。

创建并保存条形码

var MyBarCode = IronBarcode.BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode", BarcodeEncoding.Code128);
MyBarCode.SaveAsImage("MyBarCode.png");
MyBarCode.SaveAsGif("MyBarCode.gif");
MyBarCode.SaveAsHtmlFile("MyBarCode.html");
MyBarCode.SaveAsJpeg("MyBarCode.jpg");
MyBarCode.SaveAsPdf("MyBarCode.Pdf");
MyBarCode.SaveAsPng("MyBarCode.png");
MyBarCode.SaveAsTiff("MyBarCode.tiff");
MyBarCode.SaveAsWindowsBitmap("MyBarCode.bmp");
Image  MyBarCodeImage = MyBarCode.Image;
Bitmap MyBarCodeBitmap = MyBarCode.ToBitmap();
string DataURL = MyBarCode.ToDataUrl();
string ImgTagForHTML = MyBarCode.ToHtmlTag();
byte [] PngBytes = MyBarCode.ToPngBinaryData();
     // Binary barcode image output also works for GIF, JPEG, PDF, PNG, BMP and TIFF
using (System.IO.Stream PdfStream = MyBarCode.ToPdfStream()){
    // Stream barcode image output also works for GIF, JPEG, PDF, PNG, BMP and TIFF
}
MyBarCode.StampToExistingPdfPage("ExistingPDF.pdf", 1, 200, 50);
var MyBarCode = IronBarcode.BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode", BarcodeEncoding.Code128);
MyBarCode.SaveAsImage("MyBarCode.png");
MyBarCode.SaveAsGif("MyBarCode.gif");
MyBarCode.SaveAsHtmlFile("MyBarCode.html");
MyBarCode.SaveAsJpeg("MyBarCode.jpg");
MyBarCode.SaveAsPdf("MyBarCode.Pdf");
MyBarCode.SaveAsPng("MyBarCode.png");
MyBarCode.SaveAsTiff("MyBarCode.tiff");
MyBarCode.SaveAsWindowsBitmap("MyBarCode.bmp");
Image  MyBarCodeImage = MyBarCode.Image;
Bitmap MyBarCodeBitmap = MyBarCode.ToBitmap();
string DataURL = MyBarCode.ToDataUrl();
string ImgTagForHTML = MyBarCode.ToHtmlTag();
byte [] PngBytes = MyBarCode.ToPngBinaryData();
     // Binary barcode image output also works for GIF, JPEG, PDF, PNG, BMP and TIFF
using (System.IO.Stream PdfStream = MyBarCode.ToPdfStream()){
    // Stream barcode image output also works for GIF, JPEG, PDF, PNG, BMP and TIFF
}
MyBarCode.StampToExistingPdfPage("ExistingPDF.pdf", 1, 200, 50);
Dim MyBarCode = IronBarcode.BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode", BarcodeEncoding.Code128)
MyBarCode.SaveAsImage("MyBarCode.png")
MyBarCode.SaveAsGif("MyBarCode.gif")
MyBarCode.SaveAsHtmlFile("MyBarCode.html")
MyBarCode.SaveAsJpeg("MyBarCode.jpg")
MyBarCode.SaveAsPdf("MyBarCode.Pdf")
MyBarCode.SaveAsPng("MyBarCode.png")
MyBarCode.SaveAsTiff("MyBarCode.tiff")
MyBarCode.SaveAsWindowsBitmap("MyBarCode.bmp")
Dim MyBarCodeImage As Image = MyBarCode.Image
Dim MyBarCodeBitmap As Bitmap = MyBarCode.ToBitmap()
Dim DataURL As String = MyBarCode.ToDataUrl()
Dim ImgTagForHTML As String = MyBarCode.ToHtmlTag()
Dim PngBytes() As Byte = MyBarCode.ToPngBinaryData()
	 ' Binary barcode image output also works for GIF, JPEG, PDF, PNG, BMP and TIFF
Using PdfStream As System.IO.Stream = MyBarCode.ToPdfStream()
	' Stream barcode image output also works for GIF, JPEG, PDF, PNG, BMP and TIFF
End Using
MyBarCode.StampToExistingPdfPage("ExistingPDF.pdf", 1, 200, 50)
$vbLabelText   $csharpLabel

另一方面,ZXing 是一个基于 Java 的开源一维/二维条形码图像处理库。 支持 UPC-A、UPC-E、EAN-8、Code 93、Code 128、QR Code、Data Matrix、Aztec、PDF 417 和其他条形码格式。

IronBarcode 与 Zxing.NET 的比较,图 4:支持的条码格式

支持的条码格式

使用 IronBarcode 创建 QR 码文件

要使用IronBarcode创建QR码,我们可以使用QRCodeWriter类而不是BarcodeWriter类。 本课介绍了创建 QR 代码的一些新颖而有趣的功能。 它使我们能够设置 QR 纠错级别,让您在 QR 代码的大小和可读性之间取得平衡。

// Generate a simple QR Code image and save as PNG
QRCodeWriter.CreateQrCode("hello world", 500, QRCodeWriter.QrErrorCorrectionLevel.Medium).SaveAsPng("MyQR.png");
// Generate a simple QR Code image and save as PNG
QRCodeWriter.CreateQrCode("hello world", 500, QRCodeWriter.QrErrorCorrectionLevel.Medium).SaveAsPng("MyQR.png");
' Generate a simple QR Code image and save as PNG
QRCodeWriter.CreateQrCode("hello world", 500, QRCodeWriter.QrErrorCorrectionLevel.Medium).SaveAsPng("MyQR.png")
$vbLabelText   $csharpLabel

通过纠错,我们可以明确在实际情况下阅读二维码的难易程度。 纠错级别越高,二维码越大,像素越多,复杂度越高。 在下图中,我们看到了二维码文件的显示。

IronBarcode 和 ZXing.NET 的比较,图 5:支持的条码格式

二维码图像

我们首先通过IronBarcode.BarcodeWriterEncoding枚举指定条形码的值和条形码格式。 然后我们可以保存为图像、System.Drawing.Image或 Bitmap 代码对象。 这就是您需要的全部源代码!

// Generate a simple BarCode image and save as PNG using following namespaces
using IronBarCode;
GeneratedBarcode MyBarCode = IronBarcode.BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode", BarcodeWriterEncoding.Code128);
MyBarCode.SaveAsPng("MyBarCode.png");
// This line opens the image in your default image viewer
System.Diagnostics.Process.Start("MyBarCode.png");
// Generate a simple BarCode image and save as PNG using following namespaces
using IronBarCode;
GeneratedBarcode MyBarCode = IronBarcode.BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode", BarcodeWriterEncoding.Code128);
MyBarCode.SaveAsPng("MyBarCode.png");
// This line opens the image in your default image viewer
System.Diagnostics.Process.Start("MyBarCode.png");
' Generate a simple BarCode image and save as PNG using following namespaces
Imports IronBarCode
Private MyBarCode As GeneratedBarcode = IronBarcode.BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode", BarcodeWriterEncoding.Code128)
MyBarCode.SaveAsPng("MyBarCode.png")
' This line opens the image in your default image viewer
System.Diagnostics.Process.Start("MyBarCode.png")
$vbLabelText   $csharpLabel
IronBarcode与ZXing.NET的比较,图6:在C#中创建条形码图像示例

在 C# 示例中创建条形码图像

IronBarcode 还支持对 QR 代码进行风格化处理,例如在图像的正中央放置徽标图形并将其固定在网格上。 译文的颜色还可以与特定的品牌或图形标识相匹配。

要进行测试,请在下面的代码示例中创建一个徽标,看看使用QRCodeWriter.CreateQRCodeWithLogo方法是多么简单。

// Adding a Logo
var MyQRWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/csharp/barcode/", "visual-studio-logo.png", 500);
MyQRWithLogo.ChangeBarCodeColor(System.Drawing.Color.DarkGreen);
// Adding a Logo
var MyQRWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/csharp/barcode/", "visual-studio-logo.png", 500);
MyQRWithLogo.ChangeBarCodeColor(System.Drawing.Color.DarkGreen);
' Adding a Logo
Dim MyQRWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/csharp/barcode/", "visual-studio-logo.png", 500)
MyQRWithLogo.ChangeBarCodeColor(System.Drawing.Color.DarkGreen)
$vbLabelText   $csharpLabel
IronBarcode与ZXing.NET的比较,图7:创建带有徽标图像的QR码

用徽标图像创建 QR 码

最后,我们将生成的 QR 代码保存为 PDF 文件。为方便起见,最后一行代码将 QR 代码保存为 HTML 文件。

// Adding a Logo
var MyQRWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/csharp/barcode/", "visual-studio-logo.png", 500);
MyQRWithLogo.ChangeBarCodeColor(System.Drawing.Color.DarkGreen);
//Save as PDF
MyQRWithLogo.SaveAsPdf("MyQRWithLogo.pdf");
//Also Save as HTML
MyQRWithLogo.SaveAsHtmlFile("MyQRWithLogo.html");
// Adding a Logo
var MyQRWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/csharp/barcode/", "visual-studio-logo.png", 500);
MyQRWithLogo.ChangeBarCodeColor(System.Drawing.Color.DarkGreen);
//Save as PDF
MyQRWithLogo.SaveAsPdf("MyQRWithLogo.pdf");
//Also Save as HTML
MyQRWithLogo.SaveAsHtmlFile("MyQRWithLogo.html");
' Adding a Logo
Dim MyQRWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/csharp/barcode/", "visual-studio-logo.png", 500)
MyQRWithLogo.ChangeBarCodeColor(System.Drawing.Color.DarkGreen)
'Save as PDF
MyQRWithLogo.SaveAsPdf("MyQRWithLogo.pdf")
'Also Save as HTML
MyQRWithLogo.SaveAsHtmlFile("MyQRWithLogo.html")
$vbLabelText   $csharpLabel

下面,我们将看到如何仅用一行代码就创建、样式化和导出一个 BarCode。

IronBarcode 包含一个类似于 System.Linq 的流畅 API。 我们创建一个 BarCode,设置其边距,并通过链式方法调用将其单行导出为位图。 这可能会非常有用,并使代码更容易阅读。

using IronBarCode;
using System.Drawing;
 // Fluent API for Barcode image generation.
string MyValue = "https://ironsoftware.com/csharp/barcode";
Bitmap BarcodeBmp = IronBarcode.BarcodeWriter.CreateBarcode(MyValue, BarcodeEncoding.PDF417).ResizeTo(300,200).SetMargins(100).ToBitmap();
using IronBarCode;
using System.Drawing;
 // Fluent API for Barcode image generation.
string MyValue = "https://ironsoftware.com/csharp/barcode";
Bitmap BarcodeBmp = IronBarcode.BarcodeWriter.CreateBarcode(MyValue, BarcodeEncoding.PDF417).ResizeTo(300,200).SetMargins(100).ToBitmap();
Imports IronBarCode
Imports System.Drawing
 ' Fluent API for Barcode image generation.
Private MyValue As String = "https://ironsoftware.com/csharp/barcode"
Private BarcodeBmp As Bitmap = IronBarcode.BarcodeWriter.CreateBarcode(MyValue, BarcodeEncoding.PDF417).ResizeTo(300,200).SetMargins(100).ToBitmap()
$vbLabelText   $csharpLabel

因此,PDF417 条形码的System.Drawing.Image如下所示:

IronBarcode与ZXing.NET的比较,图8:在C#中简单流畅的PDF417条形码生成

在 C# 中简单、流畅地生成 PDF417 条码

读取 QR 码文件

使用 IronBarcode 阅读 QR 码

当您将 IronBarcode for .NET 类库与 .NET 条码阅读器结合使用时,阅读条码或 QR 码将变得轻而易举。 在第一个示例中,我们可以看到如何仅使用一行代码读取条形码。

IronBarcode与ZXing.NET的比较,图9:使用C#扫描Code128条形码图像

使用 C# 扫描 Code128 条形码图像

我们可以获取条形码的值、图像、编码类型和二进制数据(如果有),然后将其输出到控制台。

using IronBarCode;
using System;
BarcodeResult Result = BarcodeReader.QuicklyReadOneBarcode("GetStarted.png");
if (Result !=null && Result.Text == "https://ironsoftware.com/csharp/barcode/")
{
  Console.WriteLine("GetStarted was a success.  Read Value: " + Result.Text);
}
using IronBarCode;
using System;
BarcodeResult Result = BarcodeReader.QuicklyReadOneBarcode("GetStarted.png");
if (Result !=null && Result.Text == "https://ironsoftware.com/csharp/barcode/")
{
  Console.WriteLine("GetStarted was a success.  Read Value: " + Result.Text);
}
Imports IronBarCode
Imports System
Private Result As BarcodeResult = BarcodeReader.QuicklyReadOneBarcode("GetStarted.png")
If Result IsNot Nothing AndAlso Result.Text = "https://ironsoftware.com/csharp/barcode/" Then
  Console.WriteLine("GetStarted was a success.  Read Value: " & Result.Text)
End If
$vbLabelText   $csharpLabel

阅读 PDF 内的 BarCode

我们将研究如何读取扫描的 PDF 文档,并通过几行代码找到所有的一维 BarCode。

正如您所看到的,这与从单个文档中读取单个条形码非常相似,只不过我们现在知道了发现条形码的页码。

using IronBarCode;
using System;
using System.Drawing;
// Multiple barcodes may be scanned up from a single document or image.  A PDF document may also be used as the input image
PagedBarcodeResult [] PDFResults = BarcodeReader.ReadBarcodesFromPdf("MultipleBarcodes.pdf");
// Work with the results
foreach (var PageResult in PDFResults)
{
    string Value = PageResult.Value;
    int PageNum = PageResult.PageNumber;
    System.Drawing.Bitmap Img = PageResult.BarcodeImage;
    BarcodeEncoding BarcodeType = PageResult.BarcodeType;
    byte [] Binary = PageResult.BinaryValue;
    Console.WriteLine(PageResult.Value+" on page "+ PageNum);
}
using IronBarCode;
using System;
using System.Drawing;
// Multiple barcodes may be scanned up from a single document or image.  A PDF document may also be used as the input image
PagedBarcodeResult [] PDFResults = BarcodeReader.ReadBarcodesFromPdf("MultipleBarcodes.pdf");
// Work with the results
foreach (var PageResult in PDFResults)
{
    string Value = PageResult.Value;
    int PageNum = PageResult.PageNumber;
    System.Drawing.Bitmap Img = PageResult.BarcodeImage;
    BarcodeEncoding BarcodeType = PageResult.BarcodeType;
    byte [] Binary = PageResult.BinaryValue;
    Console.WriteLine(PageResult.Value+" on page "+ PageNum);
}
Imports IronBarCode
Imports System
Imports System.Drawing
' Multiple barcodes may be scanned up from a single document or image.  A PDF document may also be used as the input image
Private PDFResults() As PagedBarcodeResult = BarcodeReader.ReadBarcodesFromPdf("MultipleBarcodes.pdf")
' Work with the results
For Each PageResult In PDFResults
	Dim Value As String = PageResult.Value
	Dim PageNum As Integer = PageResult.PageNumber
	Dim Img As System.Drawing.Bitmap = PageResult.BarcodeImage
	Dim BarcodeType As BarcodeEncoding = PageResult.BarcodeType
	Dim Binary() As Byte = PageResult.BinaryValue
	Console.WriteLine(PageResult.Value &" on page " & PageNum)
Next PageResult
$vbLabelText   $csharpLabel

您将获得包含 PDF 中所有位图条形码的结果数据。

IronBarcode与ZXing.NET的比较,图10:读取PDF结果中存储的条形码

读取存储在 PDF 结果中的条形码

从 GIF 和 TIFF 中读取条形码

// Multi-frame TIFF and GIF images can also be scanned, and multiple threads will be used automatically in the background for improved performance
PagedBarcodeResult [] MultiFrameResults = BarcodeReader.ReadBarcodesFromMultiFrameTiff("Multiframe.tiff", BarcodeEncoding.Code128, BarcodeReader.BarcodeRotationCorrection.High, BarcodeReader.BarcodeImageCorrection.MediumCleanPixels);
foreach (var PageResult in MultiFrameResults)
{
//...
}
// Multi-frame TIFF and GIF images can also be scanned, and multiple threads will be used automatically in the background for improved performance
PagedBarcodeResult [] MultiFrameResults = BarcodeReader.ReadBarcodesFromMultiFrameTiff("Multiframe.tiff", BarcodeEncoding.Code128, BarcodeReader.BarcodeRotationCorrection.High, BarcodeReader.BarcodeImageCorrection.MediumCleanPixels);
foreach (var PageResult in MultiFrameResults)
{
//...
}
' Multi-frame TIFF and GIF images can also be scanned, and multiple threads will be used automatically in the background for improved performance
Dim MultiFrameResults() As PagedBarcodeResult = BarcodeReader.ReadBarcodesFromMultiFrameTiff("Multiframe.tiff", BarcodeEncoding.Code128, BarcodeReader.BarcodeRotationCorrection.High, BarcodeReader.BarcodeImageCorrection.MediumCleanPixels)
For Each PageResult In MultiFrameResults
'...
Next PageResult
$vbLabelText   $csharpLabel
IronBarcode与ZXing.NET的比较,图11:从多帧TIFF图像读取条形码

从多帧 TIFF 图像中读取条形码

下面的示例展示了如何从扫描的 PDF 中读取 QR 码和 PDF-417 条形码。 我们设置了适当的条形码旋转校正和条形码图像校正级别,以轻度清洁文档,同时又不会因为超出我们的需求而造成重大的性能损失。

// PDF documents can also be scanned, and multiple threads will be used automatically in the background for improved performance
var ScanResults = BarcodeReader.ReadBarcodesFromPdf("Scan.pdf", BarcodeEncoding.All, BarcodeReader.BarcodeRotationCorrection.Low, BarcodeReader.BarcodeImageCorrection.LightlyCleanPixels);
// Work with the results
foreach (var PageResult in ScanResults)
{
  string Value = PageResult.Value;
  ///...
}
// PDF documents can also be scanned, and multiple threads will be used automatically in the background for improved performance
var ScanResults = BarcodeReader.ReadBarcodesFromPdf("Scan.pdf", BarcodeEncoding.All, BarcodeReader.BarcodeRotationCorrection.Low, BarcodeReader.BarcodeImageCorrection.LightlyCleanPixels);
// Work with the results
foreach (var PageResult in ScanResults)
{
  string Value = PageResult.Value;
  ///...
}
' PDF documents can also be scanned, and multiple threads will be used automatically in the background for improved performance
Dim ScanResults = BarcodeReader.ReadBarcodesFromPdf("Scan.pdf", BarcodeEncoding.All, BarcodeReader.BarcodeRotationCorrection.Low, BarcodeReader.BarcodeImageCorrection.LightlyCleanPixels)
' Work with the results
For Each PageResult In ScanResults
  Dim Value As String = PageResult.Value
  '''...
Next PageResult
$vbLabelText   $csharpLabel
IronBarcode与ZXing.NET的比较,图12:从扫描的PDF文档读取条形码

从扫描的 PDF 文档中读取条形码

从位图图像读取损坏的 QR 码

下面的示例显示,该 C# 条码库甚至可以读取损坏的条码缩略图。

条形码缩略图尺寸会自动更正。 C# 中的 IronBarcode 使文件可读。

阅读器方法可自动检测出小于合法条形码的条形码图像,并将其放大。 他们要清除与缩略图工作相关的所有数字噪音,使缩略图重新具有可读性。

// Small or 'Thumbnail' barcode images are automatically detected by IronBarcode and corrected wherever possible even if they have much digital noise.
BarcodeResult SmallResult = BarcodeReader.QuicklyReadOneBarcode("ThumbnailOfBarcode.gif", BarcodeEncoding.Code128);
// Small or 'Thumbnail' barcode images are automatically detected by IronBarcode and corrected wherever possible even if they have much digital noise.
BarcodeResult SmallResult = BarcodeReader.QuicklyReadOneBarcode("ThumbnailOfBarcode.gif", BarcodeEncoding.Code128);
' Small or 'Thumbnail' barcode images are automatically detected by IronBarcode and corrected wherever possible even if they have much digital noise.
Dim SmallResult As BarcodeResult = BarcodeReader.QuicklyReadOneBarcode("ThumbnailOfBarcode.gif", BarcodeEncoding.Code128)
$vbLabelText   $csharpLabel
IronBarcode 与 ZXing.NET 的比较, 图 13:自动条形码缩略图尺寸校正

自动校正条形码缩略图尺寸

从不规则图像中读取 BarCode

在现实场景中,我们可能希望从不完美的图像中读取 BarCode。 在翻译过程中,可能会出现图像歪斜或照片有数字噪点的情况。大多数开源 .NET 条码生成和读取库都不可能做到这一点。 而 IronBarcode 则让从不完美的图像中读取条形码变得轻而易举。

我们现在来看看ReadASingleBarcode方法。 通过其RotationCorrection参数,IronBarcode 尝试从不完美的数字样本中校正倾斜并读取条形码。

using IronBarCode;
using System;
using System.Drawing;
// All BarcodeResult.Read methods provide the developer with control to correct image and photograph correction and straightening rotation and perspective from skewed images
// * RotationCorrection   e.g BarcodeReader.BarcodeRotationCorrection.Extreme un-rotates and removes perspective from barcode images.
// * ImageCorrection      e.g BarcodeReader.BarcodeImageCorrection.DeepCleanPixels separates barcodes from background imagery and digital noise.
// * BarcodeEncoding      e.g. BarcodeEncoding.Code128,  Setting a specific Barcode format improves speed and reduces the risk of false positive results
// Example with a photo image
var PhotoResult = BarcodeReader.ReadASingleBarcode("Photo.png", BarcodeEncoding.Code128, BarcodeReader.BarcodeRotationCorrection.Medium, BarcodeReader.BarcodeImageCorrection.DeepCleanPixels);
string Value = PhotoResult.Value;
System.Drawing.Bitmap Img = PhotoResult.BarcodeImage;
BarcodeEncoding BarcodeType = PhotoResult.BarcodeType;
byte [] Binary = PhotoResult.BinaryValue;
Console.WriteLine(PhotoResult.Value);
using IronBarCode;
using System;
using System.Drawing;
// All BarcodeResult.Read methods provide the developer with control to correct image and photograph correction and straightening rotation and perspective from skewed images
// * RotationCorrection   e.g BarcodeReader.BarcodeRotationCorrection.Extreme un-rotates and removes perspective from barcode images.
// * ImageCorrection      e.g BarcodeReader.BarcodeImageCorrection.DeepCleanPixels separates barcodes from background imagery and digital noise.
// * BarcodeEncoding      e.g. BarcodeEncoding.Code128,  Setting a specific Barcode format improves speed and reduces the risk of false positive results
// Example with a photo image
var PhotoResult = BarcodeReader.ReadASingleBarcode("Photo.png", BarcodeEncoding.Code128, BarcodeReader.BarcodeRotationCorrection.Medium, BarcodeReader.BarcodeImageCorrection.DeepCleanPixels);
string Value = PhotoResult.Value;
System.Drawing.Bitmap Img = PhotoResult.BarcodeImage;
BarcodeEncoding BarcodeType = PhotoResult.BarcodeType;
byte [] Binary = PhotoResult.BinaryValue;
Console.WriteLine(PhotoResult.Value);
Imports IronBarCode
Imports System
Imports System.Drawing
' All BarcodeResult.Read methods provide the developer with control to correct image and photograph correction and straightening rotation and perspective from skewed images
' * RotationCorrection   e.g BarcodeReader.BarcodeRotationCorrection.Extreme un-rotates and removes perspective from barcode images.
' * ImageCorrection      e.g BarcodeReader.BarcodeImageCorrection.DeepCleanPixels separates barcodes from background imagery and digital noise.
' * BarcodeEncoding      e.g. BarcodeEncoding.Code128,  Setting a specific Barcode format improves speed and reduces the risk of false positive results
' Example with a photo image
Private PhotoResult = BarcodeReader.ReadASingleBarcode("Photo.png", BarcodeEncoding.Code128, BarcodeReader.BarcodeRotationCorrection.Medium, BarcodeReader.BarcodeImageCorrection.DeepCleanPixels)
Private Value As String = PhotoResult.Value
Private Img As System.Drawing.Bitmap = PhotoResult.BarcodeImage
Private BarcodeType As BarcodeEncoding = PhotoResult.BarcodeType
Private Binary() As Byte = PhotoResult.BinaryValue
Console.WriteLine(PhotoResult.Value)
$vbLabelText   $csharpLabel
IronBarcode与ZXing.NET的比较,图14:从手机摄像头读取条形码

用手机摄像头读取条形码

IronBarcode 还能同时读取多个条形码。当我们创建一个文档列表,并使用条码阅读器读取众多文档时,我们会从 IronBarcode 中获得更好的效果。 条形码扫描过程中使用的ReadBarcodesMultithreaded方法利用多个线程,可能使用您CPU的所有内核,并且可以比一次读取一个条形码快得多。

// The BarcodeResult.ReadBarcodesMultiThreaded method allows for faster barcode scanning of multiple images or PDFs.  All threads are automatically managed by IronBarcode.
var ListOfDocuments = new [] { "Image1.png", "image2.JPG", "image3.pdf" };
PagedBarcodeResult [] BatchResults = BarcodeReader.ReadBarcodesMultiThreaded(ListOfDocuments);
// Work with the results
foreach (var Result in BatchResults)
{
    string Value = Result.Value;
    //...
}
// The BarcodeResult.ReadBarcodesMultiThreaded method allows for faster barcode scanning of multiple images or PDFs.  All threads are automatically managed by IronBarcode.
var ListOfDocuments = new [] { "Image1.png", "image2.JPG", "image3.pdf" };
PagedBarcodeResult [] BatchResults = BarcodeReader.ReadBarcodesMultiThreaded(ListOfDocuments);
// Work with the results
foreach (var Result in BatchResults)
{
    string Value = Result.Value;
    //...
}
' The BarcodeResult.ReadBarcodesMultiThreaded method allows for faster barcode scanning of multiple images or PDFs.  All threads are automatically managed by IronBarcode.
Dim ListOfDocuments = { "Image1.png", "image2.JPG", "image3.pdf" }
Dim BatchResults() As PagedBarcodeResult = BarcodeReader.ReadBarcodesMultiThreaded(ListOfDocuments)
' Work with the results
For Each Result In BatchResults
	Dim Value As String = Result.Value
	'...
Next Result
$vbLabelText   $csharpLabel

使用 ZXing.NET 阅读和解码 QR 代码

要读取QR码文件,请在控制器中添加一个ViewFile动作方法,如下所示。

public ActionResult ViewFile()
{
    List<KeyValuePair<string, string>> fileData = new List<KeyValuePair<string, string>>();
    KeyValuePair<string, string> data;

    string [] files = Directory.GetFiles(Server.MapPath("~/qrr"));
    foreach (string file in files)
    {
        // create a barcode reader instance
        IBarcodeReader reader = new BarcodeReader();
        // load a bitmap
        var barcodeBitmap = (Bitmap)Image.FromFile(Server.MapPath("~/qrr") + "/" + Path.GetFileName(file));
        // detect and decode the barcode inside the bitmap
        var result = reader.Decode(barcodeBitmap);
        // do something with the result
        data = new KeyValuePair<string, string>(result.ToString(), "/QR/" + Path.GetFileName(file));
        fileData.Add(data);
    }
    return View(fileData);
}
public ActionResult ViewFile()
{
    List<KeyValuePair<string, string>> fileData = new List<KeyValuePair<string, string>>();
    KeyValuePair<string, string> data;

    string [] files = Directory.GetFiles(Server.MapPath("~/qrr"));
    foreach (string file in files)
    {
        // create a barcode reader instance
        IBarcodeReader reader = new BarcodeReader();
        // load a bitmap
        var barcodeBitmap = (Bitmap)Image.FromFile(Server.MapPath("~/qrr") + "/" + Path.GetFileName(file));
        // detect and decode the barcode inside the bitmap
        var result = reader.Decode(barcodeBitmap);
        // do something with the result
        data = new KeyValuePair<string, string>(result.ToString(), "/QR/" + Path.GetFileName(file));
        fileData.Add(data);
    }
    return View(fileData);
}
Public Function ViewFile() As ActionResult
	Dim fileData As New List(Of KeyValuePair(Of String, String))()
	Dim data As KeyValuePair(Of String, String)

	Dim files() As String = Directory.GetFiles(Server.MapPath("~/qrr"))
	For Each file As String In files
		' create a barcode reader instance
		Dim reader As IBarcodeReader = New BarcodeReader()
		' load a bitmap
		Dim barcodeBitmap = CType(Image.FromFile(Server.MapPath("~/qrr") & "/" & Path.GetFileName(file)), Bitmap)
		' detect and decode the barcode inside the bitmap
		Dim result = reader.Decode(barcodeBitmap)
		' do something with the result
		data = New KeyValuePair(Of String, String)(result.ToString(), "/QR/" & Path.GetFileName(file))
		fileData.Add(data)
	Next file
	Return View(fileData)
End Function
$vbLabelText   $csharpLabel
IronBarcode与ZXing.NET的比较,图15:读取和解码二维码

读取和解码 QR 码

IronBarcode 和 ZXing.NET 的比较,图 16:解码的 QR 码

已解码 QR 码

解码位图内的条形码

// create a barcode reader instance
BarcodeReader reader = new BarcodeReader();
// load a bitmap
var barcodeBitmap = (Bitmap)Image.LoadFrom("C:\\sample-barcode-image.png");
// detect and decode the barcode inside the bitmap
var result = reader.Decode(barcodeBitmap);
// do something with the result
if (result != null)
{
   txtDecoderType.Text = result.BarcodeFormat.ToString();
   txtDecoderContent.Text = result.Text;
}
// create a barcode reader instance
BarcodeReader reader = new BarcodeReader();
// load a bitmap
var barcodeBitmap = (Bitmap)Image.LoadFrom("C:\\sample-barcode-image.png");
// detect and decode the barcode inside the bitmap
var result = reader.Decode(barcodeBitmap);
// do something with the result
if (result != null)
{
   txtDecoderType.Text = result.BarcodeFormat.ToString();
   txtDecoderContent.Text = result.Text;
}
' create a barcode reader instance
Dim reader As New BarcodeReader()
' load a bitmap
Dim barcodeBitmap = CType(Image.LoadFrom("C:\sample-barcode-image.png"), Bitmap)
' detect and decode the barcode inside the bitmap
Dim result = reader.Decode(barcodeBitmap)
' do something with the result
If result IsNot Nothing Then
   txtDecoderType.Text = result.BarcodeFormat.ToString()
   txtDecoderContent.Text = result.Text
End If
$vbLabelText   $csharpLabel

在线 ZXing 解码器

ZXing Decoder Online 是一款支持解码的在线条形码和二维码扫描器。 上传 PNG 或其他格式的二维码图片,它就会开始解码。 同样,您也可以为任何数据生成 QR 代码。 大多数情况下,这些信息将是您希望编码到 QR 代码中的 URL 或文本。

导航至 ZXing Decoder 网站。

IronBarcode 和 ZXing.NET 的比较,图 17:已解码 QR 码

ZXing 解码器网站

IronBarcode 和 ZXing.NET 的比较,图 18:已解码 QR 码

ZXing 解码结果

定价和许可

ZXing.NET 库是一个免费的开源库,允许您构建条形码读取应用程序,但基于 Apache 许可构建,不允许将其免费用于商业目的。

我们免费提供 IronBarcode 的开发人员许可证。 IronBarcode有一个独特的定价方案:Lite捆绑包起价为$749,无需额外费用。 也可以再次分发 SaaS 和 OEM 项目。 每个许可证包括永久许可证、开发/暂存/生产有效性、30天退款保证,以及一年的软件支持和升级(一次性购买)。 访问此页面查看IronBarcode的完整定价和许可信息。

为什么选择 IronBarcode?

IronBarcode 包括一个易于使用的 API,供开发人员在 .NET 中读写条形码,从而优化了准确性和实际使用案例中的低错误率。

BarcodeWriter 类,例如,将验证和校正 UPCA 和 UPCE 条形码上的“校验和”。 此外,对于太短而无法输入特定数字格式的数字,还要进行 "零填充"。 如果您的数据与指定的数据格式不兼容,IronBarcode 将通知开发者可使用更合适的条码格式。

IronBarcode 擅长在扫描条形码或从照片图像中读取条形码时读取条形码,换句话说,在图像图形不完美且不是机器生成的截图时读取条形码。

IronBarcode 与 ZXing.NET 有何不同?

IronBarcode 是基于 ZXing.NET(斑马线)核心构建的,具有改进的处理能力。 与 ZXing.NET Core 库相比,它配备了易于使用的 API,错误率较低。 不仅如此,IronBarcode for .NET 还支持比通常的 ZXing.NET 库所支持的更广泛的条形码格式。

IronBarcode 是 ZXing.NET 的改良版,为用户提供了商业使用平台,并可在多个平台上使用同一软件包。 它还提供全面的技术支持,随时准备为您提供所需的帮助。

IronBarcode 包括自动旋转、透视校正和数字噪声校正,并且可以检测图像中编码的条形码类型。

结论

总之,IronBarcode 是一款多功能的 .NET 软件库和 C# QR Code 生成器,可用于读取各种条形码格式,无论是截图、照片、扫描还是其他不完美的真实世界图像。

IronBarcode 是创建和识别条形码最有效的库之一。 在创建和识别 BarCode 方面,它也是最迅捷的库之一。 该库兼容不同的操作系统。 它易于设计,支持多种条形码格式。 此外,还要支持各种符号、格式和字符。

ZXing.NET 条形码是一个功能强大的库,可生成和识别各种图像格式的条形码。 我们可以阅读和创建各种格式的图像。 ZXing.NET 还允许您更改条形码的外观,改变其高度、宽度、条形码文本等。

与 ZXing.NET 相比,IronBarcode 软件包提供可靠的许可和支持。 IronBarcode的费用为$749。 虽然 ZXing 是免费的,但它不能用于商业用途,也缺乏全面的支持。 除了比 ZXing.NET 更为灵活之外,IronBarcode 解决方案还具有更多功能。 由此可见,IronBarcode 比 ZXing.NET 更具优势。

在比较识别和生成条形码的处理时间时,IronBarcode 优于 ZXing.NET。 IronBarcode 还具有多种特性,使我们能够从不同的图像格式和 PDF 文档中读取条形码。 它还允许我们在条形码或 QR 码内包含图像,这是其他任何库都不具备的。

IronBarcode 在早期开发阶段是免费的。 您可以获取用于生产级别或商业用途的免费试用。 根据开发人员的要求,IronBarcode 提供三个定价等级。 您可以选择最能满足您需求的解决方案。 现在,您可以用购买两件 Iron Software 产品的价格获得五件 Iron Software 产品的套件。 请访问此网站以获取更多信息。

乔尔迪·巴尔迪亚
乔尔迪·巴尔迪亚
软件工程师
Jordi 最擅长 Python、C# 和 C++,当他不在 Iron Software 运用技能时,他会进行游戏编程。作为产品测试、产品开发和研究的负责人之一,Jordi 为持续的产品改进增添了极大的价值。多样化的经验让他充满挑战和参与感,他说这是他在 Iron Software 工作中最喜欢的方面之一。Jordi 在佛罗里达州迈阿密长大,并在佛罗里达大学学习计算机科学和统计学。
< 前一页
ZXing解码器与IronBarcode的比较
下一步 >
IronBarcode与Aspose.Barcode的比较