푸터 콘텐츠로 바로가기
동영상

C#에서 여러 페이지로 구성된 GIF 및 TIFF 이미지에서 바코드를 읽는 방법

Scanbot SDK에서 IronBarcode로의 마이그레이션

이 가이드는 서버 측, 데스크톱 또는 확장된 파일 기반 시나리오에서 바코드 처리를 Scanbot SDK에서IronBarcode로 이전하는 .NET 개발 팀을 위해 작성되었습니다. 이는 완전히 동일한 기능을 하는 대체품이 아닙니다. Scanbot SDK는 모바일 카메라 스캔 구성 요소이고,IronBarcode는 파일 및 문서 처리 라이브러리입니다. 이번 마이그레이션은 카메라 전용 모델로는 충족할 수 없는 요구 사항에 따른 범위 변경입니다. 다른 요구 사항을 추가하지 않고 실시간 모바일 카메라 스캔 UI를 교체하는 팀은 마이그레이션을 진행하기 전에 마이그레이션이 적절한지 평가해야 합니다.

MAUI 모바일 앱용 Scanbot으로 시작했지만 이제 ASP.NET Core, 데스크톱 빌드 또는 문서 파이프라인에서 바코드 처리가 필요한 팀의 경우, 기계적 마이그레이션은 간단합니다. 핵심 변경 사항은 ScanbotSDKMain.Barcode.StartScannerAsync(configuration)BarcodeReader.Read(source)로 대체하는 것으로, 여기서 source는 파일 경로, 스트림, 바이트 배열 또는 PDF입니다.

Scanbot SDK에서 마이그레이션해야 하는 이유는 무엇일까요?

서버 측 처리 요구 사항: Scanbot SDK는 ASP.NET Core, 콘솔 애플리케이션, Azure Functions 또는 MAUI 이외의 프로젝트에서는 컴파일되지 않습니다. 모바일 애플리케이션이 업로드된 PDF에서 바코드를 추출하거나 수신 문서의 바코드 값을 검증하는 등 바코드를 처리하는 서버 측 기능을 필요로 하는 경우, Scanbot은 해당 기능을 수행할 수 없습니다. IronBarcode는 동일한 BarcodeReader.Read() API로 모든 컨텍스트에서 실행됩니다.

데스크톱 MAUI 지원: Scanbot의 패키지는 net10.0-androidnet10.0-ios을 대상으로 합니다. Scanbot 패키지가 해당 플랫폼에 대한 어셈블리를 제공하지 않기 때문에 net10.0-windows 또는 net10.0-maccatalystTargetFrameworks에 추가한 MAUI 프로젝트는 데스크톱 대상을 빌드하지 못합니다.IronBarcode iOS 및 Android 외에도 Windows 및 macOS MAUI를 지원합니다 . 즉, 동일한 패키지를 플랫폼별 제외 또는 조건부 참조 없이 다중 대상 MAUI 프로젝트에서 사용할 수 있습니다.

PDF 문서 워크플로우: Scanbot에는 BarcodeScanner.Read(filePath)가 없습니다. 워크플로가 문서 업로드, 스캔한 이미지 아카이브 또는 PDF 송장에서 바코드를 읽는 기능을 포함하도록 발전할 경우, Scanbot의 아키텍처는 이를 수용할 수 없습니다.IronBarcode PDF와 이미지를 직접 읽어들이며, 각 결과에는 바코드가 발견된 페이지 번호가 포함됩니다.

가격 모델 예측 가능성: Scanbot은 연간 고정 요금을 사용합니다. 어떤 조직에게는, 연간 갱신이 대안을 평가하는 방아쇠입니다 — 특히 프로젝트 범위가 서버 사이드 또는 Scanbot의 커버리지를 벗어나는 데스크톱 타겟을 포함하도록 확장된 경우, 그러합니다.IronBarcode는 일회성 구매로 영구 사용권을 확보할 수 있어 매년 갱신할 필요가 없습니다.

근본적인 문제

Scanbot SDK는 실시간 카메라 피드를 필요로 합니다. 요구사항이 모바일 환경을 넘어 확장될 경우, 기존 의존성을 통한 동등한 해결책은 없습니다.

// Scanbot SDK: camera-only — no file or server equivalent exists
var configuration = new BarcodeScannerScreenConfiguration
{
    BarcodeFormats = new[] { BarcodeFormat.Code128, BarcodeFormat.QrCode }
};

// This call requires iOS or Android hardware and a MAUI camera UI
// It cannot be redirected to a file path, stream, or server context
var result = await ScanbotSDKMain.Barcode.StartScannerAsync(configuration);
// Scanbot SDK: camera-only — no file or server equivalent exists
var configuration = new BarcodeScannerScreenConfiguration
{
    BarcodeFormats = new[] { BarcodeFormat.Code128, BarcodeFormat.QrCode }
};

// This call requires iOS or Android hardware and a MAUI camera UI
// It cannot be redirected to a file path, stream, or server context
var result = await ScanbotSDKMain.Barcode.StartScannerAsync(configuration);
Imports System.Threading.Tasks

' Scanbot SDK: camera-only — no file or server equivalent exists
Dim configuration As New BarcodeScannerScreenConfiguration With {
    .BarcodeFormats = {BarcodeFormat.Code128, BarcodeFormat.QrCode}
}

' This call requires iOS or Android hardware and a MAUI camera UI
' It cannot be redirected to a file path, stream, or server context
Dim result = Await ScanbotSDKMain.Barcode.StartScannerAsync(configuration)
$vbLabelText   $csharpLabel

IronBarcode 모든 프로젝트 환경에서 파일, 스트림, 바이트 배열 또는 PDF와 같은 동일한 소스 유형을 허용합니다.

// IronBarcode: the same call works in MAUI, ASP.NET Core, console, WPF, Azure Functions
IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";

