跳至页脚内容
与其他组件比较

A Comparison between IronBarcode and OnBarcode

1.简介

什么是 BarCode? BarCode 是一种可通过扫描仪读取的正方形或长方形图像,由一系列宽度不等的平行黑线和白色间隙组成。 在产品上使用 BarCode 是为了便于识别。 除其他外,这些工具还用于零售商店的购买流程、仓库的库存跟踪以及发票上的会计核算。

您能使用 .NET 平台读取和生成 BarCode 吗? 是的,您可以使用 .NET 平台生成和读取 BarCode。 在本文中,我们将讨论开发人员如何用 .NET 平台支持的编程语言创建条形码并读取条形码。 我们将讨论和比较开发人员用来处理 BarCode 的两套软件。 这些工具如下:

  • OnBarcode
  • IronBarcode

2.条形码

OnBarcode是市场领先的条码生成器、读取器控件和组件的提供商,适用于所有主要的企业开发平台,包括ASP.NET、Windows Forms、WPF、Java、Android 和 iOS(iPhone 项目,Mac)。 OnBarcode 结合其主要报告条码工具、Microsoft Office (Excel & Word) 条码插件和条码字体,为构建商业应用程序提供全面的条码解决方案。

OnBarcode 软件提供多种与条码相关的功能,如生成条码图像、在 SQL Server 中打印条码图像、读取条码、完全在 Visual Studio C# 中编码、兼容最新的条码符号以及在 .NET Crystal Reports 中打印和绘制条码图像。 它还支持各种表示文本字符串的标准代码。

对于 OnBarcode,只有包含的后端(又名 ZINT 共享库)可在所有 .NET 平台上提供 QR 代码生成服务。 OnBarcode 还支持这些其他平台:

  • C#
  • ASP.NET
  • VB.NET
  • Java
  • 安卓
  • macOS

2.1.OnBarcode 的功能

生成 BarCode 类型

OnBarcode 工具条码编码库提供两种不同类型的条码生成器。

  • 1D / 线性条形码:对于这些类型的条形码,OnBarcode 提供不同类型的 1D 条形码,如 Codabar、Code 11、Code 2 of 5、Code 39、Code 93、Code 128、EAN 8、EAN 13 以及更多不同类型的条形码。
  • 二维/矩阵条码:OnBarcode 还提供不同类型的二维或矩阵条码。具体如下数据矩阵、PDF 417、QR 码、微型 PDF-417 和微型 QR 码。

OnBarcode 优于其他任何开源条码库,因为它提供对旋转条码的支持(可以创建 0、90、180 和 270 度的条码)。

.NET 技术 BarCode 生成器

编写时使用了 Visual Studio C# .NET 2005。 使用 VB.NET、C#、托管 C++ 和 Borland Delphi for .NET 绘制和打印条形码非常简单。条形码在内存中打印,然后编码成图像文件。

安装和部署

它支持 .NET2.0、3.0、3.5 或更高版本的 .NET 平台。 使用 Simple Xcopy Deployment 可以轻松部署 BarCode。 OnBarcode 还提供免版税的再分发服务。

条形码图像生成、编码和打印

这样,您就可以将条形码对象绘制到图像文件中,并将其编码为 GIF、BMP、PNG、JPEG 和 TIFF 图像格式。 它还支持不同的浏览器,如 Internet Explorer、Firefox、Chrome、Safari 和 Opera。 使用热敏打印机可以打印高质量的条形码图片。

3.IronBarcode

IronBarcode for .NET 是一个允许程序员读取和创建条形码的 .NET 库。 IronBarcode for .NET 是一个领先的 .NET 条码库,支持广泛的一维和二维条码,以及定制的(彩色和品牌)QR 码。 IronBarcode for .NET 允许开发人员使用所有与 .NET 相关的语言。

使用 IronBarcode 以图片形式创建、格式化和导出条形码非常简单,通常只需一行代码即可完成。

IronBarcode for .NET 支持 .NET Core 2x & 3x、.NET Standard、.NET Framework 4x 和 Full Azure。 它可以创建 postscript 输出,并接受各种转换文本字符串的标准代码。

3.1.IronBarcode 的功能

条形码格式

  • 二维矩阵条形码格式包括 QR Code、Aztec 和 Data Matrix .NET 读取和创建。
  • 支持文本、数字和二进制数据的现代线性条形码格式包括适用于 C# 的 PDF417、Code 39 和 Code 128 条形码生成器。
  • 仅支持数字代码的旧式线性条形码格式包括 UPC-A、UPC-E、EAN-8、EAN-13、Codabar、ITF、MSI 和 Plessey。

