Saltar al pie de página
COMPARAR CON OTROS COMPONENTES

Una Comparación entre IronBarcode y Leadtools Barcode

A barcode is a machine-readable visual representation of data, initially expressed through parallel lines of varying lengths and spacings. These types of barcodes can be scanned with optical scanners called barcode readers. With time, 2D barcodes were introduced, which use various shapes instead of lines and can be read with digital cameras or mobile devices equipped with appropriate software. In this article, we will compare two popular barcode libraries: Leadtools Barcode and IronBarcode. Both libraries support .NET frameworks and facilitate barcode image generation and recognition.

Leadtools Barcode

The LEADTOOLS Barcode SDK is a comprehensive toolkit for developers to detect, read, and generate various types of 1D and 2D barcodes. It supports multiple programming languages like .NET Framework, .NET Core, Xamarin, UWP, C++ Class Library, C#, VB, Java, etc. LEADTOOLS offers both SOAP and RESTful web services to manage barcodes across different platforms.

IronBarcode

IronBarcode for .NET provides a straightforward API to read and write barcodes and QR codes within .NET applications. It supports various types of barcodes and QR standards and offers image pre-processing to enhance reading speeds and accuracy. Designed for .NET projects, it allows for quick integration with minimal code.

Creating a New Project

In Visual Studio, you can create a new Console/WPF/Windows Forms application to work with these libraries. After setting up the project, proceed with integrating the library of your choice.

Install the IronBarcode Library

Using IronBarcode

There are several ways to download and install IronBarcode:

  • Via Visual Studio or the Visual Studio Command-Line
  • Direct download from the NuGet or IronBarcode websites

For example, using the Visual Studio Command-Line, you can enter the following command:

Install-Package BarCode

Using Leadtools Barcode

Similarly, Leadtools Barcode can be installed via similar methods. Use the command for command-line installation:

Install-Package Leadtools.Barcode

Barcode Generation

Both libraries facilitate easy barcode generation. Here are examples for each:

Using IronBarcode

// Create a barcode and save it as an image format
var MyBarCode = BarcodeWriter.CreateBarcode("123456", BarcodeEncoding.Code128);
MyBarCode.AddAnnotationTextBelowBarcode("123456");
MyBarCode.SaveAsImage("MyBarCode.jpeg");
// Create a barcode and save it as an image format
var MyBarCode = BarcodeWriter.CreateBarcode("123456", BarcodeEncoding.Code128);
MyBarCode.AddAnnotationTextBelowBarcode("123456");
MyBarCode.SaveAsImage("MyBarCode.jpeg");
' Create a barcode and save it as an image format
Dim MyBarCode = BarcodeWriter.CreateBarcode("123456", BarcodeEncoding.Code128)
MyBarCode.AddAnnotationTextBelowBarcode("123456")
MyBarCode.SaveAsImage("MyBarCode.jpeg")
$vbLabelText   $csharpLabel

The above code generates a barcode object using the specified parameters and saves it as an image.

Using Leadtools Barcode

// Create and save a barcode using Leadtools
barcodeEngineInstance.Writer.CalculateBarcodeDataBounds(
    LeadRect.Empty, 
    imageResolution, 
    imageResolution, 
    qrData, 
    qrWriteOptions
);

imageHeight = qrData.Bounds.Height;
imageWidth = qrData.Bounds.Width;

barcodeImage = new RasterImage(
    RasterMemoryFlags.Conventional, 
    imageWidth, 
    imageHeight, 
    bitsPerPixel, 
    RasterByteOrder.Rgb, 
    RasterViewPerspective.TopLeft, 
    palette, 
    IntPtr.Zero, 
    userDataLength
);

FillCommand fillCmd = new FillCommand(RasterColor.White);
fillCmd.Run(barcodeImage);

