C#에서 바코드를 읽는 방법

C# Barcode Scanner: Read Barcodes & QR Codes in .NET Applications

This article was translated from English: Does it need improvement?
Translated
View the article in English

.NET 애플리케이션에서 BarCode나 QR 코드를 빠르게 스캔해야 하나요? IronBarcode는 완벽한 디지털 이미지든 처리하기 까다로운 실제 사진이든 상관없이 BarCode 판독을 간편하고 안정적으로 만들어 줍니다. 이 가이드는 즉시 활용할 수 있는 실용적인 예제를 통해 C#에서 BarCode 스캔 기능을 구현하는 방법을 상세히 안내합니다.

빠른 시작: 파일에서 BarCode 즉시 읽기

이 간단한 예제를 통해 IronBarcode를 시작하는 것이 얼마나 쉬운지 확인해 보세요. 단 한 줄의 코드만으로 이미지 파일에서 BARCODE를 읽을 수 있으며, 복잡한 설정은 필요하지 않습니다.

  1. NuGet 패키지 관리자를 사용하여 https://www.nuget.org/packages/BarCode 설치하기

    PM > Install-Package BarCode
  2. 다음 코드 조각을 복사하여 실행하세요.

    var results = IronBarCode.BarcodeReader.Read("path/to/barcode.png");
  3. 실제 운영 환경에서 테스트할 수 있도록 배포하세요.

    무료 체험판으로 오늘 프로젝트에서 IronBarcode 사용 시작하기

    arrow pointer

.NET 프로젝트에 IronBarcode를 설치하려면 어떻게 해야 합니까?

IronBarcode는 NuGet 패키지 관리자를 통해 또는 DLL을 직접 다운로드하여 쉽게 설치할 수 있습니다. NuGet 설치는 종속성과 업데이트를 자동으로 관리하므로 권장되는 방법입니다.

Install-Package BarCode

설치 후 C# 파일에 using IronBarCode;를 추가하면 BARCODE 스캔 기능을 사용할 수 있습니다. 다양한 개발 환경에 대한 자세한 설치 방법은 설치 가이드를 참조하십시오.

C#을 사용하여 첫 번째 BARCODE를 읽는 방법은 무엇입니까?

IronBarcode를 사용하면 단 한 줄의 코드만으로 BARCODE를 읽을 수 있습니다. 이 라이브러리는 BarCode 형식을 자동으로 감지하고 인코딩된 모든 데이터를 추출합니다.

Code128 barcode ready for scanning - contains text 'https://ironsoftware.com/csharp/barcode/' *IronBarcode가 즉시 읽을 수 있는 표준 Code128 BARCODE*
using IronBarCode;
using System;

// Read barcodes from the image file - supports PNG, JPG, BMP, GIF, and more
BarcodeResults results = BarcodeReader.Read("GetStarted.png");

// Check if any barcodes were detected
if (results != null && results.Co/unt > 0)
{
    // Process each barcode found in the image
    foreach (BarcodeResult result in results)
    {
        // Extract the text value from the barcode
        Console.WriteLine("Barcode detected! Value: " + result.Text);

        // Additional properties available:
        // result.BarcodeType - The format (Code128, QR, etc.)
        // result.BinaryValue - Raw binary data if applicable
        // result.Co/nfidence - Detection confidence score
    }
}
else
{
    Console.WriteLine("No barcodes detected in the image.");
}
using IronBarCode;
using System;

// Read barcodes from the image file - supports PNG, JPG, BMP, GIF, and more
BarcodeResults results = BarcodeReader.Read("GetStarted.png");

// Check if any barcodes were detected
if (results != null && results.Co/unt > 0)
{
    // Process each barcode found in the image
    foreach (BarcodeResult result in results)
    {
        // Extract the text value from the barcode
        Console.WriteLine("Barcode detected! Value: " + result.Text);

        // Additional properties available:
        // result.BarcodeType - The format (Code128, QR, etc.)
        // result.BinaryValue - Raw binary data if applicable
        // result.Co/nfidence - Detection confidence score
    }
}
else
{
    Console.WriteLine("No barcodes detected in the image.");
}
Imports IronBarCode
Imports System