Barcode 阅读功能

  • IronBarCode.BarcodeReader 静态类 API 将条形码和 QR 码读取缩减为一行代码。
  • 支持从 Jpeg、Jpeg2000、Png、BMP、Tiff 和 Gif 图像格式文件中读取条形码。
  • 更高的准确性和性能。 为了提高精度和性能,指示阅读器扫描一、多个或所有条形码格式。
  • 读取 BarCode 的图像校正。 为了解释有缺陷的扫描和图像,请对文档应用噪声和对比度调整。

Barcode 书写功能

BarcodeWriter 和 QRCodeWriter 静态类用于创建容错条形码和 QR 写入 API。 条形码数据通常可以用两行代码提取出来。

IronBarcode 允许用户导出为图片、导出为 HTML 页面、导出为 PDF 或添加到现有 PDF 中。

QRCodeWriter 类为呈现具有高级功能的 QR 代码提供了高级支持。

4. 在 Visual Studio 中创建一个新项目

打开 Visual Studio 软件并转到文件菜单。 选择"新项目",然后选择控制台应用程序。

在适当的文本框中输入项目名称并选择路径。 然后,点击创建按钮。 根据下面的截图选择所需的 .NET Framework:

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 菜单中,转到工具-> 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 网站下载

第三种方法是直接从网站下载程序包。

  • Navigate to the Link.
  • 从右侧菜单中选择下载软件包选项。
  • 双击下载后的包。 它将自动安装。
  • 现在重新加载解决方案并开始在项目中使用。

5.4 直接从 IronBarcode 网站下载

Click the link to download the latest package from the website. After the download, follow the steps below to add the package to the project.

  • 从解决方案窗口中右键点击项目。
  • 然后,选择选项参考文献并浏览下载参考文献的位置。
  • 然后,单击确定以添加引用。

6.安装 OnBarcode SDK.

OnBarcode 提供多种安装选项,包括 NuGet 软件包。 OnBarcode 在 NuGet.org 上提供 OnBarcode.Barcode.Generator 和 OnBarcode.Barcode.Reader 等软件包。 OnBarcode 分别为条码生成器和条码阅读器提供服务。 You can install via NuGet Package Manager or download directly from this link for the barcode generator, and this link for the barcode reader. 要进行手动安装,请按照以下步骤操作:

  • 下载软件包后解压缩。
  • 在您的 ASP.NET 项目文件夹中,添加 OnBarcode.BarCode.ASPNET.dll. 无需将其放在 .NET bin 目录中,因为 Visual Studio 构建工具会将 DLL 复制到 .NET bin 目录中。
  • 在您的 ASP.NET 项目或网站中,请参考 OnBarcode.BarCode.ASPNET.dll.
  • ASP.NET Web 表单控件应添加到 ASP.NET Visual Studio 工具箱中。
  • 选择项目... 您可以从菜单中右键单击.NET Visual Studio 工具箱。
  • 从 "选择工具箱项目 "表单的 "浏览... "按钮中选择 DLL OnBarcode.Barcode.ASPNET.dll。
  • 选择后,进入 "组件 "区域,查找 LinearWebForm、DataMatrixWebForm、PDF417WebForm 和 QRCodeWebForm。
  • 选择所有四个组件后,它们将出现在您的 .NET Visual Studio 工具箱中。

7.二维码生成器

QR 码是条形码的二维变体,由黑白像素图案组成。

7.1.使用 OnBarcode SDK 的 QR 代码生成器

OnBarcode 的 .NET 条码生成控件可为 C# 应用程序生成和打印 QR 码和二维条码。 OnBarcode C# BarCode Generator 可轻松生成和创建 QR 代码。

以下代码展示了如何使用 OnBarcode 创建 QR 代码。

using System;
using OnBarcode.Barcode;
using System.Drawing.Imaging;

// Create a new QRCode instance
QRCode qrcode = new QRCode();
qrcode.Data = "ONBARCODE"; // Set the data to encode
qrcode.DataMode = QRCodeDataMode.AlphaNumeric; // Set data mode
qrcode.UOM = UnitOfMeasure.PIXEL; // Set unit of measure (Pixels)
qrcode.X = 3; // Module width
qrcode.Resolution = 72; // Image resolution
qrcode.Rotate = Rotate.Rotate0; // No rotation
qrcode.ImageFormat = ImageFormat.Gif; // Set image format

// Draw barcode (generate the QR code image)
qrcode.drawBarcode("C:\\qrcode.gif");
using System;
using OnBarcode.Barcode;
using System.Drawing.Imaging;