// From a file — works on any platform
var results = BarcodeReader.Read("invoice.pdf");
foreach (var result in results)
    Console.WriteLine($"Page {result.PageNumber}: {result.Value} ({result.BarcodeType})");
// IronBarcode: the same call works in MAUI, ASP.NET Core, console, WPF, Azure Functions
IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";

// From a file — works on any platform
var results = BarcodeReader.Read("invoice.pdf");
foreach (var result in results)
    Console.WriteLine($"Page {result.PageNumber}: {result.Value} ({result.BarcodeType})");
Imports IronBarCode

' IronBarcode: the same call works in MAUI, ASP.NET Core, console, WPF, Azure Functions
License.LicenseKey = "YOUR-LICENSE-KEY"

' From a file — works on any platform
Dim results = BarcodeReader.Read("invoice.pdf")
For Each result In results
    Console.WriteLine($"Page {result.PageNumber}: {result.Value} ({result.BarcodeType})")
Next
$vbLabelText   $csharpLabel

IronBarcode와 Scanbot SDK의 기능 비교

기능 스캔봇 SDK IronBarcode
파일 경로에서 입력 아니요
스트림에서 입력 아니요
바이트 배열에서 입력 아니요
PDF 바코드 추출 아니요
라이브 카메라 뷰파인더 아니요 (미디어피커를 사용하세요)
바코드 생성 아니요
iOS MAUI
안드로이드 MAUI
윈도우 MAUI 아니요
macOS MAUI 아니요
ASP.NET Core 아니요
콘솔/서버 아니요
Azure / Lambda / Docker 아니요
.NET Framework 4.6.2 이상 아니요
머신러닝 오류 수정 아니요
손상된 바코드 복구 아니요
자동 형식 감지
1D 형식 20세 이상 30세 이상
2D 형식 QR, 데이터매트릭스, PDF417, 아즈텍 QR, 데이터매트릭스, PDF417, 아즈텍, 맥시코드
라이선스 모델 연간 정액 요금 일회성 영구
공개된 가격 영업 연락 예 ($999–$5,999)

빠른 시작: Scanbot SDK에서IronBarcode로 마이그레이션

1단계: NuGet 패키지 교체

Scanbot 패키지를 제거하세요:

dotnet remove package ScanbotBarcodeSDK.MAUI
dotnet remove package ScanbotBarcodeSDK.MAUI
SHELL

프로젝트가 .csproj 파일에서 조건부 패키지 참조를 사용하는 경우, 해당 항목도 제거하십시오:


<PackageReference Include="ScanbotBarcodeSDK.MAUI" Version="8.0.0" />

<PackageReference Include="ScanbotBarcodeSDK.MAUI" Version="8.0.0" />
XML

IronBarcode 설치하세요:

dotnet add package IronBarcode
dotnet add package IronBarcode
SHELL

IronBarcode NuGet 에서 사용할 수 있으며 .NET 6, 7, 8, 9 및 .NET Framework 4.6.2 이상을 지원합니다. MAUI 멀티 타겟 프로젝트의 경우, 단일 dotnet add package가 모든 대상에 대해 작동하며, 플랫폼 조건부 패키지 참조는 필요하지 않습니다.

단계 2: 네임스페이스 업데이트

Scanbot 네임스페이스를IronBarcode네임스페이스로 교체하십시오.

// Remove
using ScanbotSDK.MAUI;

// Add
using IronBarCode;
// Remove
using ScanbotSDK.MAUI;

// Add
using IronBarCode;
Imports IronBarCode
$vbLabelText   $csharpLabel

단계 3: 라이선스 초기화

Scanbot 초기화 블록을 제거하고IronBarcode라이선스 키로 교체하십시오. 프로젝트 유형에 따라 MauiProgram.cs, App.xaml.cs 또는 Program.cs에 애플리케이션 시작 시 라이선스 초기화를 추가하십시오:

// Remove this
ScanbotSDKMain.Initialize(new SdkConfiguration
{
    LicenseKey = "YOUR-SCANBOT-LICENSE-KEY",
    LoggingEnabled = false
});

// Add this — one line, placed once at startup
IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";
// Remove this
ScanbotSDKMain.Initialize(new SdkConfiguration
{
    LicenseKey = "YOUR-SCANBOT-LICENSE-KEY",
    LoggingEnabled = false
});

// Add this — one line, placed once at startup
IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";
' Remove this
ScanbotSDKMain.Initialize(New SdkConfiguration With {
    .LicenseKey = "YOUR-SCANBOT-LICENSE-KEY",
    .LoggingEnabled = False
})

' Add this — one line, placed once at startup
IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY"
$vbLabelText   $csharpLabel

코드 마이그레이션 예제

MAUI 사진 촬영

Scanbot의 스캔 호출은 전체 화면 카메라 UI를 열고 사용자가 바코드를 스캔하거나 취소하면 종료됩니다.IronBarcode카메라 UI를 제공하지 않습니다. 교체된 사항은 MAUI의 MediaPicker를 사용하여 시스템 카메라를 호출하고 사진을 촬영하여 이미지 바이트를 BarcodeReader.Read()로 전달하는 것입니다.

Scanbot SDK 접근 방식:

using ScanbotSDK.MAUI;

private async void ScanButton_Clicked(object sender, EventArgs e)
{
    var configuration = new BarcodeScannerScreenConfiguration
    {
        BarcodeFormats = new[]
        {
            BarcodeFormat.Code128,
            BarcodeFormat.QrCode,
            BarcodeFormat.Ean13
        },
        FinderAspectRatio = new AspectRatio(1, 1),
        TopBarBackgroundColor = Colors.DarkBlue
    };

    var result = await ScanbotSDKMain.Barcode.StartScannerAsync(configuration);

    if (result.Status == OperationResult.Ok)
    {
        foreach (var barcode in result.Barcodes)
            ResultLabel.Text = $"{barcode.Format}: {barcode.Text}";
    }
}
using ScanbotSDK.MAUI;