barcodeEngineInstance.Writer.WriteBarcode(
    barcodeImage, 
    qrData, 
    qrWriteOptions
);
codecs.Save(
    barcodeImage, 
    barcodeOutputStream, 
    RasterImageFormat.CcittGroup4, 
    bitsPerPixel
);
// Create and save a barcode using Leadtools
barcodeEngineInstance.Writer.CalculateBarcodeDataBounds(
    LeadRect.Empty, 
    imageResolution, 
    imageResolution, 
    qrData, 
    qrWriteOptions
);

imageHeight = qrData.Bounds.Height;
imageWidth = qrData.Bounds.Width;

barcodeImage = new RasterImage(
    RasterMemoryFlags.Conventional, 
    imageWidth, 
    imageHeight, 
    bitsPerPixel, 
    RasterByteOrder.Rgb, 
    RasterViewPerspective.TopLeft, 
    palette, 
    IntPtr.Zero, 
    userDataLength
);

FillCommand fillCmd = new FillCommand(RasterColor.White);
fillCmd.Run(barcodeImage);

barcodeEngineInstance.Writer.WriteBarcode(
    barcodeImage, 
    qrData, 
    qrWriteOptions
);
codecs.Save(
    barcodeImage, 
    barcodeOutputStream, 
    RasterImageFormat.CcittGroup4, 
    bitsPerPixel
);
' Create and save a barcode using Leadtools
barcodeEngineInstance.Writer.CalculateBarcodeDataBounds(LeadRect.Empty, imageResolution, imageResolution, qrData, qrWriteOptions)

imageHeight = qrData.Bounds.Height
imageWidth = qrData.Bounds.Width

barcodeImage = New RasterImage(RasterMemoryFlags.Conventional, imageWidth, imageHeight, bitsPerPixel, RasterByteOrder.Rgb, RasterViewPerspective.TopLeft, palette, IntPtr.Zero, userDataLength)

Dim fillCmd As New FillCommand(RasterColor.White)
fillCmd.Run(barcodeImage)

barcodeEngineInstance.Writer.WriteBarcode(barcodeImage, qrData, qrWriteOptions)
codecs.Save(barcodeImage, barcodeOutputStream, RasterImageFormat.CcittGroup4, bitsPerPixel)
$vbLabelText   $csharpLabel

This snippet involves generating a barcode and saving it into a desired image format.

Recognize Barcodes

Both libraries support barcode recognition across various image formats.

Using IronBarcode

BarcodeResult QRResult = BarcodeReader.QuicklyReadOneBarcode("MyBarCode.jpg");
if (QRResult != null)
{
    Console.WriteLine(QRResult.Value);
    Console.WriteLine(QRResult.BarcodeType);
}
BarcodeResult QRResult = BarcodeReader.QuicklyReadOneBarcode("MyBarCode.jpg");
if (QRResult != null)
{
    Console.WriteLine(QRResult.Value);
    Console.WriteLine(QRResult.BarcodeType);
}
Dim QRResult As BarcodeResult = BarcodeReader.QuicklyReadOneBarcode("MyBarCode.jpg")
If QRResult IsNot Nothing Then
	Console.WriteLine(QRResult.Value)
	Console.WriteLine(QRResult.BarcodeType)
End If
$vbLabelText   $csharpLabel

This reads a barcode from an image and outputs its value and type.

Using Leadtools Barcode

using (BarCodeReader reader = new BarCodeReader(@"MyBarCode.jpg"))
{
    foreach (BarCodeResult result in reader.ReadBarCodes())
    {
        Console.WriteLine("Type: " + result.CodeType);
        Console.WriteLine("CodeText: " + result.CodeText);
    }
}
using (BarCodeReader reader = new BarCodeReader(@"MyBarCode.jpg"))
{
    foreach (BarCodeResult result in reader.ReadBarCodes())
    {
        Console.WriteLine("Type: " + result.CodeType);
        Console.WriteLine("CodeText: " + result.CodeText);
    }
}
Using reader As New BarCodeReader("MyBarCode.jpg")
	For Each result As BarCodeResult In reader.ReadBarCodes()
		Console.WriteLine("Type: " & result.CodeType)
		Console.WriteLine("CodeText: " & result.CodeText)
	Next result