// Create a new QRCode instance
QRCode qrcode = new QRCode();
qrcode.Data = "ONBARCODE"; // Set the data to encode
qrcode.DataMode = QRCodeDataMode.AlphaNumeric; // Set data mode
qrcode.UOM = UnitOfMeasure.PIXEL; // Set unit of measure (Pixels)
qrcode.X = 3; // Module width
qrcode.Resolution = 72; // Image resolution
qrcode.Rotate = Rotate.Rotate0; // No rotation
qrcode.ImageFormat = ImageFormat.Gif; // Set image format

// Draw barcode (generate the QR code image)
qrcode.drawBarcode("C:\\qrcode.gif");
$vbLabelText   $csharpLabel

7.2.使用 IronBarcode 库的 QR 代码生成器

与创建普通条形码相比,Iron BarCode 在制作 QR 码时为开发人员提供了更多选择。 例如,我们可能会调整 QR 纠错量,决定添加彩色 QR 码或添加徽标。

在二维码中添加徽标时,徽标会自动缩小到合适的大小,以便二维码可以被读取,然后将其截取到网格中,使其与二维码图像上的黑白方格正确对齐。

简单的 QR 代码生成

using IronBarCode;

// Create and save a simple QR code
QRCodeWriter.CreateQrCode("hello world", 500, QRCodeWriter.QrErrorCorrectionLevel.Medium)
             .SaveAsPng("MyQR.png");
using IronBarCode;

// Create and save a simple QR code
QRCodeWriter.CreateQrCode("hello world", 500, QRCodeWriter.QrErrorCorrectionLevel.Medium)
             .SaveAsPng("MyQR.png");
$vbLabelText   $csharpLabel
Onbarcode Generator Alternatives 7 related to 7.2.使用 IronBarcode 库的 QR 代码生成器

高级 QR 代码生成

using IronBarCode;

// Create a QR code with a logo
var MyQRWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/csharp/barcode/", "visual-studio-logo.png", 500);

// Change the color of the QR code
MyQRWithLogo.ChangeBarCodeColor(System.Drawing.Color.DarkGreen);
using IronBarCode;

// Create a QR code with a logo
var MyQRWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/csharp/barcode/", "visual-studio-logo.png", 500);

// Change the color of the QR code
MyQRWithLogo.ChangeBarCodeColor(System.Drawing.Color.DarkGreen);
$vbLabelText   $csharpLabel
Onbarcode Generator Alternatives 8 related to 7.2.使用 IronBarcode 库的 QR 代码生成器

8.读取 BarCode.

阅读 BarCode 以获取隐藏在其中的信息会非常有用。 在本节中,我们将讨论这些工具如何读取不同的条形码。

8.1.使用 IronBarcode 读取条形码

条形码读取器是读取条形码的脚本。 IronBarCode命名空间的QuicklyReadOneBarcode函数是使用.NET Framework读取条码的一个极佳工具。 我们可以通过选择条码编码方案来显著提高速度,并且通过设置TryHarder选项为true来强制其自动调整透视角度和数字噪声。

QuicklyReadAllBarcodes方法类似,但它可以扫描多页文档如PDF和多页TIFF中的多个条码。

快速阅读一个条形码

using IronBarCode;

// Read a single barcode from an image file
BarcodeResult QRResult = BarcodeReader.QuicklyReadOneBarcode("QR.png");
using IronBarCode;

// Read a single barcode from an image file
BarcodeResult QRResult = BarcodeReader.QuicklyReadOneBarcode("QR.png");
$vbLabelText   $csharpLabel

尝试更难

using IronBarCode;

// Read a single barcode with more accuracy and noise correction
BarcodeResult QRBetterResult = BarcodeReader.QuicklyReadOneBarcode("QR.png", BarcodeEncoding.QRCode, true);
using IronBarCode;

// Read a single barcode with more accuracy and noise correction
BarcodeResult QRBetterResult = BarcodeReader.QuicklyReadOneBarcode("QR.png", BarcodeEncoding.QRCode, true);
$vbLabelText   $csharpLabel

快速读取所有条形码

using IronBarCode;

// Read all barcodes from a PDF or TIFF file
BarcodeResult[] PDFResults = BarcodeReader.QuicklyReadAllBarcodes("MultipleBarcodes.pdf", BarcodeEncoding.AllOneDimensional, true);
using IronBarCode;

// Read all barcodes from a PDF or TIFF file
BarcodeResult[] PDFResults = BarcodeReader.QuicklyReadAllBarcodes("MultipleBarcodes.pdf", BarcodeEncoding.AllOneDimensional, true);
$vbLabelText   $csharpLabel

