C# + VB.NET: 条码快速入门 条码快速入门
using IronBarCode;
using System.Drawing;

// Reading a barcode is easy with IronBarcode!
var resultFromFile = BarcodeReader.Read(@"file/barcode.png"); // From a file
var resultFromBitMap = BarcodeReader.Read(new Bitmap("barcode.bmp")); // From a bitmap
var resultFromImage = BarcodeReader.Read(Image.FromFile("barcode.jpg")); // From an image
var resultFromPdf = BarcodeReader.ReadPdf(@"file/mydocument.pdf"); // From PDF use ReadPdf

// To configure and fine-tune barcode reading, utilize the BarcodeReaderOptions class
var myOptionsExample = new BarcodeReaderOptions
{
    // Choose a reading speed from: Faster, Balanced, Detailed, ExtremeDetail
    // There is a tradeoff in performance as more detail is set
    Speed = ReadingSpeed.Balanced,

    // Reader will stop scanning once a single barcode is found (if set to true)
    ExpectMultipleBarcodes = true,

    // By default, all barcode formats are scanned for
    // Specifying a subset of barcode types to search for would improve performance
    ExpectBarcodeTypes = BarcodeEncoding.AllOneDimensional,

    // Utilize multiple threads to read barcodes from multiple images in parallel
    Multithreaded = true,

    // Maximum threads for parallelized barcode reading
    // Default is 4
    MaxParallelThreads = 2,

    // The area of each image frame in which to scan for barcodes
    // Specifying a crop area will significantly improve performance and avoid noisy parts of the image
    CropArea = new Rectangle(),

    // Special setting for Code39 barcodes
    // If a Code39 barcode is detected, try to read with both the base and extended ASCII character sets
    UseCode39ExtendedMode = true
};

// Read with the options applied
var results = BarcodeReader.Read("barcode.png", myOptionsExample);

// Create a barcode with one line of code
var myBarcode = BarcodeWriter.CreateBarcode("12345", BarcodeWriterEncoding.EAN8);

// After creating a barcode, we may choose to resize
myBarcode.ResizeTo(400, 100);

// Save our newly-created barcode as an image
myBarcode.SaveAsImage("EAN8.jpeg");

Image myBarcodeImage = myBarcode.Image; // Can be used as Image
Bitmap myBarcodeBitmap = myBarcode.ToBitmap(); // Can be used as Bitmap
Imports IronBarCode
Imports System.Drawing

' Reading a barcode is easy with IronBarcode!
Private resultFromFile = BarcodeReader.Read("file/barcode.png") ' From a file
Private resultFromBitMap = BarcodeReader.Read(New Bitmap("barcode.bmp")) ' From a bitmap
Private resultFromImage = BarcodeReader.Read(Image.FromFile("barcode.jpg")) ' From an image
Private resultFromPdf = BarcodeReader.ReadPdf("file/mydocument.pdf") ' From PDF use ReadPdf

' To configure and fine-tune barcode reading, utilize the BarcodeReaderOptions class
Private myOptionsExample = New BarcodeReaderOptions With {
	.Speed = ReadingSpeed.Balanced,
	.ExpectMultipleBarcodes = True,
	.ExpectBarcodeTypes = BarcodeEncoding.AllOneDimensional,
	.Multithreaded = True,
	.MaxParallelThreads = 2,
	.CropArea = New Rectangle(),
	.UseCode39ExtendedMode = True
}

' Read with the options applied
Private results = BarcodeReader.Read("barcode.png", myOptionsExample)

' Create a barcode with one line of code
Private myBarcode = BarcodeWriter.CreateBarcode("12345", BarcodeWriterEncoding.EAN8)

' After creating a barcode, we may choose to resize
myBarcode.ResizeTo(400, 100)

' Save our newly-created barcode as an image
myBarcode.SaveAsImage("EAN8.jpeg")

Dim myBarcodeImage As Image = myBarcode.Image ' Can be used as Image
Dim myBarcodeBitmap As Bitmap = myBarcode.ToBitmap() ' Can be used as Bitmap