private async void ScanButton_Clicked(object sender, EventArgs e)
{
    var configuration = new BarcodeScannerScreenConfiguration
    {
        BarcodeFormats = new[]
        {
            BarcodeFormat.Code128,
            BarcodeFormat.QrCode,
            BarcodeFormat.Ean13
        },
        FinderAspectRatio = new AspectRatio(1, 1),
        TopBarBackgroundColor = Colors.DarkBlue
    };

    var result = await ScanbotSDKMain.Barcode.StartScannerAsync(configuration);

    if (result.Status == OperationResult.Ok)
    {
        foreach (var barcode in result.Barcodes)
            ResultLabel.Text = $"{barcode.Format}: {barcode.Text}";
    }
}
Imports ScanbotSDK.MAUI

Private Async Sub ScanButton_Clicked(sender As Object, e As EventArgs)
    Dim configuration = New BarcodeScannerScreenConfiguration With {
        .BarcodeFormats = New BarcodeFormat() {
            BarcodeFormat.Code128,
            BarcodeFormat.QrCode,
            BarcodeFormat.Ean13
        },
        .FinderAspectRatio = New AspectRatio(1, 1),
        .TopBarBackgroundColor = Colors.DarkBlue
    }

    Dim result = Await ScanbotSDKMain.Barcode.StartScannerAsync(configuration)

    If result.Status = OperationResult.Ok Then
        For Each barcode In result.Barcodes
            ResultLabel.Text = $"{barcode.Format}: {barcode.Text}"
        Next
    End If
End Sub
$vbLabelText   $csharpLabel

IronBarcode 접근 방식:

// NuGet: dotnet add package IronBarcode
using IronBarCode;

private async void ScanButton_Clicked(object sender, EventArgs e)
{
    var photo = await MediaPicker.CapturePhotoAsync();
    if (photo == null) return;

    using var stream = await photo.OpenReadAsync();
    using var ms = new MemoryStream();
    await stream.CopyToAsync(ms);

    var results = BarcodeReader.Read(ms.ToArray());
    var first = results.FirstOrDefault();
    ResultLabel.Text = first != null
        ? $"{first.BarcodeType}: {first.Value}"
        : "No barcode found";
}
// NuGet: dotnet add package IronBarcode
using IronBarCode;

private async void ScanButton_Clicked(object sender, EventArgs e)
{
    var photo = await MediaPicker.CapturePhotoAsync();
    if (photo == null) return;

    using var stream = await photo.OpenReadAsync();
    using var ms = new MemoryStream();
    await stream.CopyToAsync(ms);

    var results = BarcodeReader.Read(ms.ToArray());
    var first = results.FirstOrDefault();
    ResultLabel.Text = first != null
        ? $"{first.BarcodeType}: {first.Value}"
        : "No barcode found";
}
Imports IronBarCode
Imports System.IO
Imports System.Linq
Imports System.Threading.Tasks

Private Async Sub ScanButton_Clicked(sender As Object, e As EventArgs)
    Dim photo = Await MediaPicker.CapturePhotoAsync()
    If photo Is Nothing Then Return

    Using stream = Await photo.OpenReadAsync()
        Using ms As New MemoryStream()
            Await stream.CopyToAsync(ms)

            Dim results = BarcodeReader.Read(ms.ToArray())
            Dim first = results.FirstOrDefault()
            ResultLabel.Text = If(first IsNot Nothing, $"{first.BarcodeType}: {first.Value}", "No barcode found")
        End Using
    End Using
End Sub
$vbLabelText   $csharpLabel

사용자 경험(UX) 변경 사항은 사용자가 스캔 영역이 겹쳐 표시된 Scanbot의 내장 뷰파인더 대신 시스템 카메라 화면을 보게 된다는 것입니다. 재고 관리, 물류, 문서 워크플로 등 비즈니스 애플리케이션의 경우 시스템 카메라가 충분합니다. .NET MAUI 바코드 스캐너 튜토리얼은 권한 처리를 포함하여 iOS 및 Android 대상 모두에 대한 전체 통합 패턴을 다룹니다.

스캔 옵션 및 구성

Scanbot의 BarcodeScannerScreenConfiguration는 스캐너가 허용하는 형식과 카메라 UI 모양을 제어합니다. IronBarcode의 BarcodeReaderOptions는 이미지 분석 방법 — 처리 속도, 다중 바코드 감지 및 유사한 매개변수를 제어합니다. 기본 작업이 서로 다르기 때문에 구성 개념은 서로 다른 관심사에 대응됩니다.

Scanbot SDK 접근 방식:

var configuration = new BarcodeScannerScreenConfiguration
{
    BarcodeFormats = new[] { BarcodeFormat.Code128, BarcodeFormat.QrCode },
    FinderAspectRatio = new AspectRatio(1, 1),
    FlashEnabled = false,
    OrientationLockMode = OrientationLockMode.Portrait
};

var result = await ScanbotSDKMain.Barcode.StartScannerAsync(configuration);

if (result.Status == OperationResult.Ok)
{
    foreach (var barcode in result.Barcodes)
        Console.WriteLine($"{barcode.Format}: {barcode.Text}");
}
var configuration = new BarcodeScannerScreenConfiguration
{
    BarcodeFormats = new[] { BarcodeFormat.Code128, BarcodeFormat.QrCode },
    FinderAspectRatio = new AspectRatio(1, 1),
    FlashEnabled = false,
    OrientationLockMode = OrientationLockMode.Portrait
};

var result = await ScanbotSDKMain.Barcode.StartScannerAsync(configuration);

if (result.Status == OperationResult.Ok)
{
    foreach (var barcode in result.Barcodes)
        Console.WriteLine($"{barcode.Format}: {barcode.Text}");
}
Imports System
Imports System.Threading.Tasks