' Read barcodes from the image file - supports PNG, JPG, BMP, GIF, and more
Dim results As BarcodeResults = BarcodeReader.Read("GetStarted.png")

' Check if any barcodes were detected
If results IsNot Nothing AndAlso results.Count > 0 Then
    ' Process each barcode found in the image
    For Each result As BarcodeResult In results
        ' Extract the text value from the barcode
        Console.WriteLine("Barcode detected! Value: " & result.Text)

        ' Additional properties available:
        ' result.BarcodeType - The format (Code128, QR, etc.)
        ' result.BinaryValue - Raw binary data if applicable
        ' result.Confidence - Detection confidence score
    Next
Else
    Console.WriteLine("No barcodes detected in the image.")
End If
$vbLabelText   $csharpLabel

BarcodeReader.Read 메서드는 감지된 모든 BarCode가 포함된 BarcodeResults 컬렉션을 반환합니다. 각 BarcodeResult은 BARCODE의 텍스트 값, 형식 유형, 위치 좌표 및 바이너리 데이터에 대한 액세스를 제공합니다. 이 방식은 Code128, Code39, QR 코드, 데이터 매트릭스 코드 등 일반적인 BARCODE 형식과 완벽하게 호환됩니다.

읽기 어렵거나 손상된 BARCODE를 읽는 데 도움이 되는 기능은 무엇인가요?

실제 BARCODE 스캔 작업에서는 종종 비뚤어진 각도, 불량한 조명, 부분적인 손상 등 불완전한 이미지가 발생합니다. IronBarcode의 고급 옵션은 이러한 과제를 효과적으로 해결합니다.

using IronBarCode;

// Configure advanced reading options for difficult barcodes
BarcodeReaderOptions options = new BarcodeReaderOptions
{
    // Speed settings: Faster, Balanced, Detailed, ExtremeDetail
    // ExtremeDetail performs deep analysis for challenging images
    Speed = ReadingSpeed.ExtremeDetail,

    // Specify expected formats to improve performance
    // Use bitwise OR (|) to combine multiple formats
    ExpectBarcodeTypes = BarcodeEncoding.QRCode | BarcodeEncoding.Co/de128,

    // Maximum number of barcodes to find (0 = unlimited)
    MaxParallelThreads = 4,

    // Crop region for faster processing of specific areas
    CropArea = null // Or specify a Rectangle
};

// Apply options when reading
BarcodeResults results = BarcodeReader.Read("TryHarderQR.png", options);

// Process detected barcodes
foreach (var barcode in results)
{
    Console.WriteLine($"Format: {barcode.BarcodeType}, Value: {barcode.Text}");
}
using IronBarCode;

// Configure advanced reading options for difficult barcodes
BarcodeReaderOptions options = new BarcodeReaderOptions
{
    // Speed settings: Faster, Balanced, Detailed, ExtremeDetail
    // ExtremeDetail performs deep analysis for challenging images
    Speed = ReadingSpeed.ExtremeDetail,

    // Specify expected formats to improve performance
    // Use bitwise OR (|) to combine multiple formats
    ExpectBarcodeTypes = BarcodeEncoding.QRCode | BarcodeEncoding.Co/de128,

    // Maximum number of barcodes to find (0 = unlimited)
    MaxParallelThreads = 4,

    // Crop region for faster processing of specific areas
    CropArea = null // Or specify a Rectangle
};

// Apply options when reading
BarcodeResults results = BarcodeReader.Read("TryHarderQR.png", options);

// Process detected barcodes
foreach (var barcode in results)
{
    Console.WriteLine($"Format: {barcode.BarcodeType}, Value: {barcode.Text}");
}
Imports IronBarCode

