与其他组件比较 A Comparison between IronBarcode and Aspose.Barcode Jordi Bardia 已更新:七月 28, 2025 下载 IronBarcode NuGet 下载 DLL 下载 免费试用 法学硕士副本 法学硕士副本 将页面复制为 Markdown 格式,用于 LLMs 在 ChatGPT 中打开 向 ChatGPT 咨询此页面 在双子座打开 向 Gemini 询问此页面 在双子座打开 向 Gemini 询问此页面 打开困惑 向 Perplexity 询问有关此页面的信息 分享 在 Facebook 上分享 分享到 X(Twitter) 在 LinkedIn 上分享 复制链接 电子邮件文章 条形码是数据的机器可读视觉表示。 条形码最初通过改变平行线的长度和间距来表示数据。 这些线性或一维(1D)条形码可以使用称为条形码阅读器的特殊光学扫描器扫描,这些扫描器有多种类型。后来,使用矩形、点、六边形和其他图案的二维(2D)变体被开发并称为矩阵码,尽管它们不使用条。 专门的二维光学扫描仪有多种配置,可以读取二维条形码。 连接到微型计算机的数码相机可以拍摄条形码的照片,而运行扫描二维条形码的软件会通过分析图像分解并解码条形码。 使用专用应用程序软件,具有内置摄像头的移动设备(如智能手机)可以充当后一种二维条形码扫描器。 在本文中,我们将比较两个流行的条形码库: Aspose.Barcode IronBarcode 这两个库都可以用于条形码的生成和识别。 支持所有.NET框架,并且可以轻松保存条形码图像。 功能特性 Aspose.Barcode Aspose.BarCode for .NET是一个复杂的工具,允许您从各种图片来源创建和识别1D和2D条形码。 开发人员可以将条形码创建和扫描功能简单地添加到.NET应用程序中。 它还允许将生成的条形码导出为多种高质量的图片格式,并提供用于创建新条形码和识别旧条形码的API。 支持超过60种不同的1D、2D和邮政条形码符号。 Aspose.BarCode for .NET允许您更改生成的条形码的背景色、条形颜色、旋转角度、x维度、图像质量、分辨率、标题、大小等。 该API还支持多种识别和图像功能以及各种符号。 Aspose允许我们使用少量代码生成和识别40多个条形码符号。 在任何角度读取条形码。 轻松将条形码标签打印到物理或虚拟打印机。 支持校验和和条形码补充数据。 提高了Code128编码。 设置条形码将被扫描的图像区域。 创建依赖于设备分辨率的图像。 识别格式和图像:JPEG、TIFF、PNG、BMP、GIF、EXIF 将条形码标签保存为图像:EMF、SVG 平台独立性、2D和邮政条形码。 开始使用 IronBarcode 是一个专为 .NET 框架设计的条码读取和写入库。 IronBarcode for .NET允许程序员从.NET应用程序和网站中读取和写入条形码和二维码。 IronBarcode只需一行代码即可读取或写入条形码。 .NET条形码库可以读取和写入大多数条形码和二维码标准。 Code 39/93/128, UPC A/E, EAN 8/13, ITF, RSS 14 / Expanded, Databar, CodaBar, Aztec, Data Matrix, MaxiCode, PDF417, MSI, Plessey, USPS和QR是一些最常见的。 条形码结果数据包括类型、文本、二进制数据、页面和图片文件。 IronBarcode的API功能如下: IronBarcode读取和写入大多数条形码类型和二维码标准,包括UPC A/E、EAN 8/13、Code 39/93/128、ITF、MSI、RSS 14/Expanded、Databar、CodaBar、QR、Styled QR、Data Matrix、MaxiCode、PDF417、Plessey和Aztec。 条形码数据、类型、页面、文本和结果提供的条形码图片非常适合存档或索引系统。 图像预处理提高读取速度和准确性 - IronBarcode自动预处理条形码图片以提高读取速度和准确性。 它可以读取扫描或实时视频帧,并且可以纠正旋转、噪声、失真和倾斜。 批处理服务器应用程序可以利用多个内核和线程。 自动在单页和多页文档中查找一个或多个条形码。 无需使用复杂的API,您可以搜索特定的条形码类型或文档位置。 设计用于.NET项目 - 只需几行代码即可快速启动并运行。 为.NET框架构建为一个无依赖项的单一DLL; 支持32位和64位,可以在任何.NET和dot net core语言中使用。 支持网络、云端、桌面和控制台应用程序中的移动和桌面设备。 为各种文档格式创建条形码和二维码 - 保存并打印到各种文件和流格式,包括PDF、JPG、TIFF、GIF、BMP、PNG和HTML。 颜色、质量、旋转、大小和文本都可以更改。 1. 创建新项目 打开Visual Studio,转到文件菜单,选择"新建项目",然后选择控制台应用程序/Windows窗体/WPF应用程序。 条形码也可以在所有类型的应用程序中使用。 您还可以使用Webform/MVC/MVC Core等应用程序。 输入项目名称,并在相应的文本框中选择文件路径。 然后,单击创建按钮并选择所需的dot net框架。 项目现在将生成所选应用程序的结构,并且如果您选择了控制台应用程序,它将打开program.cs文件,您可以在其中输入代码并构建/运行应用程序。 2. 安装条形码库 2.1 使用IronBarcode IronBarcode库可以通过四种方式下载和安装。 这些是: 使用Visual Studio 使用 Visual Studio 命令行 从NuGet网站直接下载 从IronBarcode网站直接下载 2.1.1 使用Visual Studio Visual Studio提供了NuGet包管理器选项,可以将包直接安装到解决方案中。 下面的截图显示了如何打开NuGet包管理器。 它提供了一个搜索框来显示NuGet网站上的包列表。在包管理器中,我们需要搜索关键字"Barcode",如下图所示: 从上述图像中,我们将获得相关搜索结果的列表。 我们需要选择所需的选项将包安装到解决方案中。 2.1.2 使用Visual Studio命令行 在Visual Studio中,转到工具 -> NuGet包管理器 -> 包管理器控制台。 在控制台选项卡中输入以下命令: Install-Package BarCode 现在,软件包将下载/安装到当前项目中,即可使用。 2.1.3 从NuGet网站直接下载 第三种方法是直接从网站下载程序包。 访问NuGet链接 从右侧菜单中选择下载包选项。 双击已下载的包。 它将自动安装。 接下来,重新加载解决方案并开始在项目中使用它。 2.1.4 从IronBarcode网站直接下载 点击此链接直接从网站下载最新包。下载后,按照以下步骤将包添加到项目中。 从解决方案窗口右键点击项目。 接下来,选择参考选项,然后浏览已下载参考的所在地。 然后,单击确定以添加参考。 2.2 使用 Aspose.BarCode Aspose.BarCode库可以通过四种方式下载和安装。 这些是: 使用Visual Studio 使用 Visual Studio 命令行 从NuGet网站直接下载 从Aspose网站直接下载 2.2.1 使用Visual Studio 这种方法类似于上面描述的IronBarcode方法。 我们只需更改搜索条件,如下图所示。 选择第一个选项将下载Aspose.Barcode库。 2.2.2 使用Visual Studio命令行 在Visual Studio中,转到工具 > NuGet包管理器 > 包管理器控制台 在包管理器控制台选项卡中输入以下行。 Install-Package Aspose.BarCode 现在,软件包将下载/安装到当前项目中,即可使用。 2.2.3 从NuGet网站直接下载 第三种方法是直接从网站下载程序包。 只需点击此处,它将重定向到NuGet网站,您可以在此下载包。 2.2.4 从Aspose网站直接下载 点击此链接,它将重定向到包版本列表,我们可以在其中选择所需的版本进行下载。 下载后,按照以下步骤将包添加到项目中。 从解决方案窗口右键点击项目。 接下来,选择参考选项,然后浏览已下载参考的所在地。 然后,单击确定以添加参考。 3. 条形码生成 使用IronBarcode和Aspose.Barcode可以轻松完成条形码生成。 让我们使用一个例子来看看。 3.1 使用IronBarcode IronBarcode可以用于创建可以以多种图像格式保存的条形码标签。 我们还可以传递我们需要生成的条形码类型。 以下是条形码生成的代码片段: using IronBarCode; // Create a barcode using IronBarcode var MyBarCode = BarcodeWriter.CreateBarcode("123456", BarcodeEncoding.Code128); // Add annotation text below the barcode MyBarCode.AddAnnotationTextBelowBarcode("123456"); // Save the barcode as a JPEG image MyBarCode.SaveAsImage("MyBarCode.jpeg"); using IronBarCode; // Create a barcode using IronBarcode var MyBarCode = BarcodeWriter.CreateBarcode("123456", BarcodeEncoding.Code128); // Add annotation text below the barcode MyBarCode.AddAnnotationTextBelowBarcode("123456"); // Save the barcode as a JPEG image MyBarCode.SaveAsImage("MyBarCode.jpeg"); Imports IronBarCode ' Create a barcode using IronBarcode Private MyBarCode = BarcodeWriter.CreateBarcode("123456", BarcodeEncoding.Code128) ' Add annotation text below the barcode MyBarCode.AddAnnotationTextBelowBarcode("123456") ' Save the barcode as a JPEG image MyBarCode.SaveAsImage("MyBarCode.jpeg") $vbLabelText $csharpLabel BarcodeWriter.CreateBarcode是IronBarcode库中可用的方法。 我们需要向CreateBarcode函数传递两个参数:要编码的文本和要生成的条形码类型。 调用此方法后,它返回一个条形码对象,可用于设置各种属性,例如添加注释文本和以不同格式保存图像。 // Create a QR code with a logo image var QRWithLogo = QRCodeWriter.CreateQrCodeWithLogo("Hello World", "logo.png", 500); // Change the color of the barcode to dark green QRWithLogo.ChangeBarCodeColor(System.Drawing.Color.DarkGreen); // Save the QR code with a logo as a JPEG image QRWithLogo.SaveAsJpeg("Logoqr.jpeg"); // Create a QR code with a logo image var QRWithLogo = QRCodeWriter.CreateQrCodeWithLogo("Hello World", "logo.png", 500); // Change the color of the barcode to dark green QRWithLogo.ChangeBarCodeColor(System.Drawing.Color.DarkGreen); // Save the QR code with a logo as a JPEG image QRWithLogo.SaveAsJpeg("Logoqr.jpeg"); ' Create a QR code with a logo image Dim QRWithLogo = QRCodeWriter.CreateQrCodeWithLogo("Hello World", "logo.png", 500) ' Change the color of the barcode to dark green QRWithLogo.ChangeBarCodeColor(System.Drawing.Color.DarkGreen) ' Save the QR code with a logo as a JPEG image QRWithLogo.SaveAsJpeg("Logoqr.jpeg") $vbLabelText $csharpLabel 上述示例演示了如何使用IronBarcode生成带有徽标图像的二维码。 CreateQrCodeWithLogo函数允许我们创建带有嵌入徽标的二维码,我们可以使用ChangeBarCodeColor方法更改条形码的颜色。 3.2 使用Aspose.Barcode Aspose.BarCode可用于条形码生成,我们可以使用以下代码片段生成不同的条形码类型: using Aspose.BarCode.Generation; // Create a BarcodeGenerator object and specify the barcode type and text BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.Code128, "123456"); // Save the generated barcode as a JPEG image generator.Save("output.jpg", BarCodeImageFormat.Jpeg); using Aspose.BarCode.Generation; // Create a BarcodeGenerator object and specify the barcode type and text BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.Code128, "123456"); // Save the generated barcode as a JPEG image generator.Save("output.jpg", BarCodeImageFormat.Jpeg); Imports Aspose.BarCode.Generation ' Create a BarcodeGenerator object and specify the barcode type and text Private generator As New BarcodeGenerator(EncodeTypes.Code128, "123456") ' Save the generated barcode as a JPEG image generator.Save("output.jpg", BarCodeImageFormat.Jpeg) $vbLabelText $csharpLabel 上面的代码使用Aspose.Barcode的BarcodeGenerator创建条形码。 我们通过构造函数指定条形码类型和文本。 Save方法允许我们将生成的条形码保存为所需的图像格式,例如JPEG。 Aspose.BarCode还支持使用Parameters.Barcode.XDimension.Millimeters属性自定义条的高度和宽度,以指定线条高度和宽度。 成果: 上述图像是这些库的性能比较。 时间以毫秒计算。 4. 识别条形码 IronBarcode和Aspose.Barcodes允许我们识别不同图像格式及其所属类型的条形码。 让我们详细看看。 4.1 使用IronBarcode IronBarcode帮助从不同的图像格式读取条形码,可以通过三种方式定义:字符串、流或图像,例如JPEG、TIFF、Bitmap等。下面的示例是使用字符串方法从图像读取条形码。 using IronBarCode; // Read a barcode from an image file BarcodeResult QRResult = BarcodeReader.QuicklyReadOneBarcode("MyBarCode.jpg"); if (QRResult != null) { // Output the barcode value and type Console.WriteLine(QRResult.Value); Console.WriteLine(QRResult.BarcodeType); } using IronBarCode; // Read a barcode from an image file BarcodeResult QRResult = BarcodeReader.QuicklyReadOneBarcode("MyBarCode.jpg"); if (QRResult != null) { // Output the barcode value and type Console.WriteLine(QRResult.Value); Console.WriteLine(QRResult.BarcodeType); } Imports IronBarCode ' Read a barcode from an image file Private QRResult As BarcodeResult = BarcodeReader.QuicklyReadOneBarcode("MyBarCode.jpg") If QRResult IsNot Nothing Then ' Output the barcode value and type Console.WriteLine(QRResult.Value) Console.WriteLine(QRResult.BarcodeType) End If $vbLabelText $csharpLabel 上面的代码片段使用IronBarcode的BarcodeReader从图像文件读取条形码。QuicklyReadOneBarcode方法从指定的图像中读取条形码并将其转换为BarcodeResult对象,该对象包含例如Value(编码文本)和BarcodeType(条形码类型)等属性。 4.2 使用Aspose.Barcode 在Aspose.BarCode for .NET中,用于条形码识别的源可以通过三种方式定义:图像文件、流或位图。实现细节是如何从JPEG格式文件中读取条形码。 using Aspose.BarCode.BarCodeRecognition; // Read a barcode using Aspose.BarCode using (BarCodeReader reader = new BarCodeReader(@"MyBarCode.jpg")) { // Iterate through recognized barcodes foreach (BarCodeResult result in reader.ReadBarCodes()) { // Output the barcode type and text Console.WriteLine("Type: " + result.CodeType); Console.WriteLine("CodeText: " + result.CodeText); } } using Aspose.BarCode.BarCodeRecognition; // Read a barcode using Aspose.BarCode using (BarCodeReader reader = new BarCodeReader(@"MyBarCode.jpg")) { // Iterate through recognized barcodes foreach (BarCodeResult result in reader.ReadBarCodes()) { // Output the barcode type and text Console.WriteLine("Type: " + result.CodeType); Console.WriteLine("CodeText: " + result.CodeText); } } Imports Aspose.BarCode.BarCodeRecognition ' Read a barcode using Aspose.BarCode Using reader As New BarCodeReader("MyBarCode.jpg") ' Iterate through recognized barcodes For Each result As BarCodeResult In reader.ReadBarCodes() ' Output the barcode type and text Console.WriteLine("Type: " & result.CodeType) Console.WriteLine("CodeText: " & result.CodeText) Next result End Using $vbLabelText $csharpLabel 上面的示例展示了如何使用Aspose.BarCode读取条形码。 BarCodeReader类用于使用路径作为参数读取条形码图像。 然后ReadBarCodes方法从图像中获取所有识别的条形码,foreach循环用于访问每个条形码结果,提供条形码类型和编码的文本。 5. 结论 IronBarcode是帮助我们生成和识别条形码功能最强大的库之一。 它也是生成和识别条形码最快的库之一。 该库受各种操作系统支持。 它支持多种条形码格式,创建也很简单。 用户可以更改颜色、线条高度、宽度、条形码文本等。授权详细信息可以在这里找到。 Aspose.BarCode也是一个强大的库,用于生成和读取不同图像格式的条形码。 我们可以使用各种图像格式进行读取和创建。 Aspose还提供了自定义条形码外观的选项,例如高度、宽度、条形码文本等。授权详细信息可以在这里找到。 IronBarcode确实在很多方面胜过Aspose.Barcode。 在比较条形码识别和生成的处理时间时,IronBarcode更快。 IronBarcode还具有各种属性,这不仅允许从不同的图像格式读取条形码,还允许从PDF文档中读取条形码。 用户可以在条形码和QR码中添加图像,这是许多库不可用的功能。 请注意Aspose 是其各自所有者的注册商标。 本网站与 Aspose 无关,也未得到 Aspose 的支持或赞助。 所有产品名称、徽标和品牌均为各自所有者的财产。 比较仅供参考,反映的是撰写时的公开信息。 常见问题解答 Aspose.Barcode 和 IronBarcode 有什么区别? Aspose.Barcode for .NET 支持超过 60 种条形码符号并允许广泛的自定义。IronBarcode 以其速度和简便性而闻名,提供读取 PDF 中条形码和自动图像预处理以提高准确度等功能。 如何在 C# 中使用 .NET 库生成条形码? 您可以通过调用 BarcodeWriter.CreateBarcode 方法来使用 IronBarcode 在 C# 中生成条形码,该方法允许您指定数据和条形码类型。条形码可以保存为多种格式,包括 JPEG、PNG 和 PDF。 是否可以使用 .NET 库从 PDF 中读取条形码? 是的,IronBarcode 提供从 PDF 中读取条形码的功能,提供在各种格式中处理条形码识别的灵活性。 如何在 .NET 项目中安装条形码库? 您可以通过在 Visual Studio 中使用 NuGet 包管理器,通过 Visual Studio 命令行,或直接从 NuGet 或 IronBarcode 网站下载来在 .NET 项目中安装 IronBarcode。 使用 IronBarcode 进行条形码生成的好处是什么? IronBarcode 提供快速处理时间,支持多种条形码标准,并包括先进的功能,如自动图像预处理和将图像嵌入条形码的能力。 可以使用 .NET 库自定义条形码的外观吗? 是的,Aspose.Barcode 和 IronBarcode 都允许自定义条形码外观,包括颜色、大小和嵌入文本的调整。 使用 .NET 库可以保存条形码为哪些图像格式? IronBarcode 允许您将条形码保存为各种图像格式,如 JPEG、TIFF、PNG、BMP 和 GIF,以及 PDF 和 HTML 格式。 .NET 条形码库兼容哪些平台? IronBarcode 支持 32 位和 64 位 .NET 和 .NET Core 框架,且可以用于移动和桌面设备上的网络、云、桌面和控制台应用程序。 Jordi Bardia 立即与工程团队聊天 软件工程师 Jordi 最擅长 Python、C# 和 C++,当他不在 Iron Software 利用这些技能时,他就在游戏编程。分享产品测试、产品开发和研究的责任,Jordi 在持续的产品改进中增加了巨大的价值。多样的经验使他面临挑战并保持投入,他表示这是在 Iron Software 工作的最喜欢的方面之一。Jordi 在佛罗里达州迈阿密长大,并在佛罗里达大学学习计算机科学和统计学。 相关文章 已更新九月 25, 2025 How to Choose the Best Barcode Library in C# 在本指南中,我们将比较五个最广泛使用的 .NET 条形码库——IronBarcode、http://ZXing.Net、Aspose.BarCode、BarcodeLib 和 Dynamsoft Barcode Reader。 阅读更多 已更新七月 28, 2025 How to Scan Barcodes in ZXing For C# Developers The core image decoding library, JavaSE-specific client code, and the Android client Barcode Scanner are only a few of the modules that make up ZXing. Numerous more independent open-source projects are built upon it. 阅读更多 已更新八月 31, 2025 ZXing.org QR Code Library and IronBarcode: A Comprehensive Comparison ZXing是一个流行的开源库,用于生成和解码一维和二维条形码。 阅读更多 A Comparison between IronBarcode and ZXing.NETA Comparison between IronBarcode an...
已更新九月 25, 2025 How to Choose the Best Barcode Library in C# 在本指南中,我们将比较五个最广泛使用的 .NET 条形码库——IronBarcode、http://ZXing.Net、Aspose.BarCode、BarcodeLib 和 Dynamsoft Barcode Reader。 阅读更多
已更新七月 28, 2025 How to Scan Barcodes in ZXing For C# Developers The core image decoding library, JavaSE-specific client code, and the Android client Barcode Scanner are only a few of the modules that make up ZXing. Numerous more independent open-source projects are built upon it. 阅读更多
已更新八月 31, 2025 ZXing.org QR Code Library and IronBarcode: A Comprehensive Comparison ZXing是一个流行的开源库,用于生成和解码一维和二维条形码。 阅读更多