End Using
$vbLabelText   $csharpLabel

This example uses BarCodeReader to extract barcode data from an image file.

Licensing and Pricing

IronBarcode

IronBarcode offers a range of licensing options starting from a Lite License to an Unlimited License, with pricing dependent on developer, location, and project use. They provide a perpetual license with free updates and support.

Leadtools

Leadtools offers several packages with pricing based on user requirements. Their pricing starts from $1,295 per year for a single developer license.

Conclusion

Both Leadtools Barcode and IronBarcode are robust libraries for barcode manipulation. IronBarcode, however, provides faster processing, is more affordable, and includes additional features that make it particularly versatile for reading both static images and PDFs. It's highly recommended to take advantage of the free trial to ascertain suitability for your needs.

Start your journey in barcode scanning and creation with ease!

Por favor notaLeadtools Barcode is a registered trademark of its respective owner. This site is not affiliated with, endorsed by, or sponsored by Leadtools Barcode. All product names, logos, and brands are property of their respective owners. Comparisons are for informational purposes only and reflect publicly available information at the time of writing.

Preguntas Frecuentes

¿Cuál es la diferencia entre IronBarcode y Leadtools Barcode?

IronBarcode ofrece una API simplificada para aplicaciones .NET, centrándose en la velocidad y la facilidad de integración, mientras que Leadtools Barcode proporciona un conjunto de herramientas completo para múltiples lenguajes de programación y servicios web multiplataforma.

¿Cómo instalo una biblioteca de códigos de barras en Visual Studio?

Para instalar IronBarcode en Visual Studio, use el Administrador de paquetes NuGet con el comando: PM> Install-Package Barcode. También puede descargarlo directamente desde la Galería NuGet o el sitio web oficial de IronBarcode.

¿Cómo puedo generar un código de barras en C#?

Puede generar un código de barras en C# usando IronBarcode creando un objeto BarcodeWriter, configurando el tipo de código de barras y contenido deseados, y guardando el resultado como una imagen usando el método SaveAsImage.

¿Qué opciones de licencia están disponibles para IronBarcode?

IronBarcode ofrece varias opciones de licencia, incluidas las licencias Lite y Unlimited. Los precios varían según el número de desarrolladores, el tipo de proyecto y la ubicación, con una licencia perpetua que incluye actualizaciones y soporte gratuitos.

¿Leadtools Barcode admite múltiples lenguajes de programación?

Sí, Leadtools Barcode admite múltiples lenguajes, incluidos .NET Framework, .NET Core, Xamarin, UWP, C++, C#, VB y Java, lo que lo hace versátil para varios entornos de desarrollo.

¿Cuál es el precio inicial de una licencia de Leadtools Barcode?

El precio inicial de una licencia de Leadtools Barcode es de $1295 por año para una licencia de un solo desarrollador.

¿Cómo puedo leer códigos de barras usando IronBarcode?

Para leer códigos de barras con IronBarcode, use el método BarcodeReader.QuicklyReadOneBarcode para extraer los datos del código de barras y su tipo de una imagen.

¿Por qué elegir IronBarcode sobre Leadtools Barcode?

IronBarcode es elogiado por sus capacidades de procesamiento más rápidas, asequibilidad y características adicionales para leer imágenes estáticas y PDFs, lo que lo convierte en una opción versátil y eficiente para proyectos .NET.

¿Tanto IronBarcode como Leadtools Barcode admiten códigos de barras 2D?

Sí, ambas bibliotecas admiten la generación y el reconocimiento de códigos de barras 1D y 2D, proporcionando flexibilidad para diversas aplicaciones.

Jordi Bardia
Ingeniero de Software
Jordi es más competente en Python, C# y C++. Cuando no está aprovechando sus habilidades en Iron Software, está programando juegos. Compartiendo responsabilidades para pruebas de productos, desarrollo de productos e investigación, Jordi agrega un valor inmenso a la mejora continua del producto. La experiencia variada lo mantiene ...
Leer más