' Configure advanced reading options for difficult barcodes
Dim options As New BarcodeReaderOptions With {
    ' Speed settings: Faster, Balanced, Detailed, ExtremeDetail
    ' ExtremeDetail performs deep analysis for challenging images
    .Speed = ReadingSpeed.ExtremeDetail,

    ' Specify expected formats to improve performance
    ' Use bitwise OR (|) to combine multiple formats
    .ExpectBarcodeTypes = BarcodeEncoding.QRCode Or BarcodeEncoding.Code128,

    ' Maximum number of barcodes to find (0 = unlimited)
    .MaxParallelThreads = 4,

    ' Crop region for faster processing of specific areas
    .CropArea = Nothing ' Or specify a Rectangle
}

' Apply options when reading
Dim results As BarcodeResults = BarcodeReader.Read("TryHarderQR.png", options)

' Process detected barcodes
For Each barcode In results
    Console.WriteLine($"Format: {barcode.BarcodeType}, Value: {barcode.Text}")
Next barcode
$vbLabelText   $csharpLabel
QR code rotated 45 degrees demonstrating IronBarcode's rotation handling *IronBarcode가 고급 옵션을 사용하여 성공적으로 판독한 회전된 QR 코드*

ExpectBarcodeTypes 속성은 검색 범위를 특정 형식으로 제한하여 성능을 크게 향상시킵니다. 문제가 있는 이미지의 정확도를 극대화하려면 이미지 필터와 자동 회전 기능을 함께 사용하십시오:

using IronBarCode;

BarcodeReaderOptions options = new BarcodeReaderOptions
{
    // Apply image processing filters to enhance readability
    ImageFilters = new ImageFilterCollection
    {
        new AdaptiveThresholdFilter(9, 0.01f), // Handles varying lighting
        new ContrastFilter(2.0f),               // Increases contrast
        new SharpenFilter()                     // Reduces blur
    },

    // Automatically rotate to find barcodes at any angle
    AutoRotate = true,

    // Use multiple CPU cores for faster processing
    Multithreaded = true
};

BarcodeResults results = BarcodeReader.Read("TryHarderQR.png", options);

foreach (var result in results)
{
    Console.WriteLine($"Detected {result.BarcodeType}: {result.Text}");
    Console.WriteLine($"Confidence: {result.Co/nfidence}%");
    Console.WriteLine($"Position: X={result.X}, Y={result.Y}");
}
using IronBarCode;

BarcodeReaderOptions options = new BarcodeReaderOptions
{
    // Apply image processing filters to enhance readability
    ImageFilters = new ImageFilterCollection
    {
        new AdaptiveThresholdFilter(9, 0.01f), // Handles varying lighting
        new ContrastFilter(2.0f),               // Increases contrast
        new SharpenFilter()                     // Reduces blur
    },

    // Automatically rotate to find barcodes at any angle
    AutoRotate = true,

    // Use multiple CPU cores for faster processing
    Multithreaded = true
};

BarcodeResults results = BarcodeReader.Read("TryHarderQR.png", options);

foreach (var result in results)
{
    Console.WriteLine($"Detected {result.BarcodeType}: {result.Text}");
    Console.WriteLine($"Confidence: {result.Co/nfidence}%");
    Console.WriteLine($"Position: X={result.X}, Y={result.Y}");
}
Imports IronBarCode

Dim options As New BarcodeReaderOptions With {
    .ImageFilters = New ImageFilterCollection From {
        New AdaptiveThresholdFilter(9, 0.01F), ' Handles varying lighting
        New ContrastFilter(2.0F),               ' Increases contrast
        New SharpenFilter()                     ' Reduces blur
    },
    .AutoRotate = True,                         ' Automatically rotate to find barcodes at any angle
    .Multithreaded = True                       ' Use multiple CPU cores for faster processing
}

Dim results As BarcodeResults = BarcodeReader.Read("TryHarderQR.png", options)