Dim configuration As New BarcodeScannerScreenConfiguration With {
    .BarcodeFormats = {BarcodeFormat.Code128, BarcodeFormat.QrCode},
    .FinderAspectRatio = New AspectRatio(1, 1),
    .FlashEnabled = False,
    .OrientationLockMode = OrientationLockMode.Portrait
}

Dim result = Await ScanbotSDKMain.Barcode.StartScannerAsync(configuration)

If result.Status = OperationResult.Ok Then
    For Each barcode In result.Barcodes
        Console.WriteLine($"{barcode.Format}: {barcode.Text}")
    Next
End If
$vbLabelText   $csharpLabel

IronBarcode 접근 방식:

using IronBarCode;

// Format detection is automatic — BarcodeReaderOptions controls processing behavior
var options = new BarcodeReaderOptions
{
    Speed = ReadingSpeed.Balanced,
    ExpectMultipleBarcodes = false
};

// Combined with the MediaPicker capture pattern
var photo = await MediaPicker.CapturePhotoAsync();
if (photo == null) return;

using var photoStream = await photo.OpenReadAsync();
using var ms = new MemoryStream();
await photoStream.CopyToAsync(ms);

var results = BarcodeReader.Read(ms.ToArray(), options);
foreach (var result in results)
    Console.WriteLine($"{result.BarcodeType}: {result.Value}");
using IronBarCode;

// Format detection is automatic — BarcodeReaderOptions controls processing behavior
var options = new BarcodeReaderOptions
{
    Speed = ReadingSpeed.Balanced,
    ExpectMultipleBarcodes = false
};

// Combined with the MediaPicker capture pattern
var photo = await MediaPicker.CapturePhotoAsync();
if (photo == null) return;

using var photoStream = await photo.OpenReadAsync();
using var ms = new MemoryStream();
await photoStream.CopyToAsync(ms);

var results = BarcodeReader.Read(ms.ToArray(), options);
foreach (var result in results)
    Console.WriteLine($"{result.BarcodeType}: {result.Value}");
Imports IronBarCode
Imports System.IO

' Format detection is automatic — BarcodeReaderOptions controls processing behavior
Dim options As New BarcodeReaderOptions With {
    .Speed = ReadingSpeed.Balanced,
    .ExpectMultipleBarcodes = False
}

' Combined with the MediaPicker capture pattern
Dim photo = Await MediaPicker.CapturePhotoAsync()
If photo Is Nothing Then Return

Using photoStream = Await photo.OpenReadAsync()
    Using ms As New MemoryStream()
        Await photoStream.CopyToAsync(ms)

        Dim results = BarcodeReader.Read(ms.ToArray(), options)
        For Each result In results
            Console.WriteLine($"{result.BarcodeType}: {result.Value}")
        Next
    End Using
End Using
$vbLabelText   $csharpLabel

형식 지정은 필요하지 않습니다.IronBarcode지원되는 모든 형식을 자동으로 감지합니다. Scanbot 구성을 가장 직접적으로 대응시키는 BarcodeReaderOptions 매개변수는 Speed (처리 철저함 대 성능을 제어) 및 ExpectMultipleBarcodes (첫 번째 일치 후 스캔 계속)입니다.

서버 측 PDF 처리

이 시나리오에는 Scanbot에 해당하는 기능이 없습니다.IronBarcode사용하면 MAUI 모바일 앱에 설치된 동일한 패키지를 서버 측 ASP.NET Core 엔드포인트에서 PDF의 바코드를 추출할 수 있으므로, 팀은 두 배포 환경 모두에서 작동하는 단일 바코드 종속성을 사용할 수 있습니다.

Scanbot SDK 접근 방식:

// 스캔봇 SDK cannot be used here — the package does not compile
// in ASP.NET Core, Azure Functions, console apps, or any non-MAUI project.
// There is no server-side Scanbot equivalent for this endpoint.
// 스캔봇 SDK cannot be used here — the package does not compile
// in ASP.NET Core, Azure Functions, console apps, or any non-MAUI project.
// There is no server-side Scanbot equivalent for this endpoint.
' 스캔봇 SDK cannot be used here — the package does not compile
' in ASP.NET Core, Azure Functions, console apps, or any non-MAUI project.
' There is no server-side Scanbot equivalent for this endpoint.
$vbLabelText   $csharpLabel

IronBarcode 접근 방식:

// NuGet: dotnet add package IronBarcode
// Works in ASP.NET Core, console apps, Azure Functions, Docker — the same package as MAUI
using IronBarCode;

[HttpPost("extract-barcodes")]
public async Task<IActionResult> ExtractBarcodes(IFormFile file)
{
    using var ms = new MemoryStream();
    await file.CopyToAsync(ms);

    // Reads all barcodes from all pages of the uploaded PDF
    var results = BarcodeReader.Read(ms.ToArray());
    var values = results.Select(r => new
    {
        r.Value,
        Format = r.Format.ToString(),
        r.PageNumber
    });

    return Ok(values);
}
// NuGet: dotnet add package IronBarcode
// Works in ASP.NET Core, console apps, Azure Functions, Docker — the same package as MAUI
using IronBarCode;

[HttpPost("extract-barcodes")]
public async Task<IActionResult> ExtractBarcodes(IFormFile file)
{
    using var ms = new MemoryStream();
    await file.CopyToAsync(ms);

    // Reads all barcodes from all pages of the uploaded PDF
    var results = BarcodeReader.Read(ms.ToArray());
    var values = results.Select(r => new
    {
        r.Value,
        Format = r.Format.ToString(),
        r.PageNumber
    });

    return Ok(values);
}
Imports IronBarCode
Imports Microsoft.AspNetCore.Mvc
Imports System.IO
Imports System.Threading.Tasks