IronBarcode支持多种标准格式,包括图像文件(jpeg、png 和 jpg)到更具编程性质的格式中,例如位图,您可能希望在这些格式中传递变量。此外,它还支持诸如PDF之类的外部格式,使IronBarcode能够无缝集成。

在任何代码库中,为开发人员提供文件格式和变量的灵活性。

除了作为所有文件格式的条码读取器外,IronBarcode 还兼作条码生成器,支持所有标准编码和格式,如 EAN8Code128Code39。 设置条形码生成器只需两行代码。 IronBarcode 是所有与条形码相关情况的首选,因其入门门槛低,并提供开发人员丰富的自定义选项。

条码写入器

我们首先导入IronBarcodeSystem.Drawing,然后实例化BarcodeWriter以创建格式为EAN8、字符串值为12345的条形码。 然后我们将生成的条形码保存为所需格式的图像。 由于IronBarcode支持将条形码创建为Image以及Bitmap,因此有各种选项可供选择。

高级条码写入器

如上所见,使用IronBarcode生成条形码仅需两行代码,并将其保存为文件以便日后使用。 IronBarcode 通过为开发人员提供大量选项来进一步扩展此功能,以自定义条形码以适应不同的情况。

我们可以使用ResizeTo方法并传入高度和宽度来调整条形码图像的大小。

BarCode 阅读器

与上述类似,我们首先实例化BarcodeReader,将文件路径传递给Read方法,并将其保存为一个变量以供以后使用和操作条形码对象。 有指定方法可以使用 ReadPDF 读取外部格式,如 PDF。 然而,对于常规图像格式和位图,我们会使用 Read

条码阅读器选项

IronBarcode 允许开发人员从标准文件格式扫描条形码。 然而,在某些情况下,开发人员希望对Read方法的行为进行微调,尤其是在程序化读取一批条形码文件的情况下。 这就是BarcodeReaderOptions发挥作用的地方。 IronPDF允许您完全自定义,如通过Speed调整其读取速度,使用ExpectedMultipleBarcodes设置文件上是否期望有多个条形码,以及通过属性ExpectBarcodeTypes设置他们是什么类型的条形码。 允许开发人员运行多个线程以并行读取多个图像中的条形码,以及在进行并行读取时使用的线程数量。

以下只是展示IronBarcode功能的一些属性,完整列表请参阅文档。这里 点击此处查看操作指南,包括示例、示例代码和文件。

C# + VB.NET: 不完美的条形码和图像校正 不完美的条形码和图像校正
using IronBarCode;
using IronSoftware.Drawing;

// Choose which filters are to be applied (in order)
// Set cacheAtEachIteration = true to save the intermediate image data after each filter is applied
var filtersToApply = new ImageFilterCollection(cacheAtEachIteration: true) {
    new SharpenFilter(),
    new InvertFilter(),
    new ContrastFilter(),
    new BrightnessFilter(),
    new AdaptiveThresholdFilter(),
    new BinaryThresholdFilter(),
    new GaussianBlurFilter(),
    new MedianBlurFilter(),
    new BilateralFilter()
};

BarcodeReaderOptions myOptionsExample = new BarcodeReaderOptions()
{
    // Set chosen filters in BarcodeReaderOptions
    ImageFilters = filtersToApply,

    Speed = ReadingSpeed.Balanced,
    ExpectMultipleBarcodes = true,
};

// Read with the options applied
BarcodeResults results = BarcodeReader.Read("screenshot.png", myOptionsExample);

AnyBitmap[] filteredImages = results.FilterImages();

// Export intermediate image files to disk
for (int i = 0 ; i < filteredImages.Length ; i++)
    filteredImages[i].SaveAs($"{i}_barcode.png");

// Or
results.ExportFilterImagesToDisk("filter-result.jpg");
Imports IronBarCode
Imports IronSoftware.Drawing

' Choose which filters are to be applied (in order)
' Set cacheAtEachIteration = true to save the intermediate image data after each filter is applied
Private filtersToApply = New ImageFilterCollection(cacheAtEachIteration:= True) From {
	New SharpenFilter(),
	New InvertFilter(),
	New ContrastFilter(),
	New BrightnessFilter(),
	New AdaptiveThresholdFilter(),
	New BinaryThresholdFilter(),
	New GaussianBlurFilter(),
	New MedianBlurFilter(),
	New BilateralFilter()
}

