IRONSOFTWAREHOME
동영상

Cloudmersive Barcode API에서 IronBarcode로 마이그레이션

Curtis Chau
Curtis Chau
Updated: 2026년 5월 19일

이는 .NET 바코드 역사상 가장 간단한 마이그레이션입니다. HTTP 클라이언트를 제거하세요. NuGet 패키지를 추가하세요. API 키 관리를 삭제하세요. 나머지는 찾아서 바꾸기입니다.

Cloudmersive의 .NET SDK는 REST API 클라이언트로 생성된 것입니다 — HttpClient 호출을 감싸는 얇은 래퍼입니다. 애플리케이션에 있는 모든 Cloudmersive 관련 코드는 해당 클라이언트에 대한 구성, 해당 클라이언트를 통한 호출 또는 네트워크 요청 실패 시 발생하는 오류 처리입니다. IronBarcode 네트워크에 의존하지 않고 바코드를 로컬에서 처리하므로 그러한 인프라가 전혀 필요하지 않습니다.


빠른 시작: 세 단계

1단계: 패키지를 교환하세요

dotnet remove package Cloudmersive.APIClient.NET.Barcode
dotnet add package BarCode
SHELL

2단계: 네임스페이스 바꾸기

// Remove these
using Cloudmersive.APIClient.NET.Barcode.Api;
using Cloudmersive.APIClient.NET.Barcode.Client;

// Add this
using IronBarCode;

3단계: API 키 설정을 라이선스 키로 교체

// Remove this
Configuration.Default.ApiKey.Add("Apikey", "YOUR-CLOUDMERSIVE-API-KEY");

// Replace with this — set once at application startup
IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";

ASP.NET Core 애플리케이션에서는 라이선스 키가 builder.Build() 앞의 Program.cs에 들어갑니다:

using IronBarCode;

IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";

var builder = WebApplication.CreateBuilder(args);
// ... rest of startup

비용: 기존 지출액 vs. 예상 지출액

마이그레이션을 진행하기 전에 Cloudmersive 통합에 실제로 드는 비용이 얼마인지 계산해 보는 것이 좋습니다. 계산은 간단합니다.

일일 볼륨월별 요청Cloudmersive TierIronBarcode (일회용)
하루 100개약 3,000개기본 $19.99/월$999
하루 1,000개약 3만비즈니스 프리미어 $99.99/월$999
하루 5,000개약 15만중형 비즈니스 $499.99/월$999
하루 10,000개약 30만Enterprise (맞춤형)$999
하루 25,000개약 75만Enterprise (맞춤형)1,499달러 (Plus, 개발자 3명)

Cloudmersive에 월 ~$63 이상 지출하고 있다면, IronBarcode의 Lite 라이센스는 첫 해에 스스로를 비용 절감합니다. 손익분기점 이후, IronBarcode는 갱신 없이 영구적인 라이센스로, 요청당 요금이 없습니다.


코드 마이그레이션 예제

QR 코드 생성

가장 일반적인 Cloudmersive 생성 호출은 IronBarcode 에 직접 매핑됩니다.

이전 (클라우드머시브):

using Cloudmersive.APIClient.NET.Barcode.Api;
using Cloudmersive.APIClient.NET.Barcode.Client;

Configuration.Default.ApiKey.Add("Apikey", "YOUR-CLOUDMERSIVE-API-KEY");

var apiInstance = new GenerateBarcodeApi();

byte[] result = apiInstance.GenerateBarcodeQRCode("https://example.com");
File.WriteAllBytes("qr.png", result);

(IronBarcode 이후):

using IronBarCode;

IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";

byte[] result = QRCodeWriter.CreateQrCode("https://example.com", 500)
    .ToPngBinaryData();
File.WriteAllBytes("qr.png", result);

// Or save directly
QRCodeWriter.CreateQrCode("https://example.com", 500)
    .SaveAsPng("qr.png");

코드128 생성

이전 (클라우드머시브):

