IronBarcode 와 ZXing Net 라이브러리 비교
Scandit SDK에서 IronBarcode로의 마이그레이션
Scandit SDK는 실시간 모바일 바코드 감지를 위해 개발된 카메라 스캐닝 플랫폼입니다.IronBarcode는 .NET 용 서버 측 및 파일 기반 바코드 처리 라이브러리입니다. 이 두 라이브러리는 서로 다른 주요 사용 사례를 위해 설계되었으며, 한 라이브러리에서 다른 라이브러리로 마이그레이션하는 것은 특정 상황에서만 의미가 있습니다.
이 가이드는 Scandit의 .NET 패키지를 사용하여 파일, PDF 또는 서버 측 문서 스트림을 처리하는 팀을 위한 마이그레이션 경로를 다룹니다. 이러한 시나리오에서는 Scandit의 카메라 파이프라인 아키텍처가 가치보다는 마찰을 야기합니다. 모바일 카메라로 실제 사물을 촬영하고 증강 현실 오버레이를 통해 실시간 피드백을 받는 것이 핵심 요구 사항이라면 Scandit이 여전히 적합한 도구이며 이 가이드는 적용되지 않습니다. 업로드된 이미지에서 바코드를 읽거나, PDF 문서에서 바코드 데이터를 추출하거나, ASP.NET Core, Azure Functions, Docker 컨테이너 또는 백그라운드 처리 서비스에서 바코드 감지를 실행해야 하는 경우, 이 가이드는 완벽한 마이그레이션 경로를 제공합니다.
Scandit SDK에서 마이그레이션해야 하는 이유는 무엇일까요?
카메라 파이프라인 오버헤드: 모든 스캔딧 통합은 배포 환경에 카메라가 있는지 여부와 상관없이 동일한 초기화 시퀀스로 시작됩니다: DataCaptureContext 생성, BarcodeCaptureSettings 구성, 활성화할 심볼로지 나열, Camera 인스턴스 획득, 프레임 소스로 할당, 카메라를 활성 상태로 전환, 바코드 캡처 활성화. 이 초기화 과정은 Scandit이 실시간 비디오 프레임을 처리하기 때문에 필요합니다. 서버 측 파일 처리에 있어 이러한 순서는 아무런 이점을 제공하지 않으며, 대상 환경에는 없는 상태 기반 복잡성을 야기합니다. Docker 컨테이너에는 카메라가 없고 Azure Function에는 프레임 소스가 없기 때문입니다.
가격 비공개: Scandit는 가격을 공개하지 않습니다. SparkScan, MatrixScan, ID Scanning, AR Overlays 및 Parser는 각각 개별 가격으로 제공되는 제품이므로 별도의 판매 문의가 필요합니다. 예산 제안서, 공급업체 비교 또는 비용 편익 분석은 판매 주기를 입력하지 않고는 완료할 수 없습니다.IronBarcode가격을 공개적으로 명시하고 있습니다 . 749달러, 1,499달러, 또는 일회성 영구 구매 시 2,999달러입니다. 따라서 코드를 작성하기 전에 가격을 확인할 수 있습니다.
필수 심볼 선언: Scandit은 스캔 세션을 시작하기 전에 각 바코드 형식을 명시적으로 활성화해야 합니다. 실시간 카메라 스캐닝에서 이는 성능 최적화의 한 방법입니다. 심볼 사용을 제한하면 프레임당 처리 오버헤드가 줄어듭니다. 파일 기반 문서 처리 환경에서는 수신 문서에 공급업체나 파트너의 다양한 바코드 형식이 포함될 수 있으므로, 필수 형식 선언은 제약 조건이 됩니다. 가능한 모든 기호 체계를 나열하는 것은 성능상의 이점을 없애버립니다. 라이브러리 위에 형식 추측 로직을 작성하면 엔지니어링 오버헤드가 추가됩니다.
PDF 지원 없음: 스캔딧의 API에서는 BarcodeReader.Read("invoice.pdf")에 대한 직접적인 대등 물이 없습니다. PDF 문서에서 바코드를 추출하려면 각 페이지를 별도의 라이브러리를 사용하여 래스터 이미지로 렌더링한 다음, 렌더링된 이미지를 카메라 시뮬레이션 파이프라인을 통해 처리해야 합니다. 이 접근 방식은 문서 처리 워크플로에서 일상적인 작업에 추가적인 종속성, 라이선스 및 상당한 엔지니어링 노력을 요구합니다.
근본적인 문제
Scandit은 바코드 작업을 시작하기 전에 카메라가 작동 중이어야 합니다.IronBarcode파일 경로만 필요로 합니다.
// Scandit SDK: mandatory camera pipeline before first barcode read
var dataCaptureContext = DataCaptureContext.ForLicenseKey("YOUR-SCANDIT-LICENSE");
var settings = BarcodeCaptureSettings.Create();
settings.EnableSymbologies(new HashSet<Symbology>
{
Symbology.Ean13Upca,
Symbology.Ean8,
Symbology.Code128,
Symbology.QrCode
});
var barcodeCapture = BarcodeCapture.Create(dataCaptureContext, settings);
var camera = Camera.GetDefaultCamera();
await dataCaptureContext.SetFrameSourceAsync(camera);
await camera.SwitchToDesiredStateAsync(FrameSourceState.On);
barcodeCapture.IsEnabled = true;
// Results arrive later via BarcodeScanned event callback
// Scandit SDK: mandatory camera pipeline before first barcode read
var dataCaptureContext = DataCaptureContext.ForLicenseKey("YOUR-SCANDIT-LICENSE");
var settings = BarcodeCaptureSettings.Create();
settings.EnableSymbologies(new HashSet<Symbology>
{
Symbology.Ean13Upca,
Symbology.Ean8,
Symbology.Code128,
Symbology.QrCode
});
var barcodeCapture = BarcodeCapture.Create(dataCaptureContext, settings);
var camera = Camera.GetDefaultCamera();
await dataCaptureContext.SetFrameSourceAsync(camera);
await camera.SwitchToDesiredStateAsync(FrameSourceState.On);
barcodeCapture.IsEnabled = true;
// Results arrive later via BarcodeScanned event callback
Imports Scandit.DataCapture.Core
Imports Scandit.DataCapture.Barcode
Imports System.Collections.Generic
' Scandit SDK: mandatory camera pipeline before first barcode read
Dim dataCaptureContext = DataCaptureContext.ForLicenseKey("YOUR-SCANDIT-LICENSE")
Dim settings = BarcodeCaptureSettings.Create()
settings.EnableSymbologies(New HashSet(Of Symbology) From {
Symbology.Ean13Upca,
Symbology.Ean8,
Symbology.Code128,
Symbology.QrCode
})
Dim barcodeCapture = BarcodeCapture.Create(dataCaptureContext, settings)
Dim camera = Camera.GetDefaultCamera()
Await dataCaptureContext.SetFrameSourceAsync(camera)
Await camera.SwitchToDesiredStateAsync(FrameSourceState.On)
barcodeCapture.IsEnabled = True
' Results arrive later via BarcodeScanned event callback
// IronBarcode: direct file reading
// NuGet: dotnet add package IronBarcode
IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";
var results = BarcodeReader.Read("barcode.png");
foreach (var result in results)
Console.WriteLine($"{result.Value} ({result.Format})");
// IronBarcode: direct file reading
// NuGet: dotnet add package IronBarcode
IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";
var results = BarcodeReader.Read("barcode.png");
foreach (var result in results)
Console.WriteLine($"{result.Value} ({result.Format})");
Imports IronBarCode
' IronBarcode: direct file reading
' NuGet: dotnet add package IronBarcode
IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY"
Dim results = BarcodeReader.Read("barcode.png")
For Each result In results
Console.WriteLine($"{result.Value} ({result.Format})")
Next
컨텍스트 생성, 설정, 심볼 활성화, 카메라 획득, 프레임 소스 할당, 상태 전환 등 전체 카메라 파이프라인 블록은 라이선스 키 할당과 단일 메서드 호출로 대체됩니다.
IronBarcode와 Scandit SDK의 기능 비교
| 기능 | 스칸딧 SDK | IronBarcode |
|---|---|---|
| 주요 배포 | 모바일 카메라 스캔 | 서버, 클라우드, 데스크톱 파일 처리 |
| 카메라 필요 | 예 | 아니요 |
| 이미지 파일 읽기 | 다음과 같은 용도로 설계되지 않았습니다. | 기본 입력 유형 |
| PDF 바코드 추출 | 지원되지 않음 | 네이티브 멀티페이지 지원 |
| 스트림/바이트 배열 입력 | 지원되지 않음 | 예 |
| 자동 형식 감지 | 아니요 (반드시 명시해야 함) | 예 (기본 동작) |
| 이벤트 기반 결과 | 예 (바코드 스캔 콜백) | 아니요 (동기 반환) |
| ASP.NET Core / 서버 측 | 다음과 같은 용도로 설계되지 않았습니다. | 완전히 지원 |
| Azure Functions / 서버리스 | 실용적이지 않음 | 완전히 지원 |
| Docker/리눅스 | 지원되지 않음 | 완전히 지원 |
| 바코드 생성 | 지원되지 않음 | 패키지에 포함된 내용 |
| 다중 바코드 감지 | MatrixScan (별도 제품) | 패키지에 포함된 내용 |
| 가격 모델 | (제품별) 영업 담당자에게 문의하세요. | 영구 등급 공개 |
| 스캔당/기기당 요금 | 예 | 아니요 |
빠른 시작
1단계: NuGet 패키지 교체
Scandit 패키지를 제거하세요:
dotnet remove package Scandit.BarcodePicker
dotnet remove package Scandit.DataCapture.Core
dotnet remove package Scandit.DataCapture.Barcode
dotnet remove package Scandit.BarcodePicker
dotnet remove package Scandit.DataCapture.Core
dotnet remove package Scandit.DataCapture.Barcode
IronBarcode 설치하세요:
dotnet add package IronBarcode
dotnet add package IronBarcode
단계 2: 네임스페이스 업데이트
Scandit 네임스페이스 가져오기를IronBarcode네임스페이스로 대체하십시오:
// Before (Scandit SDK)
using Scandit.DataCapture.Core;
using Scandit.DataCapture.Barcode;
using Scandit.DataCapture.Barcode.Data;
// After (IronBarcode)
using IronBarCode;
// Before (Scandit SDK)
using Scandit.DataCapture.Core;
using Scandit.DataCapture.Barcode;
using Scandit.DataCapture.Barcode.Data;
// After (IronBarcode)
using IronBarCode;
' Before (Scandit SDK)
Imports Scandit.DataCapture.Core
Imports Scandit.DataCapture.Barcode
Imports Scandit.DataCapture.Barcode.Data
' After (IronBarcode)
Imports IronBarCode
단계 3: 라이선스 초기화
애플리케이션 시작 시 DataCaptureContext.ForLicenseKey 호출을 대체하여 라이선스 초기화를 추가하세요:
// Before (Scandit SDK)
var dataCaptureContext = DataCaptureContext.ForLicenseKey("YOUR-SCANDIT-LICENSE");
// After (IronBarcode)
IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";
// Before (Scandit SDK)
var dataCaptureContext = DataCaptureContext.ForLicenseKey("YOUR-SCANDIT-LICENSE");
// After (IronBarcode)
IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";
' Before (Scandit SDK)
Dim dataCaptureContext = DataCaptureContext.ForLicenseKey("YOUR-SCANDIT-LICENSE")
' After (IronBarcode)
IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY"
코드 마이그레이션 예제
이미지 파일에서 바코드 읽기
정적 이미지 파일 처리는IronBarcode에서 기본적으로 지원되는 시나리오이지만 Scandit에서는 지원되지 않는 워크플로입니다. Scandit SDK는 실시간 카메라 프레임을 처리합니다. 파일을 읽으려면 캡처 파이프라인을 비트맵을 프레임 소스로 처리하도록 수정해야 하는데, 이는 기본적으로 구현되어 있지 않습니다.
Scandit SDK 접근 방식:
// 스칸딧 SDK has no direct file-read API.
// Reading a static image requires constructing a bitmap frame source
// and routing it through the capture pipeline — an unsupported workaround.
// The standard Scandit integration assumes a running camera at all times.
// 스칸딧 SDK has no direct file-read API.
// Reading a static image requires constructing a bitmap frame source
// and routing it through the capture pipeline — an unsupported workaround.
// The standard Scandit integration assumes a running camera at all times.
' 스칸딧 SDK has no direct file-read API.
' Reading a static image requires constructing a bitmap frame source
' and routing it through the capture pipeline — an unsupported workaround.
' The standard Scandit integration assumes a running camera at all times.
IronBarcode 접근 방식:
// NuGet: dotnet add package IronBarcode
using IronBarCode;
IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";
var results = BarcodeReader.Read("product-label.png");
foreach (var result in results)
{
Console.WriteLine($"Value: {result.Value}");
Console.WriteLine($"Format: {result.Format}");
Console.WriteLine($"Confidence: {result.Confidence}%");
}
// NuGet: dotnet add package IronBarcode
using IronBarCode;
IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";
var results = BarcodeReader.Read("product-label.png");
foreach (var result in results)
{
Console.WriteLine($"Value: {result.Value}");
Console.WriteLine($"Format: {result.Format}");
Console.WriteLine($"Confidence: {result.Confidence}%");
}
Imports IronBarCode
IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY"
Dim results = BarcodeReader.Read("product-label.png")
For Each result In results
Console.WriteLine($"Value: {result.Value}")
Console.WriteLine($"Format: {result.Format}")
Console.WriteLine($"Confidence: {result.Confidence}%")
Next
IronBarcode 사용하여 이미지에서 바코드를 읽는 데에는 파이프라인 설정이 필요하지 않습니다. 메서드가 반환된 직후 결과를 바로 확인할 수 있으며, 이벤트 구독도 필요하지 않습니다.
PDF 문서에서 바코드 추출하기
PDF 바코드 추출은 PDF를 지원하지 않는 Scandit에서 마이그레이션할 때 완전히 새로운 영역입니다.IronBarcode PDF 문서를 직접 읽어 페이지 번호별로 색인화된 결과를 반환합니다.
Scandit SDK 접근 방식:
// Scandit SDK: no PDF support.
// Implementing PDF barcode extraction with Scandit requires:
// 1. A separate PDF rendering library to convert pages to raster images
// 2. Routing each rendered image through the camera simulation pipeline
// 3. Correlating results back to page numbers manually
// This is not a supported workflow and requires significant custom engineering.
// Scandit SDK: no PDF support.
// Implementing PDF barcode extraction with Scandit requires:
// 1. A separate PDF rendering library to convert pages to raster images
// 2. Routing each rendered image through the camera simulation pipeline
// 3. Correlating results back to page numbers manually
// This is not a supported workflow and requires significant custom engineering.
' Scandit SDK: no PDF support.
' Implementing PDF barcode extraction with Scandit requires:
' 1. A separate PDF rendering library to convert pages to raster images
' 2. Routing each rendered image through the camera simulation pipeline
' 3. Correlating results back to page numbers manually
' This is not a supported workflow and requires significant custom engineering.
IronBarcode 접근 방식:
// NuGet: dotnet add package IronBarcode
using IronBarCode;
IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";
var results = BarcodeReader.Read("shipping-manifest.pdf");
foreach (var result in results)
{
Console.WriteLine($"Page {result.PageNumber}: {result.Value} ({result.Format})");
}
// NuGet: dotnet add package IronBarcode
using IronBarCode;
IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";
var results = BarcodeReader.Read("shipping-manifest.pdf");
foreach (var result in results)
{
Console.WriteLine($"Page {result.PageNumber}: {result.Value} ({result.Format})");
}
Imports IronBarCode
IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY"
Dim results = BarcodeReader.Read("shipping-manifest.pdf")
For Each result In results
Console.WriteLine($"Page {result.PageNumber}: {result.Value} ({result.Format})")
Next
PDF 문서에서 바코드를 읽는 방법 에 대한 자세한 안내는 페이지 범위 선택 및 다중 바코드 처리 등 모든 PDF 처리 시나리오를 다루는IronBarcode설명서를 참조하십시오. 별도의 PDF 라이브러리 종속성은 필요하지 않습니다.
이벤트 콜백을 직접 반환 값으로 변환
스캔딧은 BarcodeScanned 이벤트를 통해 바코드 결과를 제공합니다. 라이브 카메라 스캔이 본질적으로 비동기성이기 때문입니다. 결과는 카메라가 현재 프레임에서 바코드를 감지할 때 도착합니다.IronBarcode파일 기반 읽기에는 완료 경계가 정해져 있기 때문에 결과를 형식화된 컬렉션으로 반환합니다. 이는 이주 과정에서 나타나는 구조적으로 가장 중요한 변화 중 하나입니다.
Scandit SDK 접근 방식:
// Scandit SDK: event-driven result delivery
barcodeCapture.BarcodeScanned += (sender, args) =>
{
foreach (var barcode in args.Session.NewlyRecognizedBarcodes)
{
string value = barcode.Data;
string symbology = barcode.Symbology.ToString();
// Processing logic embedded inside event handler
LogBarcodeResult(value, symbology);
UpdateInventory(value);
}
};
// Scan continues indefinitely until camera session is terminated
// Scandit SDK: event-driven result delivery
barcodeCapture.BarcodeScanned += (sender, args) =>
{
foreach (var barcode in args.Session.NewlyRecognizedBarcodes)
{
string value = barcode.Data;
string symbology = barcode.Symbology.ToString();
// Processing logic embedded inside event handler
LogBarcodeResult(value, symbology);
UpdateInventory(value);
}
};
// Scan continues indefinitely until camera session is terminated
Imports System
' Scandit SDK: event-driven result delivery
AddHandler barcodeCapture.BarcodeScanned, Sub(sender, args)
For Each barcode In args.Session.NewlyRecognizedBarcodes
Dim value As String = barcode.Data
Dim symbology As String = barcode.Symbology.ToString()
' Processing logic embedded inside event handler
LogBarcodeResult(value, symbology)
UpdateInventory(value)
Next
End Sub
' Scan continues indefinitely until camera session is terminated
IronBarcode 접근 방식:
// NuGet: dotnet add package IronBarcode
using IronBarCode;
IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";
var results = BarcodeReader.Read("document.png");
foreach (var result in results)
{
// Same processing logic, now in standard control flow
LogBarcodeResult(result.Value, result.Format.ToString());
UpdateInventory(result.Value);
}
// NuGet: dotnet add package IronBarcode
using IronBarCode;
IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";
var results = BarcodeReader.Read("document.png");
foreach (var result in results)
{
// Same processing logic, now in standard control flow
LogBarcodeResult(result.Value, result.Format.ToString());
UpdateInventory(result.Value);
}
Imports IronBarCode
IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY"
Dim results = BarcodeReader.Read("document.png")
For Each result In results
' Same processing logic, now in standard control flow
LogBarcodeResult(result.Value, result.Format.ToString())
UpdateInventory(result.Value)
Next
이벤트 핸들러 콜백에 포함되어 있던 모든 처리 로직이 표준 순차 코드로 이동합니다. 오류 처리, 로깅 및 후속 작업은 이벤트 핸들러 패턴보다는 일반적인 제어 흐름을 사용하여 구성할 수 있습니다.
ASP.NET Core 파일 업로드 엔드포인트
업로드된 파일에서 바코드를 읽는 상태 비저장 서버 엔드포인트는IronBarcode의 주요 서버 측 사용 사례를 나타냅니다. 이 패턴은 Scandit의 카메라 파이프라인 아키텍처에서 지원되지 않습니다.
Scandit SDK 접근 방식:
// Scandit SDK: not applicable to ASP.NET Core file upload scenarios.
// The DataCaptureContext requires a camera hardware session.
// There is no mechanism to process an IFormFile through the Scandit pipeline
// without substantial custom camera-simulation infrastructure.
// Scandit SDK: not applicable to ASP.NET Core file upload scenarios.
// The DataCaptureContext requires a camera hardware session.
// There is no mechanism to process an IFormFile through the Scandit pipeline
// without substantial custom camera-simulation infrastructure.
' Scandit SDK: not applicable to ASP.NET Core file upload scenarios.
' The DataCaptureContext requires a camera hardware session.
' There is no mechanism to process an IFormFile through the Scandit pipeline
' without substantial custom camera-simulation infrastructure.
IronBarcode 접근 방식:
// NuGet: dotnet add package IronBarcode
using IronBarCode;
[ApiController]
[Route("api/[controller]")]
public class BarcodeController : ControllerBase
{
[HttpPost("scan")]
public IActionResult ScanUploadedDocument(IFormFile file)
{
if (file == null || file.Length == 0)
return BadRequest("No file provided");
using var stream = file.OpenReadStream();
var results = BarcodeReader.Read(stream);
if (!results.Any())
return NotFound("No barcodes detected");
return Ok(results.Select(r => new
{
r.Value,
Format = r.Format.ToString(),
r.PageNumber
}));
}
}
// NuGet: dotnet add package IronBarcode
using IronBarCode;
[ApiController]
[Route("api/[controller]")]
public class BarcodeController : ControllerBase
{
[HttpPost("scan")]
public IActionResult ScanUploadedDocument(IFormFile file)
{
if (file == null || file.Length == 0)
return BadRequest("No file provided");
using var stream = file.OpenReadStream();
var results = BarcodeReader.Read(stream);
if (!results.Any())
return NotFound("No barcodes detected");
return Ok(results.Select(r => new
{
r.Value,
Format = r.Format.ToString(),
r.PageNumber
}));
}
}
Imports IronBarCode
Imports Microsoft.AspNetCore.Mvc
<ApiController>
<Route("api/[controller]")>
Public Class BarcodeController
Inherits ControllerBase
<HttpPost("scan")>
Public Function ScanUploadedDocument(file As IFormFile) As IActionResult
If file Is Nothing OrElse file.Length = 0 Then
Return BadRequest("No file provided")
End If
Using stream = file.OpenReadStream()
Dim results = BarcodeReader.Read(stream)
If Not results.Any() Then
Return NotFound("No barcodes detected")
End If
Return Ok(results.Select(Function(r) New With {
.Value = r.Value,
.Format = r.Format.ToString(),
.PageNumber = r.PageNumber
}))
End Using
End Function
End Class
BarcodeReader.Read 메서드는 Stream를 IFormFile.OpenReadStream()에서 직접 받아 임시 파일 생성을 필요로 하지 않습니다. 결과는 요청-응답 주기 내에서 동기적으로 반환되며 비동기 카메라 관리는 수행되지 않습니다.
여러 문서에 걸친 동시 배치 처리
대용량 문서 대기열은 여러 스레드에 걸친 병렬 처리를 필요로 합니다. IronBarcode의 API는 상태가 없기 때문에 본질적으로 스레드 안전하며 Parallel.ForEach 및 비동기 작업 패턴과 직접 결합됩니다.
Scandit SDK 접근 방식:
// Scandit SDK: no supported batch file processing pattern.
// The FrameSourceState model assumes a continuous camera session,
// not a queue of discrete documents. Batch processing would require
// one camera simulation pipeline per document or serialized processing
// through a shared pipeline — neither is a supported workflow.
// Scandit SDK: no supported batch file processing pattern.
// The FrameSourceState model assumes a continuous camera session,
// not a queue of discrete documents. Batch processing would require
// one camera simulation pipeline per document or serialized processing
// through a shared pipeline — neither is a supported workflow.
' Scandit SDK: no supported batch file processing pattern.
' The FrameSourceState model assumes a continuous camera session,
' not a queue of discrete documents. Batch processing would require
' one camera simulation pipeline per document or serialized processing
' through a shared pipeline — neither is a supported workflow.
IronBarcode 접근 방식:
// NuGet: dotnet add package IronBarcode
using IronBarCode;
using System.Collections.Concurrent;
IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";
var options = new BarcodeReaderOptions
{
Speed = ReadingSpeed.Balanced,
ExpectMultipleBarcodes = true,
MaxParallelThreads = 4
};
var files = Directory.GetFiles("./documents/", "*.pdf");
var allResults = new ConcurrentBag<(string File, BarcodeResult Result)>();
Parallel.ForEach(files, file =>
{
var results = BarcodeReader.Read(file, options);
foreach (var result in results)
allResults.Add((file, result));
});
foreach (var (file, result) in allResults)
Console.WriteLine($"{Path.GetFileName(file)}: {result.Value} ({result.Format})");
// NuGet: dotnet add package IronBarcode
using IronBarCode;
using System.Collections.Concurrent;
IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";
var options = new BarcodeReaderOptions
{
Speed = ReadingSpeed.Balanced,
ExpectMultipleBarcodes = true,
MaxParallelThreads = 4
};
var files = Directory.GetFiles("./documents/", "*.pdf");
var allResults = new ConcurrentBag<(string File, BarcodeResult Result)>();
Parallel.ForEach(files, file =>
{
var results = BarcodeReader.Read(file, options);
foreach (var result in results)
allResults.Add((file, result));
});
foreach (var (file, result) in allResults)
Console.WriteLine($"{Path.GetFileName(file)}: {result.Value} ({result.Format})");
Imports IronBarCode
Imports System.Collections.Concurrent
Imports System.IO
Imports System.Threading.Tasks
IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY"
Dim options As New BarcodeReaderOptions With {
.Speed = ReadingSpeed.Balanced,
.ExpectMultipleBarcodes = True,
.MaxParallelThreads = 4
}
Dim files = Directory.GetFiles("./documents/", "*.pdf")
Dim allResults As New ConcurrentBag(Of (File As String, Result As BarcodeResult))()
Parallel.ForEach(files, Sub(file)
Dim results = BarcodeReader.Read(file, options)
For Each result In results
allResults.Add((file, result))
Next
End Sub)
For Each item In allResults
Console.WriteLine($"{Path.GetFileName(item.File)}: {item.Result.Value} ({item.Result.Format})")
Next
비동기 및 멀티스레드 바코드 판독을 포함한 고급 패턴, 처리량 조정 및 스레드 수 구성에 대한 자세한 내용은IronBarcode설명서를 참조하십시오.
스칸딧 SDK API와IronBarcode매핑 참조
| 스칸딧 SDK | IronBarcode | 노트 |
|---|---|---|
DataCaptureContext.ForLicenseKey("key") |
IronBarCode.License.LicenseKey = "key" |
과제 하나; 컨텍스트 개체 없음 |
BarcodeCaptureSettings.Create() |
new BarcodeReaderOptions() |
선택 과목; 기본 읽기에는 필요하지 않음 |
settings.EnableSymbologies(Symbology.Code128, ...) |
(not needed) | IronBarcode모든 형식을 자동으로 감지합니다. |
Camera.GetDefaultCamera() |
(not applicable) | 카메라 없는 컨셉 |
dataCaptureContext.SetFrameSourceAsync(camera) |
(not applicable) | 프레임 소스 없음 |
camera.SwitchToDesiredStateAsync(FrameSourceState.On) |
(not applicable) | 카메라 없음 상태 머신 |
barcodeCapture.IsEnabled = true |
BarcodeReader.Read(path) |
단일 호출로 읽기가 시작됩니다. |
BarcodeScanned += 이벤트 핸들러 |
표준 foreach 반환 값 |
이벤트 시스템이 필요하지 않습니다. |
args.Session.NewlyRecognizedBarcodes |
BarcodeReader.Read()의 반환 값 |
직접 수거 |
barcode.Data |
result.Value |
동일한 의미 내용 |
barcode.Symbology |
result.Format |
동등 형식 열거 |
using Scandit.DataCapture.Core |
using IronBarCode |
단일 네임스페이스 |
using Scandit.DataCapture.Barcode |
using IronBarCode |
동일한 네임스페이스에 포함됨 |
| SparkScan 제품 | BarcodeReader.Read(path) |
별도의 제품이 필요하지 않습니다. |
| MatrixScan 제품 | BarcodeReaderOptions { ExpectMultipleBarcodes = true } |
기본 패키지에 포함됨 |
일반적인 마이그레이션 문제와 해결책
문제 1: 카메라 파이프라인 코드는 직접적인 번역이 없습니다.
Scandit SDK: DataCaptureContext, BarcodeCaptureSettings, Camera, BarcodeCapture 설정 블록은 비동기 상태 전환과 함께 7-10줄의 초기화 코드를 가지고 있습니다.
해결 방법: 해당 블록을 완전히 삭제합니다. IronBarcode의 파일 기반 API는 세션 초기화를 필요로 하지 않기 때문에IronBarcode상응하는 기능이 없습니다. 전체 블록을 다음으로 바꾸세요:
IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";
IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";
Imports IronBarCode
IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY"
문제 2: 바코드 스캔 이벤트 처리기 로직
Scandit SDK: 처리 로직은 BarcodeScanned += 이벤트 핸들러 람다 또는 메서드 안에 포함됩니다.IronBarcode에는 이러한 패턴이 존재하지 않습니다.
Solution: BarcodeReader.Read 호출 후 표준 코드 안으로 핸들러 본문을 이동하세요:
// Before: event handler
barcodeCapture.BarcodeScanned += (s, args) =>
{
foreach (var b in args.Session.NewlyRecognizedBarcodes)
Console.WriteLine(b.Data);
};
// After: direct iteration
foreach (var result in BarcodeReader.Read("document.png"))
Console.WriteLine(result.Value);
// Before: event handler
barcodeCapture.BarcodeScanned += (s, args) =>
{
foreach (var b in args.Session.NewlyRecognizedBarcodes)
Console.WriteLine(b.Data);
};
// After: direct iteration
foreach (var result in BarcodeReader.Read("document.png"))
Console.WriteLine(result.Value);
Imports System
' Before: event handler
AddHandler barcodeCapture.BarcodeScanned, Sub(s, args)
For Each b In args.Session.NewlyRecognizedBarcodes
Console.WriteLine(b.Data)
Next
End Sub
' After: direct iteration
For Each result In BarcodeReader.Read("document.png")
Console.WriteLine(result.Value)
Next
문제 3: 코드베이스 전체에 흩어져 있는 EnableSymbologies 호출
Scandit SDK: 코드베이스의 여러 곳에서 settings.EnableSymbologies(...) 가 각기 다른 스캔 컨텍스트를 위해 다른 심볼로지 세트로 호출될 수 있습니다.
Solution: 모든 EnableSymbologies 호출을 제거하세요.IronBarcode기본적으로 지원되는 모든 형식을 자동으로 감지합니다. 특정 시나리오에서 성능을 위한 형식 제한이 필요하면 BarcodeReaderOptions.ExpectBarcodeTypes을 사용하세요:
var options = new BarcodeReaderOptions
{
ExpectBarcodeTypes = BarcodeEncoding.Code128 | BarcodeEncoding.QRCode
};
var results = BarcodeReader.Read("document.png", options);
var options = new BarcodeReaderOptions
{
ExpectBarcodeTypes = BarcodeEncoding.Code128 | BarcodeEncoding.QRCode
};
var results = BarcodeReader.Read("document.png", options);
Imports System
Dim options As New BarcodeReaderOptions With {
.ExpectBarcodeTypes = BarcodeEncoding.Code128 Or BarcodeEncoding.QRCode
}
Dim results = BarcodeReader.Read("document.png", options)
문제 4: 기존 코드베이스에서 PDF 읽기 기능 없음
Scandit SDK: 기존 코드베이스에서 PDF 페이지를 Scandit 파이프라인에 입력하기 전에 이미지로 변환하는 경우, 이 사용자 지정 렌더링 인프라는 더 이상 필요하지 않습니다.
해결책: PDF를 이미지로 변환하는 단계를 완전히 제거합니다. PDF 경로를IronBarcode에 직접 전달하세요.
// Before: render PDF pages to images, then pass each image to Scandit pipeline
// (multiple steps, external PDF library dependency)
// After: pass PDF directly to IronBarcode
var results = BarcodeReader.Read("document.pdf");
// Results include PageNumber property for each detected barcode
// Before: render PDF pages to images, then pass each image to Scandit pipeline
// (multiple steps, external PDF library dependency)
// After: pass PDF directly to IronBarcode
var results = BarcodeReader.Read("document.pdf");
// Results include PageNumber property for each detected barcode
' Before: render PDF pages to images, then pass each image to Scandit pipeline
' (multiple steps, external PDF library dependency)
' After: pass PDF directly to IronBarcode
Dim results = BarcodeReader.Read("document.pdf")
' Results include PageNumber property for each detected barcode
이슈 5: 비동기 카메라 초기화 패턴
Scandit SDK: 카메라 초기화는 await을 SetFrameSourceAsync 및 SwitchToDesiredStateAsync에 사용합니다. 호출 코드가 이러한 비동기 작업을 중심으로 구성되어 있는 경우, 해당 작업을 제거하면 비동기 체인이 단순화됩니다.
해결책: 비동기 카메라 초기화를 완전히 제거합니다. BarcodeReader.Read은 동기입니다. UI 또는 서버 컨텍스트에서 응답성을 위해 비동기 실행이 필요하다면 Task.Run 안에 감싸세요:
// Async wrapper for non-blocking execution
var results = await Task.Run(() => BarcodeReader.Read("document.png"));
// Async wrapper for non-blocking execution
var results = await Task.Run(() => BarcodeReader.Read("document.png"));
Imports System.Threading.Tasks
' Async wrapper for non-blocking execution
Dim results = Await Task.Run(Function() BarcodeReader.Read("document.png"))
스칸딧 SDK 마이그레이션 체크리스트
이동 전 작업
코드베이스 내의 모든 Scandit 통합 지점을 감사합니다.
grep -r "DataCaptureContext\|BarcodeCaptureSettings\|BarcodeCapture" --include="*.cs" .
grep -r "EnableSymbologies\|BarcodeScanned\|NewlyRecognizedBarcodes" --include="*.cs" .
grep -r "using Scandit" --include="*.cs" .
grep -r "barcode\.Data\|barcode\.Symbology\|FrameSourceState" --include="*.cs" .
grep -r "DataCaptureContext\|BarcodeCaptureSettings\|BarcodeCapture" --include="*.cs" .
grep -r "EnableSymbologies\|BarcodeScanned\|NewlyRecognizedBarcodes" --include="*.cs" .
grep -r "using Scandit" --include="*.cs" .
grep -r "barcode\.Data\|barcode\.Symbology\|FrameSourceState" --include="*.cs" .
모든 스캔 컨텍스트를 문서화하고, 실시간 카메라 스캔(Scandit 유지)과 파일 또는 문서 처리(IronBarcode로 마이그레이션)를 처리하는 코드 경로를 식별하십시오. Scandit 처리 전에 PDF 페이지가 이미지로 렌더링되는 모든 위치를 기록해 두십시오. 이 렌더링 단계는 제거됩니다.
코드 업데이트 작업
- Scandit NuGet 패키지 (
Scandit.BarcodePicker,Scandit.DataCapture.Core,Scandit.DataCapture.Barcode) 제거 IronBarcodeNuGet Install-Packageusing Scandit.DataCapture.*을using IronBarCode로 대체DataCaptureContext초기화 블록을 전부 삭제- 모든
Camera.GetDefaultCamera()및SetFrameSourceAsync호출 삭제 - 모든
EnableSymbologies호출 삭제 barcodeCapture.IsEnabled = true을BarcodeReader.Read(filePath)로 대체BarcodeScanned +=이벤트 핸들러를foreach으로BarcodeReader.Read()결과에 맞게 변환barcode.Data을result.Value로 대체barcode.Symbology을result.Format로 대체 11.IronBarcode이제 PDF를 직접 읽도록 PDF-이미지 변환 파이프라인을 제거합니다.- 애플리케이션 시작 시
IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY"추가
마이그레이션 후 테스트
코드 업데이트 완료 후 다음 사항을 확인하십시오.
-IronBarcode에서 반환된 바코드 값이 동일한 입력 문서에 대해 Scandit에서 이전에 반환된 값과 일치하는지 확인합니다.
- 문서 세트에서 지원되는 모든 바코드 형식이
ExpectBarcodeTypes구성 없이 감지되는지 확인 - PDF 추출이 여러 페이지 문서에 대해 올바른
PageNumber값을 반환하는지 테스트 - ASP.NET Core 엔드포인트가 예상 부하 조건에서 허용 가능한 응답 시간 내에 결과를 반환하는지 확인합니다.
- Docker 또는 컨테이너화된 배포 환경에서 카메라 하드웨어 없이 바코드 판독이 성공적으로 완료되는지 확인합니다.
Parallel.ForEach와 함께 동시 배치 처리가 경쟁 상태 없이 올바른 결과를 생성하는지 테스트- Scandit 컨텍스트 대신IronBarcode라이선스 키를 사용하여 애플리케이션이 올바르게 시작되고 초기화되는지 확인하십시오.
IronBarcode로 마이그레이션할 때의 주요 이점
카메라 파이프라인 오버헤드 제거: 서버 측 코드에서 상태 관리 카메라 관리, 비동기 상태 전환, 플랫폼별 카메라 API를 제거함으로써 DataCaptureContext 초기화 시퀀스를 제거합니다. 결과적으로 코드는 더 간단하고 짧으며, Linux, Docker 컨테이너 또는 서버리스 컴퓨팅 환경에 배포하는 것을 막는 플랫폼 제약 조건이 없습니다.
PDF 직접 처리: 네이티브 PDF 바코드 추출 기능을 통해 별도의 PDF 렌더링 라이브러리에 대한 의존성, 페이지-이미지 파이프라인의 엔지니어링 오버헤드, 그리고 해당 의존성에 따른 추가 라이선스 비용을 제거할 수 있습니다. 여러 페이지로 구성된 PDF 문서는 단일 메서드 호출로 처리되며, 페이지별로 색인화된 결과를 즉시 확인할 수 있습니다.
동기식 무상태 API: 직접 반환 값 모델은 이벤트 기반 콜백 패턴을 표준 순차 코드로 대체합니다. 오류 처리, 로깅 및 다운스트림 처리는 이벤트 구독 관리나 비동기 상태 머신 조정 없이 기존 애플리케이션 아키텍처와 자연스럽게 통합됩니다.
공개된 투명한 가격 책정: 영구 라이선스 등급이 749달러, 1,499달러, 2,999달러로 공개적으로 명시되어 있어 영업 주기 없이 예산 제안, 공급업체 비교 및 구매 프로세스를 진행할 수 있습니다. 라이선스 비용은 통합 코드를 한 줄도 작성하기 전에 확인할 수 있습니다.
완벽한 클라우드 및 컨테이너 지원: IronBarcode의 상태 비저장, 하드웨어 독립형 API는 Azure Functions, AWS Lambda, Linux의 Docker 컨테이너 및 .NET 런타임을 사용할 수 있는 기타 모든 컴퓨팅 환경에서 수정 없이 실행됩니다. 이러한 환경에 배포하는 데에는 카메라 시뮬레이션, 하드웨어 종속성 해결 방법 또는 플랫폼별 구성이 필요하지 않습니다.
자동 형식 감지: EnableSymbologies 선언을 제거하면 예기치 않은 바코드 형식을 가진 문서가 코드 변경 없이 올바르게 처리됩니다. 수신되는 문서의 형식 세트가 변경될 경우(새로운 공급업체, 새로운 라벨 형식, 새로운 문서 유형 등)IronBarcode새로운 형식을 자동으로 처리합니다.
자주 묻는 질문
Scandit SDK에서 IronBarcode로 마이그레이션해야 하는 이유는 무엇인가요?
일반적인 이유로는 라이선스 간소화(SDK + 런타임 키 복잡성 제거), 처리량 제한 제거, 네이티브 PDF 지원 확보, Docker/CI/CD 배포 개선, 프로덕션 코드의 API 상용구 감소 등이 있습니다.
스칸딧 API 호출을 IronBarcode로 대체하려면 어떻게 해야 하나요?
인스턴스 생성 및 라이선스 상용구를 IronBarCode.License.LicenseKey = "key"로 대체합니다. 판독기 호출을 BarcodeReader.Read(경로)로, 쓰기 호출을 BarcodeWriter.CreateBarcode(데이터, 인코딩)로 바꿉니다. 정적 메서드는 인스턴스 관리가 필요하지 않습니다.
스칸딧 SDK에서 IronBarcode로 마이그레이션할 때 얼마나 많은 코드가 변경되나요?
대부분의 마이그레이션은 더 적은 코드 줄로 이루어집니다. 라이선스 상용구, 인스턴스 생성자, 명시적 형식 구성이 제거됩니다. 핵심 읽기/쓰기 작업이 더 간결한 결과 객체를 가진 더 짧은 IronBarcode에 매핑됩니다.
마이그레이션하는 동안 Scandit SDK와 IronBarcode를 모두 설치해야 하나요?
아니요. 대부분의 마이그레이션은 병렬 작업이 아닌 직접 교체 작업입니다. 한 번에 하나의 서비스 클래스를 마이그레이션하고, NuGet 참조를 교체하고, 인스턴스화 및 API 호출 패턴을 업데이트한 후 다음 클래스로 이동합니다.
IronBarcode의 NuGet 패키지 이름은 무엇인가요?
패키지는 'IronBarCode'(대문자 B와 C 포함)입니다. '설치-패키지 IronBarCode' 또는 '닷넷 추가 패키지 IronBarCode'로 설치합니다. 코드의 사용 지시어는 'using IronBarCode;'입니다.
IronBarcode는 Scandit SDK와 비교하여 Docker 배포를 어떻게 간소화하나요?
IronBarcode는 외부 SDK 파일이나 마운트된 라이선스 구성이 없는 NuGet 패키지입니다. Docker에서 IRONBARCODE_LICENSE_KEY 환경 변수를 설정하면 패키지가 시작 시 라이선스 유효성 검사를 처리합니다.
스칸딧에서 마이그레이션한 후 IronBarcode가 모든 바코드 형식을 자동으로 감지하나요?
예. IronBarcode는 지원되는 모든 형식에서 기호를 자동으로 감지합니다. 명시적인 바코드 유형 열거가 필요하지 않습니다. 형식이 이미 알려져 있고 성능이 중요한 경우 BarcodeReaderOptions를 사용하여 검색 공간을 최적화하여 제한할 수 있습니다.
IronBarcode는 별도의 라이브러리 없이 PDF에서 바코드를 판독할 수 있나요?
예. BarcodeReader.Read("document.pdf")는 기본적으로 PDF 파일을 처리합니다. 결과에는 발견된 각 바코드에 대한 페이지 번호, 형식, 값 및 신뢰도가 포함됩니다. 외부 PDF 렌더링 단계가 필요하지 않습니다.
IronBarcode는 병렬 바코드 처리를 어떻게 처리하나요?
IronBarcode의 정적 메서드는 상태 저장소가 없고 스레드에 안전합니다. 스레드별 인스턴스 관리 없이 파일 목록에 직접 Parallel.ForEach를 사용할 수 있습니다. BarcodeReaderOptions.MaxParallelThreads는 내부 스레드 예산을 제어합니다.
스칸딧 SDK에서 IronBarcode로 마이그레이션하면 어떤 결과 속성이 변경되나요?
일반적인 이름 변경: 바코드 값은 값으로, 바코드 유형은 형식으로 바뀝니다. IronBarcode 결과에는 신뢰도 및 페이지 번호도 추가됩니다. 솔루션 전반의 검색 및 바꾸기 기능은 기존 결과 처리 코드에서 이름 변경을 처리합니다.
CI/CD 파이프라인에서 IronBarcode 라이선싱을 설정하려면 어떻게 해야 하나요?
IRONBARCODE_LICENSE_KEY를 파이프라인 시크릿으로 저장하고 애플리케이션 시작 코드에 IronBarCode.License.LicenseKey를 할당하세요. 하나의 비밀은 개발, 테스트, 스테이징 및 프로덕션을 포함한 모든 환경에 적용됩니다.
IronBarcode는 사용자 지정 스타일로 QR 코드 생성을 지원하나요?
예. QRCodeWriter.CreateQrCode()는 변경바코드색()을 통한 사용자 지정 색상, 추가브랜드 로고()를 통한 로고 임베딩, 구성 가능한 오류 수정 수준, PNG, JPG, PDF, 스트림을 포함한 여러 출력 형식을 지원합니다.