For Each result In results
    Console.WriteLine($"Detected {result.BarcodeType}: {result.Text}")
    Console.WriteLine($"Confidence: {result.Confidence}%")
    Console.WriteLine($"Position: X={result.X}, Y={result.Y}")
Next
$vbLabelText   $csharpLabel

이러한 고급 기능 덕분에 IronBarcode는 이미지 품질이 크게 달라지는 사진, 보안 카메라 또는 모바일 기기 캡처 화면에서 BARCODE를 스캔하는 데 이상적입니다.

PDF 문서에서 여러 BARCODE를 스캔하려면 어떻게 해야 하나요?

PDF 바코드 스캔 기능은 청구서, 배송 라벨 및 재고 문서를 처리하는 데 필수적입니다. IronBarcode는 모든 페이지에 있는 모든 BarCode를 효율적으로 읽습니다.

PDF 파일에서 BARCODE 읽기

using System;
using IronBarCode;

try
{
    // Scan all pages of a PDF for barcodes
    BarcodeResults results = BarcodeReader.ReadPdf("MultipleBarcodes.pdf");

    if (results != null && results.Co/unt > 0)
    {
        foreach (var barcode in results)
        {
            // Access barcode data and metadata
            string value = barcode.Text;
            int pageNumber = barcode.PageNumber;
            BarcodeEncoding format = barcode.BarcodeType;
            byte[] binaryData = barcode.BinaryValue;

            // Extract barcode image if needed
            System.Drawing.Bitmap barcodeImage = barcode.BarcodeImage;

            Console.WriteLine($"Found {format} on page {pageNumber}: {value}");
        }
    }
    else
    {
        Console.WriteLine("No barcodes found in the PDF.");
    }
}
catch (Exception ex)
{
    Console.WriteLine($"Error reading PDF: {ex.Message}");
}
using System;
using IronBarCode;

try
{
    // Scan all pages of a PDF for barcodes
    BarcodeResults results = BarcodeReader.ReadPdf("MultipleBarcodes.pdf");

    if (results != null && results.Co/unt > 0)
    {
        foreach (var barcode in results)
        {
            // Access barcode data and metadata
            string value = barcode.Text;
            int pageNumber = barcode.PageNumber;
            BarcodeEncoding format = barcode.BarcodeType;
            byte[] binaryData = barcode.BinaryValue;

            // Extract barcode image if needed
            System.Drawing.Bitmap barcodeImage = barcode.BarcodeImage;

            Console.WriteLine($"Found {format} on page {pageNumber}: {value}");
        }
    }
    else
    {
        Console.WriteLine("No barcodes found in the PDF.");
    }
}
catch (Exception ex)
{
    Console.WriteLine($"Error reading PDF: {ex.Message}");
}
Imports System
Imports IronBarCode

Try
    ' Scan all pages of a PDF for barcodes
    Dim results As BarcodeResults = BarcodeReader.ReadPdf("MultipleBarcodes.pdf")

    If results IsNot Nothing AndAlso results.Count > 0 Then
        For Each barcode In results
            ' Access barcode data and metadata
            Dim value As String = barcode.Text
            Dim pageNumber As Integer = barcode.PageNumber
            Dim format As BarcodeEncoding = barcode.BarcodeType
            Dim binaryData As Byte() = barcode.BinaryValue

            ' Extract barcode image if needed
            Dim barcodeImage As System.Drawing.Bitmap = barcode.BarcodeImage

            Console.WriteLine($"Found {format} on page {pageNumber}: {value}")
        Next
    Else
        Console.WriteLine("No barcodes found in the PDF.")
    End If
Catch ex As Exception
    Console.WriteLine($"Error reading PDF: {ex.Message}")
End Try
$vbLabelText   $csharpLabel

PDF 페이지에서 콘솔 출력을 보여주는 여러 BARCODE가 감지됨 서로 다른 PDF 페이지에서 발견된 여러 BARCODE를 보여주는 콘솔 출력