<HttpPost("extract-barcodes")>
Public Async Function ExtractBarcodes(file As IFormFile) As Task(Of IActionResult)
    Using ms As New MemoryStream()
        Await file.CopyToAsync(ms)

        ' Reads all barcodes from all pages of the uploaded PDF
        Dim results = BarcodeReader.Read(ms.ToArray())
        Dim values = results.Select(Function(r) New With {
            .Value = r.Value,
            .Format = r.Format.ToString(),
            .PageNumber = r.PageNumber
        })

        Return Ok(values)
    End Using
End Function
$vbLabelText   $csharpLabel

IronBarcode는 다중 페이지 PDF를 네이티브로 처리합니다 — 각 결과에는 바코드가 발견된 페이지를 나타내는 PageNumber 속성이 있습니다. PDF 바코드 추출 가이드는 페이지 범위 선택 및 대용량 문서 일괄 처리를 위한 성능 최적화를 포함하여 PDF 읽기 옵션 전반에 대한 내용을 다룹니다.

ASP.NET Core 백그라운드 처리

Azure Functions 또는 Worker Services와 같은 배치 워크플로에서 보관된 PDF 문서를 처리하는 경우IronBarcode MAUI 앱 및 ASP.NET Core 컨트롤러에서 사용되는 것과 동일한 API를 제공합니다.

Scanbot SDK 접근 방식:

// 스캔봇 SDK does not support this deployment context.
// The package will not compile in Azure Functions or Worker Services.
// 스캔봇 SDK does not support this deployment context.
// The package will not compile in Azure Functions or Worker Services.
$vbLabelText   $csharpLabel

IronBarcode 접근 방식:

// NuGet: dotnet add package IronBarcode
using IronBarCode;

// Azure Function or Worker Service batch processing
public void ProcessInvoiceBatch(IEnumerable<string> filePaths)
{
    foreach (var filePath in filePaths)
    {
        var results = BarcodeReader.Read(filePath);
        foreach (var result in results)
            Console.WriteLine($"File: {filePath} | Page {result.PageNumber}: {result.Value} ({result.BarcodeType})");
    }
}
// NuGet: dotnet add package IronBarcode
using IronBarCode;

// Azure Function or Worker Service batch processing
public void ProcessInvoiceBatch(IEnumerable<string> filePaths)
{
    foreach (var filePath in filePaths)
    {
        var results = BarcodeReader.Read(filePath);
        foreach (var result in results)
            Console.WriteLine($"File: {filePath} | Page {result.PageNumber}: {result.Value} ({result.BarcodeType})");
    }
}
Imports IronBarCode

Public Sub ProcessInvoiceBatch(filePaths As IEnumerable(Of String))
    For Each filePath In filePaths
        Dim results = BarcodeReader.Read(filePath)
        For Each result In results
            Console.WriteLine($"File: {filePath} | Page {result.PageNumber}: {result.Value} ({result.BarcodeType})")
        Next
    Next
End Sub
$vbLabelText   $csharpLabel

스캔봇 SDK API와IronBarcode매핑 참조

스캔봇 SDK IronBarcode
ScanbotSDKMain.Initialize(new SdkConfiguration { LicenseKey = "..." }) IronBarCode.License.LicenseKey = "key"
new BarcodeScannerScreenConfiguration() new BarcodeReaderOptions()
ScanbotSDKMain.Barcode.StartScannerAsync(configuration) BarcodeReader.Read(path / stream / bytes)
result.Status == OperationResult.Ok results.Any() 또는 results.FirstOrDefault() != null
result.Barcodes BarcodeReader.Read()의 반환 값
barcode.Format result.BarcodeType (IronBarCode.BarcodeEncoding)
barcode.Text result.Value
BarcodeFormat.Code128 BarcodeEncoding.Code128
BarcodeFormat.QrCode BarcodeEncoding.QRCode
BarcodeFormat.Ean13 BarcodeEncoding.EAN13
BarcodeScannerScreenConfiguration.FinderAspectRatio 해당 기능 없음 - 이미지 프레임은 MediaPicker에서 처리합니다.
BarcodeScannerScreenConfiguration.FlashEnabled 동등한 기능이 없습니다. MediaPicker 옵션을 사용하세요.
카메라 입력 필요 파일 경로, 스트림, 바이트 배열 또는 PDF
iOS 및 Android MAUI 전용 모든 .NET 플랫폼 및 프로젝트 유형

일반적인 마이그레이션 문제와 해결책

문제 1: 라이브 뷰파인더에 상응하는 기능이 없음

Scanbot SDK: 스캔 영역에 오버레이를 표시하고, 햅틱 피드백을 제공하며, 실시간 비디오 피드에서 바코드를 지속적으로 감지하는 기능을 갖춘 실시간 카메라 뷰파인더를 스캔 환경에 내장합니다.

해결책: MAUI의 MediaPicker.CapturePhotoAsync()를 사용하여 시스템 카메라를 열고 정지 이미지를 캡처하여 처리:

var photo = await MediaPicker.CapturePhotoAsync();
if (photo == null) return;

using var stream = await photo.OpenReadAsync();
using var ms = new MemoryStream();
await stream.CopyToAsync(ms);

var results = BarcodeReader.Read(ms.ToArray());
var photo = await MediaPicker.CapturePhotoAsync();
if (photo == null) return;

using var stream = await photo.OpenReadAsync();
using var ms = new MemoryStream();
await stream.CopyToAsync(ms);

var results = BarcodeReader.Read(ms.ToArray());
Imports System.IO

Dim photo = Await MediaPicker.CapturePhotoAsync()
If photo Is Nothing Then Return

Using stream = Await photo.OpenReadAsync()
    Using ms As New MemoryStream()
        Await stream.CopyToAsync(ms)

        Dim results = BarcodeReader.Read(ms.ToArray())
    End Using
End Using
$vbLabelText   $csharpLabel