8.2.使用 OnBarcode 读取条形码

在 Visual C# .NET 应用程序中,OnBarcode .NET BarCode Reader 是一个 C# .NET 组件 (DLL),用于读取和扫描条形码图像。

读取线性条形码

using OnBarcode.Barcode;
using System;

// Scan all Code39 barcodes from an image
String[] barcodes = BarcodeScanner.Scan("code39image.gif", BarcodeType.Code39);
using OnBarcode.Barcode;
using System;

// Scan all Code39 barcodes from an image
String[] barcodes = BarcodeScanner.Scan("code39image.gif", BarcodeType.Code39);
$vbLabelText   $csharpLabel

扫描图像中的定义区域

using OnBarcode.Barcode;
using System;
using System.Collections.Generic;

// Define a region to scan
List<SRegion> areas = new List<SRegion>();
SRegion area = new SRegion(0, 0, 50, 60);
areas.Add(area);

// Scan Code39 barcodes from defined regions in the image
string[] barcodes = BarcodeScanner.ScanRegions("code39image.gif", BarcodeType.Code39, areas);
using OnBarcode.Barcode;
using System;
using System.Collections.Generic;

// Define a region to scan
List<SRegion> areas = new List<SRegion>();
SRegion area = new SRegion(0, 0, 50, 60);
areas.Add(area);

// Scan Code39 barcodes from defined regions in the image
string[] barcodes = BarcodeScanner.ScanRegions("code39image.gif", BarcodeType.Code39, areas);
$vbLabelText   $csharpLabel

9. 许可

IronBarcode是一个提供开发者免费许可证的库。 IronBarcode还有一个不同的定价结构:Lite包从$liteLicense 开始,没有隐藏费用。 SaaS 和 OEM 产品的再分发也是可能的。 所有许可证都有30天退款保证、一年的软件支持和升级、开发/测试/生产有效性和永久许可证(一次性购买)。 To see IronBarcode's entire price structure and license, go here.

OnBarcode 阅读器和条码生成器不在一个软件包中提供。 这意味着您必须购买两个不同的软件包。

.NET BarCode Generator Suite 许可证

.NET BarCode Generator Suite 包括一套可靠的条形码控件,在 Visual Studio .NET 中使用非常简单。 在 .NET 应用程序中,您可以使用该套件来制作、打印和绘制高质量的条形码。

其支持线性和二维的单个开发者许可证起价为 $1,690,Unlimited 开发者许可证的价格为 $3,990。

  • 单个开发人员许可证:此许可证允许单个开发人员分发无限数量的用户许可证,无需支付许可证费用,并可在无限数量的服务器上安装适用于 .NET 的 BarCode 组件。
  • 5-开发者许可证:该许可证允许 5 位开发者分发无限数量的用户许可证,且无需支付版税,并可在无限数量的服务器上安装适用于 .NET 的 BarCode 组件。
  • Unlimited Developer License(无限开发者许可证):这允许无限开发者分发无限用户许可证,无需支付版税,并可在无限数量的服务器上安装适用于 .NET 的 BarCode 组件。

.NET BarCode 阅读器 SDK 许可证

  • 单服务器分发许可证:这允许您企业中无限数量的开发人员使用我们的 .NET BarCode Reader 并在单个服务器上部署衍生产品。
  • Three-Server Distribution License:该许可证允许贵公司不限数量的开发人员使用我们的 .NET BarCode Reader 并在三台服务器上部署衍生产品。
  • 五台服务器分发许可证:这允许贵公司不限数量的开发人员使用我们的 .NET BarCode 阅读器,并在最多五台服务器上部署衍生产品。
  • Unlimited-Server Distribution License(无限服务器分发许可证):该许可证允许贵组织内无限数量的开发人员使用我们的 .NET BarCode Reader,并将生成的产品部署到无限数量的服务器上。
  • Windows 应用程序分发许可证:这允许您组织内无限数量的开发人员使用我们的 .NET 条码阅读器,并在无限数量的机器(非服务器)上部署生成的产品。

10. 结论

IronBarcode for .NET 是一个领先的 .NET 条码库,允许程序员读取和创建条码。 它支持广泛的一维和二维 BarCode 以及自定义(彩色和品牌)二维码。 IronBarcode 允许开发人员使用所有与 .NET 相关的语言。 IronBarcode 提供在.NET环境中优化的高性能条形码读取和生成能力。 它支持 .NET Core 2x & 3x、.NET Standard、.NET Framework 4x 和 Full Azure 支持。