특정 페이지 범위나 고급 PDF 처리가 필요한 경우 BarcodeReaderOptions를 사용하십시오:

// Read only specific pages to improve performance
BarcodeReaderOptions pdfOptions = new BarcodeReaderOptions
{
    // Scan pages 1-5 only
    PageNumbers = new[] { 1, 2, 3, 4, 5 },

    // PDF-specific settings
    PdfDpi = 300, // Higher DPI for better accuracy
    ReadBehindVectorGraphics = true
};

BarcodeResults results = BarcodeReader.ReadPdf("document.pdf", pdfOptions);
// Read only specific pages to improve performance
BarcodeReaderOptions pdfOptions = new BarcodeReaderOptions
{
    // Scan pages 1-5 only
    PageNumbers = new[] { 1, 2, 3, 4, 5 },

    // PDF-specific settings
    PdfDpi = 300, // Higher DPI for better accuracy
    ReadBehindVectorGraphics = true
};

BarcodeResults results = BarcodeReader.ReadPdf("document.pdf", pdfOptions);
' Read only specific pages to improve performance
Dim pdfOptions As New BarcodeReaderOptions With {
	.PageNumbers = { 1, 2, 3, 4, 5 },
	.PdfDpi = 300,
	.ReadBehindVectorGraphics = True
}

Dim results As BarcodeResults = BarcodeReader.ReadPdf("document.pdf", pdfOptions)
$vbLabelText   $csharpLabel

다중 프레임 TIFF 이미지는 어떻게 처리할 수 있나요?

문서 스캔 및 팩스 시스템에서 흔히 사용되는 멀티프레임 TIFF 파일은 PDF와 동일한 포괄적인 지원을 받습니다.

프레임 간에 여러 BarCode가 포함된 멀티프레임 TIFF 서로 다른 프레임에 BARCODE가 포함된 멀티프레임 TIFF 파일

using IronBarCode;

// TIFF files are processed similarly to regular images
// Each frame is scanned automatically
BarcodeResults multiFrameResults = BarcodeReader.Read("Multiframe.tiff");

foreach (var result in multiFrameResults)
{
    // Access frame-specific information
    int frameNumber = result.PageNumber; // Frame number in TIFF
    string barcodeValue = result.Text;

    Console.WriteLine($"Frame {frameNumber}: {barcodeValue}");

    // Save individual barcode images if needed
    result.BarcodeImage?.Save($"barcode_frame_{frameNumber}.png");
}
using IronBarCode;

// TIFF files are processed similarly to regular images
// Each frame is scanned automatically
BarcodeResults multiFrameResults = BarcodeReader.Read("Multiframe.tiff");

foreach (var result in multiFrameResults)
{
    // Access frame-specific information
    int frameNumber = result.PageNumber; // Frame number in TIFF
    string barcodeValue = result.Text;

    Console.WriteLine($"Frame {frameNumber}: {barcodeValue}");

    // Save individual barcode images if needed
    result.BarcodeImage?.Save($"barcode_frame_{frameNumber}.png");
}
Imports IronBarCode

' TIFF files are processed similarly to regular images
' Each frame is scanned automatically
Private multiFrameResults As BarcodeResults = BarcodeReader.Read("Multiframe.tiff")

For Each result In multiFrameResults
	' Access frame-specific information
	Dim frameNumber As Integer = result.PageNumber ' Frame number in TIFF
	Dim barcodeValue As String = result.Text

	Console.WriteLine($"Frame {frameNumber}: {barcodeValue}")

	' Save individual barcode images if needed
	If result.BarcodeImage IsNot Nothing Then
		result.BarcodeImage.Save($"barcode_frame_{frameNumber}.png")
	End If
Next result
$vbLabelText   $csharpLabel

이미지 필터 및 회전 설정을 포함한 TIFF 처리에도 동일한 BarcodeReaderOptions이 적용됩니다. 자세한 TIFF 처리 시나리오에 대해서는 당사의 이미지 처리 튜토리얼을 참조하십시오.