Private myOptionsExample As New BarcodeReaderOptions() With {
	.ImageFilters = filtersToApply,
	.Speed = ReadingSpeed.Balanced,
	.ExpectMultipleBarcodes = True
}

' Read with the options applied
Private results As BarcodeResults = BarcodeReader.Read("screenshot.png", myOptionsExample)

Private filteredImages() As AnyBitmap = results.FilterImages()

' Export intermediate image files to disk
For i As Integer = 0 To filteredImages.Length - 1
	filteredImages(i).SaveAs($"{i}_barcode.png")
Next i

' Or
results.ExportFilterImagesToDisk("filter-result.jpg")

IronBarcode 提供许多图像预处理过滤器供您选择,这些过滤器可在 BarcodeReaderOptions 中轻松应用。 选择可提高图像阅读效果的滤镜,如锐化二进制阈值对比度。 请记住,您选择的顺序就是它们的应用顺序。

可以选择保存应用了每个过滤器的中间图像的图像数据。 这可以通过 ImageFilterCollectionSaveAtEachIteration 属性进行切换。

C# + VB.NET: 创建条形码图像 创建条形码图像
using IronBarCode;
using System.Drawing;

/*** CREATING BARCODE IMAGES ***/

// Create and save a barcode in a single line of code
BarcodeWriter.CreateBarcode("12345", BarcodeWriterEncoding.EAN8).ResizeTo(400, 100).SaveAsImage("EAN8.jpeg");

/*****  IN-DEPTH BARCODE CREATION OPTIONS *****/

// BarcodeWriter.CreateBarcode creates a GeneratedBarcode which can be styled and exported as an Image object or file
GeneratedBarcode MyBarCode = BarcodeWriter.CreateBarcode("Any Number, String or Binary Value", BarcodeWriterEncoding.Code128);

// Style the Barcode in a fluent LINQ-style fashion
MyBarCode.ResizeTo(300, 150).SetMargins(20).AddAnnotationTextAboveBarcode("Example EAN8 Barcode").AddBarcodeValueTextBelowBarcode();
MyBarCode.ChangeBackgroundColor(Color.LightGoldenrodYellow);

// Save the barcode as an image file
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");

// Save the barcode as a .NET native object
Image MyBarCodeImage = MyBarCode.Image;
Bitmap MyBarCodeBitmap = MyBarCode.ToBitmap();

byte[] PngBytes = MyBarCode.ToPngBinaryData();

using (System.IO.Stream PdfStream = MyBarCode.ToPdfStream())
{
    // Stream barcode image output also works for GIF, JPEG, PDF, PNG, BMP and TIFF
}

// Save MyBarCode as an HTML file or tag
MyBarCode.SaveAsHtmlFile("MyBarCode.Html");
string ImgTagForHTML = MyBarCode.ToHtmlTag();
string DataURL = MyBarCode.ToDataUrl();

// Save MyBarCode to a new PDF, or stamp it in any position on any page(s) of an existing document
MyBarCode.SaveAsPdf("MyBarCode.Pdf");
MyBarCode.StampToExistingPdfPage("ExistingPDF.pdf", 200, 50, 1);  // Position (200, 50) on page 1
MyBarCode.StampToExistingPdfPages("ExistingPDF.pdf", 200, 50, new[] { 1, 2, 3 }, "Password123");  // Multiple pages of an encrypted PDF
Imports IronBarCode
Imports System.Drawing

'''* CREATING BARCODE IMAGES **

' Create and save a barcode in a single line of code
BarcodeWriter.CreateBarcode("12345", BarcodeWriterEncoding.EAN8).ResizeTo(400, 100).SaveAsImage("EAN8.jpeg")

'''***  IN-DEPTH BARCODE CREATION OPTIONS ****

' BarcodeWriter.CreateBarcode creates a GeneratedBarcode which can be styled and exported as an Image object or file
Dim MyBarCode As GeneratedBarcode = BarcodeWriter.CreateBarcode("Any Number, String or Binary Value", BarcodeWriterEncoding.Code128)

