跳至頁尾內容
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 file
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");

// Get the barcode as an image for further processing
var myBarcodeImage = myBarcode.Image;
Imports IronBarCode
Imports System.Drawing

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

' To configure and fine-tune barcode reading, utilize the BarcodeReaderOptions class
Dim myOptionsExample As New BarcodeReaderOptions With {
    ' 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
Dim results = BarcodeReader.Read("barcode.png", myOptionsExample)

' Create a barcode with one line of code
Dim 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")

' Get the barcode as an image for further processing
Dim myBarcodeImage = myBarcode.Image
Install-Package BarCode

IronBarcode支援多種標準格式,從圖像文件(jpeg、png和jpg)到更具程式化的格式,例如bitmap,讓您可以在程式中傳遞變數。此外,它還支援如PDF這樣的外部格式,使IronBarcode可以無縫整合到任何程式碼庫中,提供開發者在文件格式和變數上的靈活性。

除了作為所有文件格式的條碼讀取器外,IronBarcode還兼作條碼生成器,支援所有標準編碼和格式,例如Code39。 設置條碼生成器只需兩行程式碼。 憑藉入門門檻低和眾多的自訂選項,IronBarcode是所有與條碼相關情況的首選。

條碼讀取器和條碼生成器在C#中

  1. `var myBarcode = BarcodeWriter.CreateBarcode("12345", BarcodeEncoding.EAN8);`
  2. `Image myBarcodeImage = myBarcode.ToImage();`
  3. `myBarcode.ResizeTo(400, 100);`
  4. `var resultFromFile = BarcodeReader.Read(@"file/barcode.png");`
  5. `var myOptionsExample = new BarcodeReaderOptions { /* Options */ };`

條碼寫入器

我們首先導入必要的庫,如EAN8。 然後我們將生成的條碼另存為所需格式的圖像。 對此有多種選項,因為IronBarcode支援將條碼建立為Bitmap

進階條碼寫入器

如上所見,使用IronBarcode生成條碼只需兩行程式碼,並將其另存為文件以供日後使用。 IronBarcode進一步擴展,提供開發者大量選項來自訂條碼以符合情況。

我們可以使用ResizeTo方法並傳遞高度和寬度來調整條碼圖像大小。

條碼讀取器

如上述所示,我們首先實例化Read方法,並將其保存為變數以備日後使用和操作條碼物件。 有指定方法用於讀取如PDF的外部格式,使用ReadPDF; 然而,對於一般圖像格式和bitmap,我們會使用Read

BarcodeReaderOptions

IronBarcode允許開發者從標準文件格式掃描條碼。 然而,在某些情況下,開發人員希望微調BarcodeReaderOptions方法的行為,特別是在程式中讀取一批條碼文件時。 這時候BarcodeReaderOptions就派上用場了。 IronBarcode讓您可以完全自訂,例如使用ExpectBarcodeTypes知道它們是什麼型別的條碼。 這允許開發者同時運行多個執行緒以並行讀取來自多個圖像的條碼,並控制進行並行讀取時所使用的執行緒數量。

這只是展示IronBarcode力量的一些屬性。 欲查看完整列表,請參閱此處說明文件。

學習如何用我們的詳細指南建立條碼! Read

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")
Install-Package BarCode

IronBarcode 提供許多影像預處理過濾器可供選擇,並且可以輕鬆地應用在 BarcodeReaderOptions。 選擇可以改善影像讀取的過濾器,例如 Sharpen二值化閾值Contrast。 請記得您選擇的順序就是他們應用的順序。

有選項可以將應用每個過濾器的中間影像資料儲存下來。 可以使用 SaveAtEachIteration 屬性來切換 ImageFilterCollection

範例程式碼中的重點:

  • 我們建立了一個 BarcodeReaderOptions 的實例,並使用各種影像過濾器進行配置:Binary ThresholdContrast
  • 過濾器以特定順序新增,表示應用的順序。
  • 通過將 cacheAtEachIteration 設置為 true,程式庫會在每次應用過濾器後儲存中間的影像,這對於除錯和分析很有用。
  • 最後,我們從影像中讀取條碼,並將條碼型別和值輸出至控制台。

進一步瞭解 IronBarcode 中的影像校正

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
Install-Package BarCode

在這個範例中,我們看到可以建立、調整大小和保存許多不同型別和格式的條碼; 甚至可能在一行程式碼中完成。

使用我們的流暢API,生成的barcode類可以用來設定邊距、調整大小和註解條碼。 然後可以將它們保存為圖像,IronBarcode會自動從文件名稱中假設正確的圖像型別:GIFs、HTML文件、HTML標籤、JPEGs、PDFs、PNGs、TIFFs和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");

// 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.
Dim 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")

' 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 = 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
Install-Package BarCode

在此範例中,我們看到條碼可以標註上您選擇的文字或barcode本身的值,可以使用安裝在目標機器上的任何字體。如果該字體不可用,將選擇一個合適的相似字體。 條碼可以調整大小、增加邊距,並且barcode和背景都可以重新著色。 然後可以將其儲存為適當的格式。

在程式碼的最後幾行中,您可以看到使用我們的流暢風格運算子,可以在幾行程式碼內建立和設計一個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()
Install-Package BarCode

IronBarcode 擁有一個非常有用的功能,允許條碼以自包含的 HTML 形式匯出,因此不需要關聯的圖像資源。 所有內容都包含在 HTML 文件中。

我們可以匯出為HTML 文件HTML 圖像標籤資料 URI

在這個範例中:

  • 我們使用 BarcodeWriter.CreateBarcode 建立一個條碼,指定輸入資料和編碼型別。
  • 然後我們使用 IronBarcode 提供的不同方法來匯出條碼:
  • ToHtmlTag() 生成一個可以嵌入到網頁中的 HTML <img> 標籤。
  • ToDataUri() 建立一個資料 URI 字串,可以用作 <img> 標籤的來源,或任何需要圖像 URL 的地方。
  • SaveAsHtmlFile() 將條碼儲存為獨立的 HTML 檔案,包含所有圖像資料內嵌,使其便攜且易於分享。

Human Support related to .NET條碼程式庫

來自我們開發團隊的直接人員支援

無論是產品、整合或授權問題,Iron 產品開發團隊都準備好支援您所有的問題。聯繫我們並與 Iron 進行對話,以發揮我們程式庫在您的計畫中的最大價值。

詢問問題
Recognizes Barcode Qr related to .NET條碼程式庫

在.NET Core、.NET Standard和.NET Framework中識別1D和2D條碼

IronBarcode .NET條碼程式庫能讀取BarcodeEncoding Enum中的任何型別的條碼。它在.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的5)條碼來標籤包裝材料,如波紋板,由於其高印刷容限。然而,MSI更適合產品識別和庫存管理。