멀티스레딩을 사용하면 처리 속도를 높일 수 있을까요?

여러 문서를 처리할 때는 병렬 처리를 활용하면 큰 이점을 얻을 수 있습니다. IronBarcode는 최적의 성능을 위해 사용 가능한 CPU 코어를 자동으로 활용합니다.

using IronBarCode;

// List of documents to process - mix of formats supported
var documentBatch = new[] 
{ 
    "invoice1.pdf", 
    "shipping_label.png", 
    "inventory_sheet.tiff",
    "product_catalog.pdf"
};

// Configure for batch processing
BarcodeReaderOptions batchOptions = new BarcodeReaderOptions
{
    // Enable parallel processing across documents
    Multithreaded = true,

    // Limit threads if needed (0 = use all cores)
    MaxParallelThreads = Environment.ProcessorCount,

    // Apply consistent settings to all documents
    Speed = ReadingSpeed.Balanced,
    ExpectBarcodeTypes = BarcodeEncoding.All
};

// Process all documents in parallel
BarcodeResults batchResults = BarcodeReader.Read(documentBatch, batchOptions);

// Group results by source document
var resultsByDocument = batchResults.GroupBy(r => r.Filename);

foreach (var docGroup in resultsByDocument)
{
    Console.WriteLine($"\nDocument: {docGroup.Key}");
    foreach (var barcode in docGroup)
    {
        Console.WriteLine($"  - {barcode.BarcodeType}: {barcode.Text}");
    }
}
using IronBarCode;

// List of documents to process - mix of formats supported
var documentBatch = new[] 
{ 
    "invoice1.pdf", 
    "shipping_label.png", 
    "inventory_sheet.tiff",
    "product_catalog.pdf"
};

// Configure for batch processing
BarcodeReaderOptions batchOptions = new BarcodeReaderOptions
{
    // Enable parallel processing across documents
    Multithreaded = true,

    // Limit threads if needed (0 = use all cores)
    MaxParallelThreads = Environment.ProcessorCount,

    // Apply consistent settings to all documents
    Speed = ReadingSpeed.Balanced,
    ExpectBarcodeTypes = BarcodeEncoding.All
};

// Process all documents in parallel
BarcodeResults batchResults = BarcodeReader.Read(documentBatch, batchOptions);

// Group results by source document
var resultsByDocument = batchResults.GroupBy(r => r.Filename);

foreach (var docGroup in resultsByDocument)
{
    Console.WriteLine($"\nDocument: {docGroup.Key}");
    foreach (var barcode in docGroup)
    {
        Console.WriteLine($"  - {barcode.BarcodeType}: {barcode.Text}");
    }
}
Imports Microsoft.VisualBasic
Imports IronBarCode

' List of documents to process - mix of formats supported
Private documentBatch = { "invoice1.pdf", "shipping_label.png", "inventory_sheet.tiff", "product_catalog.pdf" }

' Configure for batch processing
Private batchOptions As New BarcodeReaderOptions With {
	.Multithreaded = True,
	.MaxParallelThreads = Environment.ProcessorCount,
	.Speed = ReadingSpeed.Balanced,
	.ExpectBarcodeTypes = BarcodeEncoding.All
}

' Process all documents in parallel
Private batchResults As BarcodeResults = BarcodeReader.Read(documentBatch, batchOptions)

' Group results by source document
Private resultsByDocument = batchResults.GroupBy(Function(r) r.Filename)

For Each docGroup In resultsByDocument
	Console.WriteLine($vbLf & "Document: {docGroup.Key}")
	For Each barcode In docGroup
		Console.WriteLine($"  - {barcode.BarcodeType}: {barcode.Text}")
	Next barcode
Next docGroup
$vbLabelText   $csharpLabel