' Style the Barcode in a fluent LINQ-style fashion
MyBarCode.ResizeTo(300, 150).SetMargins(20).AddAnnotationTextAboveBarcode("Example EAN8 Barcode").AddBarcodeValueTextBelowBarcode()
MyBarCode.ChangeBackgroundColor(Color.LightGoldenrodYellow)

' Save the barcode as an image file
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")

' Save the barcode as a .NET native object
Dim MyBarCodeImage As Image = MyBarCode.Image
Dim MyBarCodeBitmap As Bitmap = MyBarCode.ToBitmap()

Dim PngBytes() As Byte = MyBarCode.ToPngBinaryData()

Using PdfStream As System.IO.Stream = MyBarCode.ToPdfStream()
	' Stream barcode image output also works for GIF, JPEG, PDF, PNG, BMP and TIFF
End Using

' Save MyBarCode as an HTML file or tag
MyBarCode.SaveAsHtmlFile("MyBarCode.Html")
Dim ImgTagForHTML As String = MyBarCode.ToHtmlTag()
Dim DataURL As String = MyBarCode.ToDataUrl()

' Save MyBarCode to a new PDF, or stamp it in any position on any page(s) of an existing document
MyBarCode.SaveAsPdf("MyBarCode.Pdf")
MyBarCode.StampToExistingPdfPage("ExistingPDF.pdf", 200, 50, 1) ' Position (200, 50) on page 1
MyBarCode.StampToExistingPdfPages("ExistingPDF.pdf", 200, 50, { 1, 2, 3 }, "Password123") ' Multiple pages of an encrypted PDF

在这个例子中,我们看到可以创建、调整大小并保存许多不同类型和格式的条形码。 甚至可能只用一行代码。

使用我们流畅的 API,生成的条形码类可用于设置边距、调整大小和注释条形码。 这些文件可以保存为图像,IronBarcode 会根据文件名自动生成正确的图像类型: GIF、HTML 文件、HTML 标记、JPEG、PDF、PNG、TIFF 和 Windows 位图

我们还提供了 StampToExistingPdfPage 方法,允许生成条形码并将其盖章到现有的PDF上。 编辑通用PDF或通过条形码向文档添加内部识别号时,这非常有用。

C# + VB.NET: 条码样式与注释 条码样式与注释
using IronBarCode;
using System;
using System.Drawing;

/*** STYLING GENERATED BARCODES  ***/

// BarcodeWriter.CreateBarcode creates a GeneratedBarcode object which allows the barcode to be styled and annotated.
GeneratedBarcode MyBarCode = BarcodeWriter.CreateBarcode("Iron Software", BarcodeWriterEncoding.QRCode);

// Any text (or commonly, the value of the barcode) can be added to the image in a default or specified font.
// Text positions are automatically centered, above or below. Fonts that are too large for a given image are automatically scaled down.
MyBarCode.AddBarcodeValueTextBelowBarcode();
MyBarCode.AddAnnotationTextAboveBarcode("This is My Barcode", new Font(new FontFamily("Arial"), 12, FontStyle.Regular, GraphicsUnit.Pixel), Color.DarkSlateBlue);

// Resize, add margins and check final image dimensions
MyBarCode.ResizeTo(300, 300); // Resize in pixels
MyBarCode.SetMargins(0, 20, 0, 20); // Set margins in pixels

int FinalWidth = MyBarCode.Width;
int FinalHeight = MyBarCode.Height;

// Recolor the barcode and its background
MyBarCode.ChangeBackgroundColor(Color.LightGray);
MyBarCode.ChangeBarCodeColor(Color.DarkSlateBlue);
if (!MyBarCode.Verify())
{
    Console.WriteLine("Color contrast should be at least 50% or a barcode may become unreadable. Test using GeneratedBarcode.Verify()");
}

// Finally, save the result
MyBarCode.SaveAsHtmlFile("StyledBarcode.html");

/*** STYLING BARCODES IN A SINGLE LINQ-STYLE EXPRESSION ***/