製藥行業利用製藥二進制程式碼。而RSS 14(縮減空間符號)和Databar條碼則是一維和二維條碼的混合體,這在醫療護理中標記小物品頗受歡迎。如同Code 128條碼,Codabar也在物流和醫療界廣受喜愛。它無需電腦即可工作,從點陣列列印機輸出中可讀取。

二維條碼包括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 - 更深入地掃描偏斜條碼格式

在QuicklyReadOneBarcode方法中新增IronBarcode的TryHarder變數,使應用程式更加努力地,儘管消耗更多時間,但更徹底地分析被遮蔽、偏斜或損壞的QR碼圖像格式。

隨時指定多種格式

您可以指定您正在尋找的條碼編碼或指定多種格式 - IronBarcode為您提供無限的條碼分析工具。

您可以提高條碼讀取性能和準確性。您可以使用管字元或'Bitwise OR'同時指定多種條碼格式。或者,通過BarcodeReader.ReadASingleBarcode方法獲得更多的特定性和質量。

從PDF文件到掃描再到多執行緒中讀取條碼

如果您的下一個項目是讀取一個掃描的PDF文件並查找所有的一維條碼,再次IronBarcode不會令您失望。這與從單個文件中讀取單個條碼類似,除了現在新增了有關條碼所屬頁碼的資訊。

同樣地,從多幀的TIFF中實現相同的結果。在這方面,它被視為與PDF類似。

多執行緒是否讓您感到困擾?如果是這樣,它與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語言使用。在Web、雲端、桌面或控制台應用程式中使用;支持移動和桌面裝置。您可以從這個連結下載這個軟體產品。

為 .NET 構建 C#, QR碼

立即開始
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 圖示
  • Microsoft 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 程式庫授權

SaaS

OEM C# + VB.NET 程式庫授權

OEM

查看完整授權選項  

C#和VB .NET的條碼和QR教程

讀取條碼的教學+程式碼範例 | .NET 教程

C# .NET 條碼 QR

Frank Walker .NET 產品開發者

讀取條碼和 QR | C# VB .NET 教程

查看 Frank 如何使用 IronBarcode 從其 C# .NET 條碼應用程式中的掃描、照片和 PDF 文件讀取條碼...

查看 Frank 的條碼讀取教程
條碼寫作教學 + C# 和 VB.NET 的程式碼範例

C# .NET 條碼

Francesca Miller 初級 .NET 工程師

在 C# 或 VB.NET 中生成條碼影像

Francesca 分享了一些在 C# 或 VB 應用程式中將條碼寫入影像的技巧和竅門。查看如何寫條碼以及 IronBarcode 提供給您的所有選項...

查看 Francesca 的條碼教程
VB.NET PDF 建立和編輯的教程和程式碼範例 | VB.NET & ASP.NET PDF

QR .NET C# VB

Jennifer Wright 應用架構負責人

在 C# 和 VB .NET 應用程式中編寫 QR 碼的教學

Jenny 的團隊每天使用 IronBarcode 寫數以千計的 QR 碼。查看他們的教程以充分利用 IronBarcode...

Jenny 團隊的 QR 編寫教程
成千上萬的開發者使用 IronBarcode 來...

會計和金融系統

  • # 收據
  • # 報告
  • # 發票列印
向 ASP.NET 會計和金融系統新增 PDF 支援

商業數位化

  • # 文件
  • # 訂單與標籤
  • # 紙張替代
C# 商業數位化使用案例

企業內容管理

  • # 內容製作
  • # 文件管理
  • # 內容分發
.NET CMS PDF 支援

資料和報告應用程式

  • # 性能跟蹤
  • # 趨勢映射
  • # 報告
C# PDF 報告
Iron Software Enterprise .NET 元件開發者

成千上萬的企業、政府、中小企業和開發者都信任 Iron 軟體產品。

Iron 團隊在 .NET 軟體元件市場擁有超過 10 年的經驗。

Iron 客戶圖標
Iron 客戶圖標
Iron 客戶圖標
Iron 客戶圖標
Iron 客戶圖標
Iron 客戶圖標
Iron 客戶圖標
Iron 客戶圖標

Iron 支援團隊

我們線上24小時,每週5天。
聊天
電子郵件
給我打電話