이 병렬 처리 방식은 문서를 동시에 처리하여 멀티코어 시스템에서 전체 스캔 시간을 최대 75%까지 단축합니다. Enterprise 규모의 BarCode 처리에 대해서는 당사의 성능 최적화 가이드를 확인해 보십시오.

요약

IronBarcode는 복잡한 BarCode 스캔 작업을 간단한 C# 코드로 변환합니다. 재고 관리 시스템, 문서 처리기, 모바일 애플리케이션을 구축하든, 이 라이브러리는 깨끗한 디지털 BARCODE부터 까다로운 실제 환경의 캡처까지 모든 것을 처리합니다.

주요 기능:

  • 이미지에서 단일 행 BarCode 읽기
  • 손상되거나 회전된 BARCODE를 위한 고급 옵션
  • 포괄적인 PDF 및 TIFF 문서 스캔
  • 멀티스레딩을 활용한 고성능 일괄 처리
  • 모든 주요 BarCode 형식 지원

추가 자료

다음 리소스를 활용하여 BarCode 처리 기능을 확장해 보세요:

소스 코드 다운로드

다음 예제를 직접 실행해 보세요:

애플리케이션에 BarCode 스캔 기능을 구현할 준비가 되셨나요? 지금 무료 체험판을 시작하고 .NET 프로젝트에 Professional 바코드 판독 기능을 추가해 보세요.

지금 바로 IronBarcode으로 시작하세요.
green arrow pointer

자주 묻는 질문

.NET 프로젝트에 바코드 판독 라이브러리를 설치하려면 어떻게 해야 하나요?

IronBarcode 라이브러리는 NuGet 패키지 관리자에서 dotnet add package BarCode 명령어를 사용하거나 Visual Studio의 NuGet 인터페이스를 통해 설치할 수 있습니다. 또는 DLL 파일을 다운로드하여 수동으로 설치할 수도 있습니다.

C#을 사용하여 이미지에서 바코드를 읽는 방법은 무엇입니까?

IronBarcode의 BarcodeReader.Read 메서드를 단 한 줄의 코드로 사용할 수 있습니다. 예: var results = BarcodeReader.Read('image.png'); 이 메서드는 이미지에 있는 모든 바코드 형식을 감지하고 읽습니다.

하나의 이미지나 문서에서 여러 개의 바코드를 감지하는 것이 가능할까요?

예, IronBarcode는 이미지, PDF 또는 멀티프레임 TIFF 파일에서 여러 바코드를 자동으로 감지하고 읽어 각 바코드의 값, 유형 및 위치를 BarcodeResults 컬렉션에 반환합니다.

C#을 사용하여 PDF에서 바코드를 읽는 방법은 무엇인가요?

IronBarcode의 BarcodeReader.ReadPdf 메서드를 사용하여 PDF 문서의 모든 페이지를 스캔할 수 있습니다. 예: var results = BarcodeReader.ReadPdf('document.pdf'); 각 결과에는 바코드가 발견된 페이지 번호가 포함됩니다.

바코드 이미지가 흐릿하거나 회전되어 있으면 어떻게 해야 하나요?

까다로운 이미지를 처리하려면 AutoRotate = true 로 설정하고 SharpenFilter 또는 AdaptiveThresholdFilter 와 같은 이미지 필터를 적용하여 BarcodeReaderOptions 구성하십시오. 정확도를 높이려면 Speed = ExtremeDetail 사용하십시오.

.NET 애플리케이션에서 지원되는 바코드 형식은 무엇입니까?

IronBarcode는 QR 코드, Code 128, Code 39, EAN-13, UPC-A, Data Matrix, PDF417 등 모든 주요 바코드 형식을 지원합니다. BarcodeEncoding.All 사용하여 지원되는 모든 형식의 바코드를 스캔할 수 있습니다.

C# 애플리케이션에서 바코드 스캔 성능을 향상시키려면 어떻게 해야 할까요?