// Create a barcode in one line of code
BarcodeWriter.CreateBarcode("https://ironsoftware.com", BarcodeWriterEncoding.Aztec).ResizeTo(250, 250).SetMargins(10).AddBarcodeValueTextAboveBarcode().SaveAsImage("StyledBarcode.png");

/*** STYLING QR CODES WITH LOGO IMAGES OR BRANDING ***/

// Use the QRCodeWriter.CreateQrCodeWithLogo Method instead of BarcodeWriter.CreateBarcode
// Logo will automatically be sized appropriately and snapped to the QR grid.

var qrCodeLogo = new QRCodeLogo("ironsoftware_logo.png");
GeneratedBarcode myQRCodeWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/", qrCodeLogo);
myQRCodeWithLogo.ResizeTo(500, 500).SetMargins(10).ChangeBarCodeColor(Color.DarkGreen);
myQRCodeWithLogo.ResizeTo(500, 500).SetMargins(10).ChangeBarCodeColor(Color.DarkGreen);
myQRCodeWithLogo.SaveAsPng("QRWithLogo.Png").SaveAsPdf("MyVerifiedQR.html"); // Save as 2 different formats
Imports IronBarCode
Imports System
Imports System.Drawing

'''* STYLING GENERATED BARCODES  **

' BarcodeWriter.CreateBarcode creates a GeneratedBarcode object which allows the barcode to be styled and annotated.
Private MyBarCode As GeneratedBarcode = BarcodeWriter.CreateBarcode("Iron Software", BarcodeWriterEncoding.QRCode)

' Any text (or commonly, the value of the barcode) can be added to the image in a default or specified font.
' Text positions are automatically centered, above or below. Fonts that are too large for a given image are automatically scaled down.
MyBarCode.AddBarcodeValueTextBelowBarcode()
MyBarCode.AddAnnotationTextAboveBarcode("This is My Barcode", New Font(New FontFamily("Arial"), 12, FontStyle.Regular, GraphicsUnit.Pixel), Color.DarkSlateBlue)

' Resize, add margins and check final image dimensions
MyBarCode.ResizeTo(300, 300) ' Resize in pixels
MyBarCode.SetMargins(0, 20, 0, 20) ' Set margins in pixels

Dim FinalWidth As Integer = MyBarCode.Width
Dim FinalHeight As Integer = MyBarCode.Height

' Recolor the barcode and its background
MyBarCode.ChangeBackgroundColor(Color.LightGray)
MyBarCode.ChangeBarCodeColor(Color.DarkSlateBlue)
If Not MyBarCode.Verify() Then
	Console.WriteLine("Color contrast should be at least 50% or a barcode may become unreadable. Test using GeneratedBarcode.Verify()")
End If

' Finally, save the result
MyBarCode.SaveAsHtmlFile("StyledBarcode.html")

'''* STYLING BARCODES IN A SINGLE LINQ-STYLE EXPRESSION **

' Create a barcode in one line of code
BarcodeWriter.CreateBarcode("https://ironsoftware.com", BarcodeWriterEncoding.Aztec).ResizeTo(250, 250).SetMargins(10).AddBarcodeValueTextAboveBarcode().SaveAsImage("StyledBarcode.png")