using Cloudmersive.APIClient.NET.Barcode.Api;
using Cloudmersive.APIClient.NET.Barcode.Client;

Configuration.Default.ApiKey.Add("Apikey", "YOUR-CLOUDMERSIVE-API-KEY");
var apiInstance = new GenerateBarcodeApi();

byte[] result = apiInstance.GenerateBarcodeCode128("SHIP-2024031500428");
File.WriteAllBytes("barcode.png", result);

(IronBarcode 이후):

using IronBarCode;

IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";

BarcodeWriter.CreateBarcode("SHIP-2024031500428", BarcodeEncoding.Code128)
    .SaveAsPng("barcode.png");

// Or get bytes directly
byte[] result = BarcodeWriter.CreateBarcode("SHIP-2024031500428", BarcodeEncoding.Code128)
    .ToPngBinaryData();

바코드 읽기

이전 (클라우드머시브):

using Cloudmersive.APIClient.NET.Barcode.Api;
using Cloudmersive.APIClient.NET.Barcode.Client;

Configuration.Default.ApiKey.Add("Apikey", "YOUR-CLOUDMERSIVE-API-KEY");
var scanApi = new BarcodeScanApi();

using (var stream = File.OpenRead("barcode.png"))
{
    var result = scanApi.BarcodeScanImage(stream);
    if (result.Successful == true)
    {
        Console.WriteLine($"Value: {result.RawText}");
        Console.WriteLine($"Type: {result.BarcodeType}");
    }
}

(IronBarcode 이후):

using IronBarCode;

IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";

var results = BarcodeReader.Read("barcode.png");
var result = results.First();
Console.WriteLine($"Value: {result.Value}");
Console.WriteLine($"Type: {result.Format}");

비동기 바코드 읽기

Cloudmersive 연동에서 비동기 API를 사용하는 경우:

이전 (클라우드머시브):

using Cloudmersive.APIClient.NET.Barcode.Api;
using Cloudmersive.APIClient.NET.Barcode.Client;

Configuration.Default.ApiKey.Add("Apikey", "YOUR-CLOUDMERSIVE-API-KEY");
var scanApi = new BarcodeScanApi();

using (var stream = File.OpenRead("barcode.png"))
{
    var result = await scanApi.BarcodeScanImageAsync(stream);
    return result.Successful == true ? result.RawText : null;
}

(IronBarcode 이후):

using IronBarCode;

IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";

// IronBarcode is synchronous; wrap in Task.Run to free the calling thread for CPU-bound work
var results = await Task.Run(() => BarcodeReader.Read("barcode.png"));
return results.FirstOrDefault()?.Value;

PDF에서 바코드 읽기

Cloudmersive는 PDF를 기본적으로 지원하지 않습니다. 기존 코드가 스캔 전에 PDF에서 이미지를 추출하는 경우, 해당 파이프라인 전체를 단일 IronBarcode 호출로 대체하십시오.

이전 버전(Cloudmersive - 별도의 PDF 추출 필요):

// Requires a separate PDF library to extract pages as images,
// then one Cloudmersive API call per extracted page image.
var scanApi = new BarcodeScanApi();
foreach (var pageImagePath in ExtractPdfPages("document.pdf"))
{
    using var stream = File.OpenRead(pageImagePath);
    var result = await scanApi.BarcodeScanImageAsync(stream);
    if (result.Successful == true)
    {
        Console.WriteLine($"Found: {result.RawText}");
    }
}

(IronBarcode 이후):

using IronBarCode;

IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";

// One call — all pages, all barcodes, no image extraction step
var results = BarcodeReader.Read("document.pdf");
foreach (var result in results)
{
    Console.WriteLine($"Page {result.PageNumber}: {result.Value}");
}

다중 바코드 감지

여러 개의 바코드가 있는 문서를 스캔하는 코드가 있는 경우:

이전 (Cloudmersive - 여러 번 호출 필요):