OnBarcode 是一家市场领先的条码生成器、阅读器控件和组件供应商,其产品适用于所有主要的企业开发平台,包括 ASP.NET、Windows 窗体、WPF、Java、Android 和 iOS(iPhone 项目、mac)。 该公司还提供与 Microsoft Office (Excel & Word) 条码插件和条码字体相结合的全套条码解决方案。 OnBarcode 软件提供与条形码相关的各种功能,如生成条形码图像、读取条形码、兼容最新的条形码符号以及在 .NET 中打印和绘图。 它支持各种表示文本字符串的标准代码。

与 OnBarcode 相比,IronBarcode 的定价结构相对更具成本效益。 IronBarcode 在单一许可证下提供所有功能,只需一次性购买,没有持续费用,而 OnBarcode 并不为其条码相关功能提供单一许可证,而是为条码生成和条码读取提供单独的许可证。 其单独授权策略使其价格比 IronBarcode 高出三倍,因此对用户缺乏吸引力。

经过比较,我们可以得出结论:IronBarcode 比 OnBarcode 提供更多的功能,同时,OnBarcode 也比 IronBarcode 昂贵得多。 这两个库均可通过 NuGet 软件包管理器获取,以便与 .NET 项目轻松集成。 对于 .NET 编程,IronBarcode 只需几行代码就能提供所有功能,这是其竞争对手无法提供的。除此之外,Iron Software 目前仅以两款软件的价格提供全部五款软件工具! 这五种工具如下:

  • IronBarcode
  • IronXL
  • IronOCR
  • IronPDF
  • IronWebScraper

Please visit this link to explore Iron Suite.

请注意OnBarcode是其各自所有者的注册商标。 本网站与 OnBarcode 无关,也未经其认可或赞助。 所有产品名称、徽标和品牌均为各自所有者的财产。 比较仅供参考,反映撰写时公开可用的信息。)}]

常见问题解答

OnBarcode 和 IronBarcode 之间有哪些主要区别?

OnBarcode 需要分别购买条码生成和读取的许可证,这可能增加成本,而 IronBarcode 则将所有功能集中在一个许可证下,使其更具性价比。IronBarcode 还可以通过 NuGet 包管理器轻松集成,并提供全面的自定义选项。

如何在 C# 应用程序中集成条码库?

IronBarcode 可以通过 Visual Studio 中的 NuGet 包管理器集成到 C# 应用程序中。这涉及在 NuGet 界面中搜索 IronBarcode 并将其直接安装到项目中。

使用 IronBarcode 可以生成哪些类型的条码?

IronBarcode 支持广泛的条码格式,包括 1D 和 2D 条码,如二维码、Code 39、Code 128 等。它还允许通过彩色二维码和徽标进行自定义。

是否有适用于 .NET 开发者的性价比高的条码生成解决方案?

是的,IronBarcode 为 .NET 开发者提供了一种经济高效的解决方案,单一许可证涵盖所有功能且没有持续费用,这与 OnBarcode 需要为不同功能单独购买许可证的情况不同。

如何在我的 .NET 应用程序中自定义二维码?

使用 IronBarcode,您可以轻松自定义二维码,通过改变颜色或添加徽标。这可以通过简单的代码调整来实现,从而实现视觉品牌的二维码。

在 .NET 中条码库的安装选项有哪些?

IronBarcode 可以通过 Visual Studio NuGet 包管理器安装,使过程简单快捷。或者,也可以从 Iron Software 网站下载软件包。

IronBarcode 可以用于条码的生成和读取吗?

是的,IronBarcode 设计用于生成和读取条码,在一个单一的库中提供完整的解决方案,不同于一些需要分别为每个任务使用不同工具的替代方案。

使用 IronBarcode 相对于其他条码库有哪些优势?

IronBarcode 提供简化的集成过程、大量的条码格式支持和自定义功能。通过单笔购买将所有功能捆绑在一起,呈现出一种经济上有利的许可模式。

Jordi Bardia
软件工程师
Jordi 最擅长 Python、C# 和 C++,当他不在 Iron Software 利用这些技能时,他就在游戏编程。分享产品测试、产品开发和研究的责任,Jordi 在持续的产品改进中增加了巨大的价值。多样的经验使他面临挑战并保持投入,他表示这是在 Iron Software 工作的最喜欢的方面之一。Jordi 在佛罗里达州迈阿密长大,并在佛罗里达大学学习计算机科学和统计学。

Iron Support Team

We're online 24 hours, 5 days a week.
Chat
Email
Call Me