업무용으로는 시스템 카메라가 충분합니다. 실시간 오버레이가 사용자 경험의 핵심인 소비자용 앱의 경우, 마이그레이션을 진행하기 전에 이러한 UX 변경 사항이 수용 가능한지 평가해야 합니다.

문제 2: 카메라 권한 차이

Scanbot SDK: Scanbot 패키지는 UI 흐름의 일부로 카메라 권한 요청을 처리했으므로 카메라 권한은 SDK 초기화 및 스캐너 실행 시 암묵적으로 관리되었습니다.

해결책: MediaPicker를 사용하면, MAUI는 표준 메커니즘을 통해 권한을 처리합니다. AndroidManifest.xml에 카메라 권한 선언이 포함되어 있는지 확인하고, Info.plistNSCameraUsageDescription 키가 포함되어 있는지 확인하세요. 이러한 항목들은 일반적으로 MAUI 프로젝트 템플릿의 구조에 포함되어 있습니다. 앱이 이전에 카메라 접근을 위해 Scanbot만 사용했던 경우, 테스트 전에 다음 매니페스트 항목이 있는지 확인하십시오.


<uses-permission android:name="android.permission.CAMERA" />

<key>NSCameraUsageDescription</key>
<string>This app uses the camera to scan barcodes.</string>

<uses-permission android:name="android.permission.CAMERA" />

<key>NSCameraUsageDescription</key>
<string>This app uses the camera to scan barcodes.</string>
XML

문제 3: Windows 빌드 오류 해결됨

Scanbot SDK: ScanbotBarcodeSDK.MAUI 패키지는 net10.0-androidnet10.0-ios만을 대상으로 하여 net10.0-windowsTargetFrameworks에 존재할 때 빌드 실패를 유발합니다.

해결 방법: Scanbot 패키지 참조를 제거하면 Windows 빌드 오류가 해결됩니다.IronBarcode플랫폼 조건부 구성 없이 모든 MAUI 대상에서 올바르게 작동합니다.

# Verify the build succeeds on all targets after removing Scanbot and adding IronBarcode
dotnet build -f net10.0-windows10.0.19041.0
dotnet build -f net10.0-ios
dotnet build -f net10.0-android
# Verify the build succeeds on all targets after removing Scanbot and adding IronBarcode
dotnet build -f net10.0-windows10.0.19041.0
dotnet build -f net10.0-ios
dotnet build -f net10.0-android
SHELL

문제 4: 열거형 네임스페이스 형식 변경

Scanbot SDK:에서는 BarcodeFormat 열거형 값이 ScanbotBarcodeSDK.MAUI 네임스페이스에서 BarcodeFormat.Code128 등의 값을 사용합니다.

해결책: IronBarcode는 IronBarCode 네임스페이스에서 BarcodeEncoding 열거형을 사용합니다. 형식 참조 및 형식 열거형 값을 저장, 비교 또는 전환하는 모든 코드를 업데이트하십시오.

// Before (Scanbot)
BarcodeFormat.Code128
BarcodeFormat.QrCode
BarcodeFormat.Ean13

// After (IronBarcode)
BarcodeEncoding.Code128
BarcodeEncoding.QRCode
BarcodeEncoding.EAN13
// Before (Scanbot)
BarcodeFormat.Code128
BarcodeFormat.QrCode
BarcodeFormat.Ean13

// After (IronBarcode)
BarcodeEncoding.Code128
BarcodeEncoding.QRCode
BarcodeEncoding.EAN13
' Before (Scanbot)
BarcodeFormat.Code128
BarcodeFormat.QrCode
BarcodeFormat.Ean13

' After (IronBarcode)
BarcodeEncoding.Code128
BarcodeEncoding.QRCode
BarcodeEncoding.EAN13
$vbLabelText   $csharpLabel

IronBarcode는 기본적으로 모든 지원되는 형식을 자동으로 감지합니다 — BarcodeReaderOptions를 통한 명시적 형식 필터링은 예상 형식이 미리 알려진 경우 성능 최적화에만 필요합니다.

스캔봇 SDK 마이그레이션 체크리스트

이동 전 작업

코드베이스를 감사하여 스캔봇 SDK 사용 내역을 모두 파악하십시오.

grep -rn "ScanbotSDK.Initialize" --include="*.cs" .
grep -rn "BarcodeScannerScreenConfiguration" --include="*.cs" .
grep -rn "ScanbotSDKMain.Barcode.StartScannerAsync" --include="*.cs" .
grep -rn "result\.Barcodes" --include="*.cs" .
grep -rn "barcode\.Format" --include="*.cs" .
grep -rn "barcode\.Text" --include="*.cs" .
grep -rn "OperationResult\.Ok" --include="*.cs" .
grep -rn "using ScanbotBarcodeSDK" --include="*.cs" .
grep -rn "BarcodeFormat\." --include="*.cs" .
grep -rn "ScanbotSDK.Initialize" --include="*.cs" .
grep -rn "BarcodeScannerScreenConfiguration" --include="*.cs" .
grep -rn "ScanbotSDKMain.Barcode.StartScannerAsync" --include="*.cs" .
grep -rn "result\.Barcodes" --include="*.cs" .
grep -rn "barcode\.Format" --include="*.cs" .
grep -rn "barcode\.Text" --include="*.cs" .
grep -rn "OperationResult\.Ok" --include="*.cs" .
grep -rn "using ScanbotBarcodeSDK" --include="*.cs" .
grep -rn "BarcodeFormat\." --include="*.cs" .
SHELL
  • 모든 스캔 호출 지점을 문서화하고 해당 지점이 공유 코드, 플랫폼별 코드 또는 UI 이벤트 핸들러에 있는지 여부를 기록합니다.
  • 페이지 또는 워크플로우 중 Scanbot의 실시간 뷰파인더를 주요 사용자 상호 작용으로 사용하는 부분이 있는지 확인합니다.
  • 카메라 권한 항목이 AndroidManifest.xmlInfo.plist에 존재하는지 확인하세요
  • Scanbot에 연결된 조건부 패키지 참조를 위한 .csproj 검토