// Cloudmersive returns one barcode per scan — multiple calls for multiple barcodes
var scanApi = new BarcodeScanApi();
var barcodeValues = new List<string>();

foreach (var croppedRegion in CropBarcodeRegions("invoice.png"))
{
    using var stream = new MemoryStream(croppedRegion);
    var result = await scanApi.BarcodeScanImageAsync(stream);
    if (result.Successful == true)
        barcodeValues.Add(result.RawText);
}

(IronBarcode 이후):

using IronBarCode;

IronBarCode.License.LicenseKey = "YOUR-LICENSE-KEY";

var options = new BarcodeReaderOptions
{
    Speed = ReadingSpeed.Balanced,
    ExpectMultipleBarcodes = true,
};

// One call — returns all barcodes in the image
var results = BarcodeReader.Read("invoice.png", options);
var barcodeValues = results.Select(r => r.Value).ToList();

더 이상 필요하지 않은 인프라 제거

이 단계는 마이그레이션 과정에서 작성하는 코드보다 삭제하는 코드가 더 많은 부분입니다.

HTTP 예외 처리 제거

Cloudmersive 작업은 네트워크 오류, HTTP 4xx/5xx 응답 및 시간 초과 예외로 인해 실패할 수 있습니다. 이는 일반적으로 IronBarcode 필요하지 않은 try/catch 구조를 생성합니다.

// Remove all of this
try
{
    var result = await scanApi.BarcodeScanImageAsync(stream);
    // ...
}
catch (ApiException ex) when (ex.ErrorCode == 429)
{
    // Rate limited — wait and retry
    await Task.Delay(TimeSpan.FromSeconds(2));
    // retry logic...
}
catch (ApiException ex) when (ex.ErrorCode == 503)
{
    // Service unavailable — Cloudmersive is down
    _logger.LogError("Cloudmersive unavailable: {Message}", ex.Message);
    throw;
}
catch (HttpRequestException ex)
{
    // Network error
    _logger.LogError("Network failure: {Message}", ex.Message);
    throw;
}
catch (TaskCanceledException)
{
    // Timeout
    _logger.LogError("Cloudmersive request timed out");
    throw;
}

IronBarcode 네트워크 예외를 발생시키지 않습니다. 입력에서 바코드를 디코딩할 수 없는 경우, 이는 인프라 문제가 아니라 콘텐츠 문제이기 때문에 BarcodeException가 발생합니다. 간소화된 오류 처리:

using IronBarCode;

var results = BarcodeReader.Read("barcode.png");
if (!results.Any())
{
    _logger.LogWarning("No barcode detected in image");
}

재시도 로직 제거

Cloudmersive 통합에 Polly, 사용자 지정 재시도 루프 또는 지수 백오프와 같은 재시도 정책이 포함되어 있는 경우, 해당 정책을 완전히 제거하십시오.

// Remove retry infrastructure
// var retryPolicy = Policy
//     .Handle<ApiException>()
//     .WaitAndRetryAsync(3, retryAttempt =>
//         TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)));

// IronBarcode — no retry needed
var results = BarcodeReader.Read("barcode.png");

속도 제한 추적 제거

Cloudmersive의 월별 할당량을 준수하기 위해 코드에서 API 호출 횟수를 추적하는 경우:

// Remove quota tracking
// private static int _monthlyCallCount = 0;
// private const int MonthlyLimit = 30000;
//
// if (Interlocked.Increment(ref _monthlyCallCount) > MonthlyLimit)
//     throw new InvalidOperationException("Monthly Cloudmersive quota exceeded");

// IronBarcode — no quota
var results = BarcodeReader.Read("barcode.png");

네트워크 시간 초과 구성 제거

Cloudmersive 클라이언트에는 타임아웃 구성 기능이 포함되어 있는 경우가 많습니다. 제거하세요:

// Remove timeout configuration
// Configuration.Default.Timeout = 30000; // 30 second timeout
// Configuration.Default.ConnectionTimeout = 5000;