'''* STYLING QR CODES WITH LOGO IMAGES OR BRANDING **

' Use the QRCodeWriter.CreateQrCodeWithLogo Method instead of BarcodeWriter.CreateBarcode
' Logo will automatically be sized appropriately and snapped to the QR grid.

Dim qrCodeLogo As New QRCodeLogo("ironsoftware_logo.png")
Dim myQRCodeWithLogo As GeneratedBarcode = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/", qrCodeLogo)
myQRCodeWithLogo.ResizeTo(500, 500).SetMargins(10).ChangeBarCodeColor(Color.DarkGreen)
myQRCodeWithLogo.ResizeTo(500, 500).SetMargins(10).ChangeBarCodeColor(Color.DarkGreen)
myQRCodeWithLogo.SaveAsPng("QRWithLogo.Png").SaveAsPdf("MyVerifiedQR.html") ' Save as 2 different formats

在这个示例中,我们看到条形码可以使用目标机器上安装的任何字体,标注您选择的文本或条形码本身的值。如果该字体不可用,将选择一个合适的类似字体。 条形码可以调整大小,增加边距,条形码和背景都可以重新上色。 然后可以将它们保存为适当的格式。

在代码的最后几行中,您可以看到使用我们的流畅风格操作符,仅需几行代码就可以创建并设置条形码的样式,类似于System.Linq

C# + VB.NET: 将条形码导出为HTML 将条形码导出为HTML
using IronBarCode;

GeneratedBarcode MyBarCode = BarcodeWriter.CreateBarcode("1234567890", BarcodeWriterEncoding.Code128);

// Save as a stand-alone HTML file without any image assets
MyBarCode.SaveAsHtmlFile("MyBarCode.html");

// Save as a stand-alone HTML image tag which can be served in HTML files, ASPX or MVC Views. No image assets required, the tag embeds the entire image in its source content
string ImgTag = MyBarCode.ToHtmlTag();

// Turn the image into a HTML/CSS Data URI.
string DataURI = MyBarCode.ToDataUrl();
Imports IronBarCode

Private MyBarCode As GeneratedBarcode = BarcodeWriter.CreateBarcode("1234567890", BarcodeWriterEncoding.Code128)

' Save as a stand-alone HTML file without any image assets
MyBarCode.SaveAsHtmlFile("MyBarCode.html")

' Save as a stand-alone HTML image tag which can be served in HTML files, ASPX or MVC Views. No image assets required, the tag embeds the entire image in its source content
Dim ImgTag As String = MyBarCode.ToHtmlTag()

' Turn the image into a HTML/CSS Data URI.
Dim DataURI As String = MyBarCode.ToDataUrl()

IronBarcode 有一个非常有用的功能,可以将条形码导出为自包含的 HTML,这样就没有相关的图像资产。 所有内容都包含在 HTML 文件中。

我们可以将内容导出为HTML文件HTML图像标签数据URI

Human Support related to .NET 条码库

直接来自我们开发团队的人工支持

无论是产品、集成还是许可查询,Iron产品开发团队随时准备支持您的所有问题。请联系我们并与Iron开启对话,以便在您的项目中最大限度地利用我们的库。

提问
Recognizes Barcode Qr related to .NET 条码库

在 .NET Core、.NET Standard 和 .NET Framework 中识别一维和二维码

IronBarcode .NET 条形码库可读取 BarcodeEncoding 枚举内的任何类型的条形码。它能够识别 .NET Core、.NET Standard 和 .NET Framework 中的条形码。

为了节省时间并提高库存工作流程的效率,IronBarcode 推荐使用一维(1D)或线性条形码,包括传统且成熟的条形码类型,如 UPC 和 EAN 码。全球的销售点服务通常使用 UPC(通用产品代码)条形码(包括其变体 UPC-A 和 UPC-E)。它通过在仓库和结账时更容易识别和跟踪产品特征来惠及目标消费者。UPCA 的内容仅限于 12 到 13 位的数字,而 UPCE 支持内容在 8 到 13 位之间。

和 UPC 一样,欧洲市场使用 EAN 条形码来标记消费者商品以便在销售点扫描。其变体包括 EAN-13 作为默认值,而在包装空间有限的情况下,如糖果,则使用 EAN-8。除了灵活性,作为高密度条形码,EAN-13 能够紧凑地编码更大的数据集。

一维条形码并未止步于此。

汽车和国防工业利用 Code 39 条形码。它的名称解释了其能够编码 39 个字符(现已修订为 43 个)。类似地,Code 128 字符集和高数据密度。继续在物流领域,包装行业喜欢使用 ITF(交错 2 of 5)条形码来标记包装材料,如瓦楞纸张,因为它们有较高的印刷容差。而 MSI 则适用于产品识别和库存管理。

制药行业使用药品二进制代码。而 RSS 14(缩小空间符号)和 Databar 条形码是 1D 和 2D 条形码的混合体。它是标记小件商品的医疗保健首选。类似于 Code 128 条形码,Codabar 也是物流和医疗保健的首选。它无需计算机,在点阵打印机输出中即可读取。

2D 条形码包括 Aztec、Data Matrix、Data Bar、IntelligentMail、Maxicode、QR 码。在不同行业中使用,Aztec 在运输业中用于票据和登机牌,并在低分辨率下可读。尽管 IntelligentMail 仅限于美国邮件的特定用途,Maxicode 用于标准化货物追踪。

在条形码中最广为人知的是 QR 码。由于其灵活性、容错性、可读性以及对各种数据的支持,例如数字、字母数字、字节/二进制和汉字,它在 B2B 到 B2C 的各种目的中应用广泛。

一旦类型最终确定,IronBarcode——领先的条形码生成器将接手!

查看完整功能列表
Fast And Polite Behavior related to .NET 条码库

开始使用 .NET 条码读取器生成和读取条码项目

在 .NET 中读取条码类型现在变得轻而易举,使用 IronBarcode 的多功能、先进且高效的库。

你从哪里开始?

安装 IronBarcode 的 NuGet 包或手动将 DLL 安装到项目或全局程序集缓存中。您现在距离使用行代码生成 C# 条码图像扫描应用程序更近一步。提取条码图像、值、编码类型、二进制数据(如有)并将其全部输出到控制台。

TryHarder - 更深度扫描偏斜的条码格式

将 IronBarcode 的 TryHarder 可变参数添加到 QuicklyReadOneBarcode 方法中,使应用程序尝试得更深入,尽管耗时更久,但分析模糊、偏斜或损坏的 QR 码图像格式更彻底。

随意指定多种格式

您可以指定您要查找的条码编码,也可以指定多种格式 - IronBarcode 为您提供无限的条码分析工具。

您可以提高条码读取的性能和准确性。您可以同时使用管道字符或“Bitwise OR”指定各种条码格式。或者,可以通过 BarcodeReader.ReadASingleBarcode 方法获得更具体性和质量。

从 PDF 文档到扫描,再到多线程读取条码

如果您的下一个项目是读取扫描的 PDF 文档并查找所有 1D 条码,一样地 IronBarcode 也不会让您失望。这与从单个文档中读取单个条码类似,只是现在增加了条码所属页码的信息。

类似地,从多帧 TIFF 中也能得到同样的结果。在这方面,它被视为与 PDF 相似。

多线程是否困扰您?如果是的话,IronBarcode 支持多线程!

要读取多个文档,您可以通过 IronBarcode 获得更好的结果,方法是创建一个文档列表并使用 BarcodeReader.ReadBarcodesMultithreaded 方法。这利用多个线程以及您所有的 CPU 核心进行条码扫描过程,并且速度可能成指数级快于一次读取一个条码。

使用完美的条码生成器,担心不完美图像的问题已成为过去

在现实世界中,用户可能希望扫描不仅是完美截图或 PNG 图像或照片的条码。传统的开源 .NET 条码生成器和读取库使得读取任何不完美图像格式变得不可能。然而,IronBarcode 使这一过程变得极其简单。

QuicklyReadOneBarcode 的 TryHarder 方法使 IronBarcode 能够去歪斜并从不完美的数字样本中读取条码。

照片、扫描和缩略图

如果一张照片是倾斜的,设置特定的条码旋转和图像校正,以合理地纠正来自手机相机的数字噪声、倾斜、透视和旋转。

同样,从扫描的 PDF 中读取 QR 码和 PDF-417 条码需要设置适当的条码旋转校正和条码图像校正程度,以轻微清理文档。然而,谨慎地不被过度指定以免影响性能。

如果您有损坏的条码缩略图,那么 IronBarcode 读取方法会自动识别过小的条码图像,并放大并清理与缩略图相关的所有数字噪音;使它们重新可读。

对于开发人员来说,没有比这更简单的事情了!

了解更多
Built For Dot Net related to .NET 条码库

专为在.NET Core项目中轻松使用而构建

只需几行代码即可在几分钟内开始。为 .NET Core、.NET Standard 和 Framework 构建,作为易于使用的单个 DLL;无需依赖项;支持 32 位和 64 位;在任何 .NET 语言中使用。可用于网络、云、桌面或控制台应用程序;支持移动和桌面设备。您可以从此链接下载该软件产品。

专为 .NET 构建, C#, 二维码

立即开始
Write Barcodes related to .NET 条码库

总结IronBarcode - 用于创建和操作条形码图像

由于IronBarcode能够方便地创建、调整大小和保存各种类型和格式的条形码,没有理由不马上开始使用它!

使用Fluent API,通过生成的条形码类设置边距、调整大小和添加注释。然后通过IronOCR自动根据文件名假定正确的图像类型来保存为图像。不论是GIF、HTML文件、HTML标签、JPEG、PNG、TIFF以及Windows位图。

StampToExistingPdfPage方法允许生成并将条形码盖章到现有的PDF上。这在编辑通用PDF或通过条形码向文档添加内部识别号时非常有用。

立即联系客服,提供全天候24/7的真人支持。无论您有问题或需要项目支持;可以使用我们的30天试用密钥开始,利用我们丰富的文档资源,其内容通俗易懂,或从$749开始受益于我们的终身许可。

了解更多
支持:
  • .NET Core 2.0及以上
  • .NET Framework 4.0及以上版本支持C#、VB、F#
  • Microsoft Visual Studio .NET 开发IDE图标
  • Visual Studio 的 NuGet 安装程序支持
  • JetBrains ReSharper C#语言助手兼容
  • 与Microsoft Azure C# .NET托管平台兼容

许可与定价

免费社区开发许可。商业许可起价 $749。

项目 C# + VB.NET 库许可

项目

开发人员 C# + VB.NET 库许可

开发者

组织 C# + VB.NET 库许可

组织

代理C# + VB.NET库授权

机构

SaaS C# + VB.NET库许可

软件即服务

OEM C# + VB.NET 库授权

原始设备制造商

查看完整的许可选项  

C# 和 VB .NET 条形码 & QR 教程

教程 + C#中读取条形码的代码示例 | .NET教程

C# .NET 条形码 QR

弗兰克·沃克 .NET产品开发人员

读取条形码和二维码 | C# VB .NET 教程

看看Frank如何使用IronBarcode在他的C# .NET条码应用程序中从扫描、照片和PDF文档中读取条码...

查看Frank的条码读取教程
用C#和VB.NET编写条码教程和代码示例

C# .NET 条形码

弗朗西斯卡·米勒 初级.NET工程师

在 C# 或 VB.NET 中生成条形码图像

Francesca 分享了一些在 C# 或 VB 应用程序中将条形码写入图像的技巧和窍门。了解如何编写条形码以及使用 IronBarcode 可用的所有选项...

查看弗朗西斯卡的条形码教程
教程 + 代码示例 VB.NET PDF 生成和编辑 | VB.NET & ASP.NET PDF

QR .NET C# VB

詹妮弗·赖特 应用架构负责人

在C#和VB .NET应用程序中编写QR码的教程

Jenny的团队每天使用IronBarcode编写成千上万个二维码。查看他们的教程,了解如何充分利用IronBarcode ...

Jenny团队的QR编写教程
成千上万的开发人员使用IronBarcode来...

会计和财务系统

  • # 收据
  • # 报告
  • # 发票打印
将 PDF 支持添加到 ASP.NET 会计和财务系统中

业务数字化

  • # 文档
  • # 订购与标签
  • # 纸张替代
C# 业务数字化用例

企业内容管理

  • # 内容制作
  • # 文档管理
  • # 内容分发
.NET CMS PDF支持

数据和报告应用程序

  • # 性能跟踪
  • # 趋势图绘制
  • # 报告
C# PDF报告
企业级 .NET 组件开发商 Iron Software

成千上万的公司、政府、中小企业和开发人员都信任Iron软件产品。

Iron的团队在.NET软件组件市场拥有超过10年的经验。

Iron Customer Icon
Iron Customer Icon
Iron Customer Icon
Iron Customer Icon
Iron Customer Icon
Iron Customer Icon
Iron Customer Icon
Iron Customer Icon