코드 업데이트 작업

  1. ScanbotSDK.MAUI NuGet 패키지 제거
  2. .csproj에서 Scanbot에 대한 조건부 <PackageReference> 항목 제거
  3. IronBarcode NuGet Install-Package
  4. 모든 파일에서 using ScanbotSDK.MAUI;using IronBarCode;로 대체
  5. 애플리케이션 시작 시 ScanbotSDK.Initialize(...)IronBarCode.License.LicenseKey = "key"로 대체
  6. 스트림 복사 및 BarcodeReader.Read(bytes)가 포함된 MAUI 카메라 워크플로우에서 ScanbotSDKMain.Barcode.StartScannerAsync(configuration)MediaPicker.CapturePhotoAsync()로 대체
  7. 서버측 및 파일 처리 컨텍스트에서 ScanbotSDKMain.Barcode.StartScannerAsync(configuration)BarcodeReader.Read(filePath) 또는 BarcodeReader.Read(stream)로 대체
  8. result.Status == OperationResult.Ok 검사를 results.Any() 또는 results.FirstOrDefault() != null로 대체
  9. result.Barcodes 컬렉션 참조를 BarcodeReader.Read()의 반환 값으로 대체
  10. barcode.Text 속성 액세스를 result.Value로 대체
  11. BarcodeFormat.* 열거형 값을 BarcodeEncoding.* 상당한 값으로 대체
  12. 처리 옵션이 필요한 경우 new BarcodeScannerScreenConfiguration()new BarcodeReaderOptions()로 대체

마이그레이션 후 테스트

  • Windows 및 macOS를 포함한 모든 MAUI 대상 플랫폼에서 빌드가 성공하는지 확인합니다(해당되는 경우).
  • 실제 iOS 장치 및 실제 Android 장치에서 MediaPicker.CapturePhotoAsync() 흐름 테스트 -IronBarcode로 디코딩한 바코드 값이 동일한 물리적 바코드에 대해 Scanbot으로 이전에 디코딩한 값과 일치하는지 확인하십시오.
  • 프로젝트에 문서 처리 워크플로가 포함된 경우, 여러 페이지로 구성된 PDF 추출 기능을 테스트하십시오.
  • BarcodeScannerScreenConfiguration.BarcodeFormats에서 이전에 구성된 모든 바코드 유형을 형식 감지가 포함하는지 확인
  • 서버 측 엔드포인트 또는 백그라운드 작업이 동일한 문서 샘플에서 올바른 결과를 생성하는지 확인합니다.
  • iOS 및 Android에서 첫 실행 시 카메라 권한 요청 메시지가 올바르게 표시되는지 확인합니다.

IronBarcode로 마이그레이션할 때의 주요 이점

모든 배포 대상에 걸쳐 통합 패키지:IronBarcode는 한 번 설치하면 MAUI 모바일, MAUI 데스크톱, ASP.NET Core, Azure Functions, 콘솔 애플리케이션 및 Windows 데스크톱 애플리케이션에서 실행됩니다. 이제 팀들은 동일 시스템의 각기 다른 부분에 대해 별도의 바코드 종속성을 설정할 필요가 없습니다.

PDF 및 문서 처리:IronBarcode PDF 파일에서 바코드를 기본적으로 읽어들이며, 각 결과에는 바코드가 발견된 페이지 번호가 포함됩니다. Scanbot 모델 내에서 이전에는 불가능했던 문서 워크플로우가 BarcodeReader.Read("document.pdf")로 간단한 작업이 됩니다.

Windows 및 macOS 데스크톱 MAUI 지원: Scanbot을 제거하면 Windows 또는 macOS를 포함하는 다중 대상 MAUI 프로젝트가 오류 없이 빌드됩니다.IronBarcode네 가지 MAUI 대상 모두에서 동일한 바코드 판독 API를 제공하므로 Scanbot에서 필요했던 플랫폼별 종속성 관리가 필요 없습니다.

영구 라이선스 소유권: 일회성 구매 모델로 매년 갱신 의무가 없습니다.IronBarcode라이선스를 취득하면 추가 비용 없이 구매한 등급으로 무기한 사용할 수 있습니다. 프로젝트 범위가 Scanbot의 모바일 서비스 범위를 넘어 확장된 팀은 영구 라이선스 모델이 장기적인 비용 계획에 더 적합하다고 판단합니다.

바코드 생성:IronBarcode이미지 파일, 스트림 또는 임베디드 콘텐츠 등 지원되는 모든 형식의 바코드를 생성할 수 있습니다. 읽기와 생성이 모두 필요한 프로젝트는 더 이상 Scanbot 외에 두 번째 라이브러리가 필요하지 않습니다.

머신러닝 기반 판독:IronBarcode머신러닝 기반 오류 수정 및 손상된 바코드 복구 기능을 적용하여 표준 감지 알고리즘이 해독하지 못하는 저대비, 부분 손상, 불량 인쇄 품질과 같은 까다로운 실제 이미지 환경을 처리합니다. 이 기능은 이미지 품질이 가변적인 문서 처리 워크플로에 특히 중요합니다.

참고해 주세요Scanbot SDK는 해당 소유자의 등록 상표입니다. 이 사이트는 Scanbot SDK와 관련이 없으며, Scanbot SDK로부터 승인받지 않았으며, Scanbot SDK로부터 후원을 받지 않았습니다. 모든 제품명, 로고 및 브랜드는 해당 소유자의 자산입니다. 비교는 정보 제공 목적으로만 사용되며, 작성 시점에 공개적으로 이용 가능한 정보를 반영합니다.

자주 묻는 질문

Scanbot SDK에서 IronBarcode로 마이그레이션해야 하는 이유는 무엇인가요?