// IronBarcode has no network timeout — no network

API 키 순환 제거

애플리케이션에서 API 키를 정기적으로 갱신하거나 비밀 관리 시스템에 저장하는 경우:

// Simplify this pattern
// private string GetCloudmersiveApiKey() =>
//     _secretManager.GetSecret("cloudmersive-api-key-current");
//
// Configuration.Default.ApiKey["Apikey"] = GetCloudmersiveApiKey();

// IronBarcode — set once at startup
IronBarCode.License.LicenseKey = _configuration["IronBarcode:LicenseKey"];
// or literal: "YOUR-LICENSE-KEY"

일반적인 마이그레이션 문제

세대별로 반환된 Cloudmersive byte[]

Cloudmersive의 생성 메서드는 byte[]을(를) 직접 반환합니다. IronBarcode는 더 많은 옵션을 제공하는 GeneratedBarcode 객체를 반환합니다:

// Cloudmersive returned byte[] directly
byte[] cloudmersiveResult = apiInstance.GenerateBarcodeQRCode("data");

// IronBarcode — call ToPngBinaryData() for the equivalent byte[]
byte[] ironBarcodeResult = BarcodeWriter.CreateBarcode("data", BarcodeEncoding.QRCode)
    .ToPngBinaryData();

// Or save directly (often simpler)
BarcodeWriter.CreateBarcode("data", BarcodeEncoding.QRCode)
    .SaveAsPng("output.png");

// Or get other formats
byte[] jpegBytes = BarcodeWriter.CreateBarcode("data", BarcodeEncoding.QRCode)
    .ToJpegBinaryData();

Cloudmersive Reading은 JSON 응답 모델을 반환했습니다.

Cloudmersive의 스캔 결과는 Successful, RawText, BarcodeType과 같은 속성을 가진 응답 모델입니다. IronBarcode 형식화된 결과 객체를 반환합니다.

// Cloudmersive result model
if (cloudmersiveResult.Successful == true)
{
    string value = cloudmersiveResult.RawText;
    string type = cloudmersiveResult.BarcodeType;
}

// IronBarcode result — use .Value and .Format directly
var results = BarcodeReader.Read("barcode.png");
if (results.Any())
{
    string value = results.First().Value;
    string format = results.First().Format.ToString();
}

다양한 Cloudmersive API 인스턴스 유형

Cloudmersive는 생성을 GenerateBarcodeApi 및 스캐닝을 BarcodeScanApi 인스턴스로 분리합니다. IronBarcode 정적 클래스를 사용하므로 인스턴스가 필요하지 않습니다.

// Cloudmersive — two separate API instances
var generateApi = new GenerateBarcodeApi();
var scanApi = new BarcodeScanApi();

// IronBarcode — static, no instances
// BarcodeWriter for generation
// BarcodeReader for reading
// QRCodeWriter for QR codes specifically

마이그레이션 체크리스트

마이그레이션 전후에 코드베이스에서 다음 검색을 실행하여 모든 Cloudmersive 참조를 찾아냈는지 확인하세요.

# Find all Cloudmersive references
grep -r "Cloudmersive" --include="*.cs" .
grep -r "GenerateBarcodeApi" --include="*.cs" .
grep -r "BarcodeScanApi" --include="*.cs" .
grep -r "Configuration.Default.ApiKey" --include="*.cs" .
grep -r '"Apikey"' --include="*.cs" .
grep -r "GenerateBarcodeQRCode" --include="*.cs" .
grep -r "GenerateBarcodeCode128" --include="*.cs" .
grep -r "BarcodeScanImage" --include="*.cs" .
grep -r "cloudmersive" --include="*.csproj" .
grep -r "cloudmersive" --include="*.json" .
SHELL

마이그레이션 후 모든 검색 결과는 0이 되어야 합니다. 다음으로 IronBarcode 올바르게 참조되었는지 확인하십시오.