ExpectBarcodeTypes 사용하여 예상되는 바코드 유형을 지정하고, 멀티스레드 처리를 활성화하고, 적절한 Speed 설정을 선택하면 성능을 향상시킬 수 있습니다. 일괄 작업의 경우 파일 경로와 함께 BarcodeReader.Read 사용하십시오.

바코드 판독 오류 처리에 권장되는 접근 방식은 무엇입니까?

바코드 판독 로직을 try-catch 블록으로 감싸고 결과가 null 또는 비어 있는지 확인하십시오. IronBarcode는 자세한 오류 메시지와 검출 신뢰도를 나타내는 Confidence 속성을 제공합니다.

바코드를 스캔한 후 이미지를 추출할 수 있나요?

예, IronBarcode의 BarcodeResult 감지된 바코드의 비트맵을 포함하는 BarcodeImage 속성이 있으며, 이 속성은 저장하거나 별도로 처리할 수 있습니다.

PDF 문서 내 특정 페이지에서 바코드를 읽는 방법은 무엇인가요?

BarcodeReaderOptionsPageNumbers 속성을 설정하여 페이지를 지정하세요. 예: options.PageNumbers = new[] {1, 2, 3}; 이렇게 하면 지정된 페이지만 스캔하여 성능이 최적화됩니다.

.NET에서 바코드 스캔과 호환되는 이미지 형식은 무엇입니까?

IronBarcode는 PNG, JPEG, BMP, GIF, TIFF(멀티프레임 포함) 및 PDF와 같은 형식의 스캔을 지원합니다. 파일 경로, 스트림 또는 바이트 배열에서 이미지를 불러올 수 있습니다.

C#에서 스캔한 바코드의 바이너리 데이터에 어떻게 접근할 수 있나요?

BarcodeResultBinaryValue 속성을 활용하여 원시 바이너리 데이터를 얻을 수 있습니다. 특히 압축 정보나 바이너리 프로토콜과 같은 텍스트 이외의 데이터가 포함된 바코드에 유용합니다.

제이콥 멜러, 팀 아이언 최고기술책임자
최고기술책임자

제이콥 멜러는 Iron Software의 최고 기술 책임자(CTO)이자 C# PDF 기술을 개척한 선구적인 엔지니어입니다. Iron Software의 핵심 코드베이스를 최초로 개발한 그는 창립 초기부터 회사의 제품 아키텍처를 설계해 왔으며, CEO인 캐머런 리밍턴과 함께 회사를 NASA, 테슬라, 그리고 전 세계 정부 기관에 서비스를 제공하는 50명 이상의 직원을 보유한 기업으로 성장시켰습니다.

제이콥은 맨체스터 대학교에서 토목공학 학사 학위(BEng)를 최우등으로 취득했습니다(1998~2001). 1999년 런던에서 첫 소프트웨어 회사를 설립하고 2005년 첫 .NET 컴포넌트를 개발한 후, 마이크로소프트 생태계 전반에 걸쳐 복잡한 문제를 해결하는 데 전문성을 발휘해 왔습니다.

그의 대표 제품인 IronPDF 및 Iron Suite .NET 라이브러리는 전 세계적으로 3천만 건 이상의 NuGet 설치 수를 기록했으며, 그의 핵심 코드는 전 세계 개발자들이 사용하는 다양한 도구에 지속적으로 활용되고 있습니다. 25년의 실무 경험과 41년의 코딩 전문성을 바탕으로, 제이콥은 차세대 기술 리더들을 양성하는 동시에 기업 수준의 C#, Java, Python PDF 기술 혁신을 주도하는 데 주력하고 있습니다.

시작할 준비 되셨나요?
Nuget 다운로드 2,240,258 | 버전: 2026.5 just released
Still Scrolling Icon

아직도 스크롤하고 계신가요?

빠른 증거를 원하시나요? PM > Install-Package BarCode
샘플을 실행하세요 실이 바코드로 변하는 모습을 지켜보세요.