일반적인 이유로는 라이선스 간소화(SDK + 런타임 키 복잡성 제거), 처리량 제한 제거, 네이티브 PDF 지원 확보, Docker/CI/CD 배포 개선, 프로덕션 코드의 API 상용구 감소 등이 있습니다.

Scanbot API 호출을 IronBarcode로 대체하려면 어떻게 해야 하나요?

인스턴스 생성 및 라이선스 상용구를 IronBarCode.License.LicenseKey = "key"로 대체합니다. 판독기 호출을 BarcodeReader.Read(경로)로, 쓰기 호출을 BarcodeWriter.CreateBarcode(데이터, 인코딩)로 바꿉니다. 정적 메서드는 인스턴스 관리가 필요하지 않습니다.

Scanbot SDK에서 IronBarcode로 마이그레이션할 때 얼마나 많은 코드가 변경되나요?

대부분의 마이그레이션은 더 적은 코드 줄로 이루어집니다. 라이선스 상용구, 인스턴스 생성자, 명시적 형식 구성이 제거됩니다. 핵심 읽기/쓰기 작업이 더 간결한 결과 객체를 가진 더 짧은 IronBarcode에 매핑됩니다.

마이그레이션하는 동안 Scanbot SDK와 IronBarcode를 모두 설치해야 하나요?

아니요. 대부분의 마이그레이션은 병렬 작업이 아닌 직접 교체 작업입니다. 한 번에 하나의 서비스 클래스를 마이그레이션하고, NuGet 참조를 교체하고, 인스턴스화 및 API 호출 패턴을 업데이트한 후 다음 클래스로 이동합니다.

IronBarcode의 NuGet 패키지 이름은 무엇인가요?

패키지는 'IronBarCode'(대문자 B와 C 포함)입니다. '설치-패키지 IronBarCode' 또는 '닷넷 추가 패키지 IronBarCode'로 설치합니다. 코드의 사용 지시어는 'using IronBarCode;'입니다.

IronBarcode는 Scanbot SDK와 비교하여 Docker 배포를 어떻게 간소화하나요?

IronBarcode는 외부 SDK 파일이나 마운트된 라이선스 구성이 없는 NuGet 패키지입니다. Docker에서 IRONBARCODE_LICENSE_KEY 환경 변수를 설정하면 패키지가 시작 시 라이선스 유효성 검사를 처리합니다.

Scanbot에서 마이그레이션한 후 IronBarcode가 모든 바코드 형식을 자동으로 감지하나요?

예. IronBarcode는 지원되는 모든 형식에서 기호를 자동으로 감지합니다. 명시적인 바코드 유형 열거가 필요하지 않습니다. 형식이 이미 알려져 있고 성능이 중요한 경우 BarcodeReaderOptions를 사용하여 검색 공간을 최적화하여 제한할 수 있습니다.

IronBarcode는 별도의 라이브러리 없이 PDF에서 바코드를 판독할 수 있나요?

예. BarcodeReader.Read("document.pdf")는 기본적으로 PDF 파일을 처리합니다. 결과에는 발견된 각 바코드에 대한 페이지 번호, 형식, 값 및 신뢰도가 포함됩니다. 외부 PDF 렌더링 단계가 필요하지 않습니다.

IronBarcode는 병렬 바코드 처리를 어떻게 처리하나요?

IronBarcode의 정적 메서드는 상태 저장소가 없고 스레드에 안전합니다. 스레드별 인스턴스 관리 없이 파일 목록에 직접 Parallel.ForEach를 사용할 수 있습니다. BarcodeReaderOptions.MaxParallelThreads는 내부 스레드 예산을 제어합니다.

Scanbot SDK에서 IronBarcode로 마이그레이션하면 어떤 결과 속성이 변경되나요?

일반적인 이름 변경: 바코드 값은 값으로, 바코드 유형은 형식으로 바뀝니다. IronBarcode 결과에는 신뢰도 및 페이지 번호도 추가됩니다. 솔루션 전반의 검색 및 바꾸기 기능은 기존 결과 처리 코드에서 이름 변경을 처리합니다.

CI/CD 파이프라인에서 IronBarcode 라이선싱을 설정하려면 어떻게 해야 하나요?

IRONBARCODE_LICENSE_KEY를 파이프라인 시크릿으로 저장하고 애플리케이션 시작 코드에 IronBarCode.License.LicenseKey를 할당하세요. 하나의 비밀은 개발, 테스트, 스테이징 및 프로덕션을 포함한 모든 환경에 적용됩니다.

IronBarcode는 사용자 지정 스타일로 QR 코드 생성을 지원하나요?

예. QRCodeWriter.CreateQrCode()는 변경바코드색()을 통한 사용자 지정 색상, 추가브랜드 로고()를 통한 로고 임베딩, 구성 가능한 오류 수정 수준, PNG, JPG, PDF, 스트림을 포함한 여러 출력 형식을 지원합니다.

Curtis Chau
기술 문서 작성자

커티스 차우는 칼턴 대학교에서 컴퓨터 과학 학사 학위를 취득했으며, Node.js, TypeScript, JavaScript, React를 전문으로 하는 프론트엔드 개발자입니다. 직관적이고 미적으로 뛰어난 사용자 인터페이스를 만드는 데 열정을 가진 그는 최신 프레임워크를 활용하고, 잘 구성되고 시각적으로 매력적인 매뉴얼을 제작하는 것을 즐깁니다.

커티스는 개발 분야 외에도 사물 인터넷(IoT)에 깊은 관심을 가지고 있으며, 하드웨어와 소프트웨어를 통합하는 혁신적인 방법을 연구합니다. 여가 시간에는 게임을 즐기거나 디스코드 봇을 만들면서 기술에 대한 애정과 창의성을 결합합니다.

아이언 서포트 팀

저희는 주 5일, 24시간 온라인으로 운영합니다.
채팅
이메일
전화해