grep -r "IronBarCode" --include="*.cs" .
grep -r "BarcodeReader" --include="*.cs" .
grep -r "BarcodeWriter" --include="*.cs" .
SHELL

구성 체크리스트

  • 모든 .csproj 파일에서 Cloudmersive.APIClient.NET.Barcode을(를) 제거합니다
  • 환경 변수와 비밀 저장소에서 Cloudmersive API 키를 appsettings.json에서 제거합니다
  • IronBarcode NuGet 패키지 추가
  • 애플리케이션 시작 시 IronBarCode.License.LicenseKey 초기화를 추가합니다
  • Cloudmersive 호출에 대한 재시도 정책 및 회로 차단기를 제거합니다.
  • 속도 제한 추적 코드 제거
  • 네트워크 시간 초과 설정을 제거합니다.

테스트 체크리스트

마이그레이션이 완료된 후:

  • QR 코드 생성 결과가 유효하고 스캔 가능한지 확인합니다.
  • Code128 및 기타 선형 바코드 생성 기능을 확인합니다.
  • 일반적인 이미지 형식(PNG, JPEG, BMP)에서 바코드 판독값을 확인합니다.
  • PDF 문서를 처리하는 경우 PDF 읽기 기능을 테스트해 보세요.
  • 필요한 경우 다중 바코드 감지 기능을 테스트합니다.
  • 네트워크 트래픽에 Cloudmersive API 호출이 나타나지 않는지 확인하십시오.
  • 인터넷 연결 없이도 애플리케이션이 정상적으로 실행되는지 확인하십시오.

이민 후 얻게 되는 것

비용 절감 외에도, 이번 ​​마이그레이션을 통해 운영상의 여러 문제점들이 완전히 해결됩니다.

더 이상 네트워크에 의존하는 바코드 처리가 필요 없습니다. 클라우드머시브의 가용성, 인터넷 연결 품질 또는 네트워크 지연 급증과 관계없이 문서 처리 파이프라인이 실행됩니다.

더 이상 할당량 관리가 필요 없습니다. 월말 문서량 급증으로 인한 예상치 못한 초과 비용 발생이나 처리 오류가 없습니다.

더 이상 데이터가 네트워크 밖으로 유출되지 않습니다. 민감한 고객 정보, 금융 정보 또는 건강 정보가 포함된 바코드 이미지는 인프라 내에 안전하게 보관됩니다.

코드가 더 간단해졌습니다. 프로덕션 Cloudmersive 통합에 필요한 재시도 인프라, 타임아웃 처리 및 HTTP 예외 관리 기능이 사라졌습니다. 그 대신 직접적인 메서드 호출이 사용됩니다.

이 이동은 기계적입니다. 이점은 구조적인 측면에서 나타납니다. 즉, 외부 네트워크 서비스가 필요 없는 워크플로에서 외부 네트워크 서비스에 대한 의존성을 제거하는 것입니다.

Curtis Chau
기술 문서 작성자

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

...
더 읽어보기

관련 기사

Key in blue circle

무료 30일 체험 키를 즉시 받으세요.

Your trial license will be sent to your email address

제한 없음. 100% 무제한 이용. 신용카드 불필요.

bullet_checked신용카드나 계정 생성은 필요하지 않습니다.제한 없음. 100% 무제한 이용. 신용카드 불필요.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
무료 라이브 데모를 예약하세요
Booking Badge

전 세계 수백만 엔지니어들이 신뢰하는 제품입니다.

Iron Software의 고객 로고
부담 없는 무료 상담을 받아보세요
아래 양식을 작성하시거나 sales@ironsoftware.com으로 이메일을 보내주세요.
고객님의 정보는 항상 비밀로 유지됩니다.
전 세계 수백만 엔지니어들이 신뢰하는 제품입니다.
Iron Software의 고객 로고
지금 바로 30일 무료 체험판 키를 받으세요.
신용카드나 계정 생성은 필요하지 않습니다.