IronBarcodeを使用したC#でのデータ形式の出力方法
IronBarcodeは、BarcodeImage, BarcodeType, BinaryValue, 座標, サイズ, ページ番号, 向き, テキストおよび値のプロパティを含む、バーコード読み取りからの複数の出力形式を提供します。 これらのフォーマットは、さまざまな使用例に対してプログラムで BarCode データを処理することを可能にします。
IronBarcodeは単にバーコードを読み取り、コンソールに値を表示するだけでなく、それ以上のものを提供します。 ユーザーが読み取り結果を処理できるように、いくつかの出力形式が用意されています。 これらの形式には、バーコード画像、バーコードタイプ、BinaryValue, 座標, 高さ, 幅, ページ番号, バーコード, ページの向き, text, 及びvalueといったプロパティが含まれています。
ユーザーはプログラム内でこれらのプロパティをさらに操作できます。 それでは、これらのプロパティの使用方法と、役立つユースケースを説明します。
クイックスタート:1行でバーコードの値とタイプを読み取るこの例は、画像からIronBarcodeを使用してバーコードを読み取る方法を示しています。1行で読み込み、次にバーコードの値とタイプを即座に出力します。 迅速に開始するのに最適です。より包括的な例については、バーコードクイックスタートガイドをご覧ください。
-
1IronBarcode を NuGet Package Manager でインストールします
-
2このコード スニペットをコピーして実行します。
var result = IronBarCode.BarcodeReader.Read("input.png"); Console.WriteLine($"Value: {result[0].Value}, Type: {result[0].BarcodeType}");Dim result = IronBarCode.BarcodeReader.Read("input.png") Console.WriteLine($"Value: {result(0).Value}, Type: {result(0).BarcodeType}")Dim result = IronBarCode.BarcodeReader.Read("input.png") Console.WriteLine($"Value: {result(0).Value}, Type: {result(0).BarcodeType}") -
3実際の環境でテストするためにデプロイする
今日からご自身のプロジェクトでIronBarcodeを使い始めるには、無料トライアルをお試しください。
最小限のワークフロー(5ステップ)
- バーコードを読み取るためのC#ライブラリをダウンロードします。
- バーコード検出のためにPDFと画像を準備します
- 検出されたバーコードの種類と画像にアクセスします。
xとy座標、およびそのheightとwidthを取得します。- バーコードの
textとvalueを読み取ります。
利用可能な出力形式とその使用ケースは何ですか?
BarcodeResultはさまざまな便利なプロパティを格納します。 これらのプロパティは以下に列挙されます:
BarcodeImageBarcodeTypeBinaryValue- 座標、
Height&Width PageNumberBarcodeとPageOrientationText&Value
各プロパティは、BarCode処理ワークフローにおいて特定の目的を果たします。 インベントリ管理システム、ドキュメント処理パイプライン、品質管理アプリケーションを構築する場合でも、これらのデータ形式はさまざまなソースからバーコードを読み取るために必要な柔軟性を提供します。
バーコード画像を抽出して保存するにはどうすればよいですか?
IronBarcodeが画像を読み込むと、画像内で見つかったバーコードはBarcodeResultに、BarcodeImageプロパティとしてAnyBitmap型で保存されます。 BarcodeImageプロパティは見つかったバーコード画像を格納します。 ユーザーは、このオブジェクトを取得して画像をさらに加工したり、永久コピーとして保存したりすることができます。 これは、画像から BarCode 画像を抽出するための追加コードを排除することで、効率性と使いやすさを提供します。
以下のコード・スニペットは、この出力形式の使用例を示しています:
using IronBarCode;
using IronSoftware.Drawing;
using System.Collections.Generic;
// Read barcode from PDF file
BarcodeResults result = BarcodeReader.ReadPdf("test.pdf");
// Create list for barcodes
List<AnyBitmap> barcodeList = new List<AnyBitmap>();
foreach (BarcodeResult barcode in result)
{
barcodeList.Add(barcode.BarcodeImage);
}
// Create multi-page TIFF
AnyBitmap.CreateMultiFrameTiff(barcodeList).SaveAs("barcodeImages.tif");using IronBarCode;
using IronSoftware.Drawing;
using System.Collections.Generic;
// Read barcode from PDF file
BarcodeResults result = BarcodeReader.ReadPdf("test.pdf");
// Create list for barcodes
List<AnyBitmap> barcodeList = new List<AnyBitmap>();
foreach (BarcodeResult barcode in result)
{
barcodeList.Add(barcode.BarcodeImage);
}
// Create multi-page TIFF
AnyBitmap.CreateMultiFrameTiff(barcodeList).SaveAs("barcodeImages.tif");Imports IronBarCode
Imports IronSoftware.Drawing
Imports System.Collections.Generic
' Read barcode from PDF file
Private result As BarcodeResults = BarcodeReader.ReadPdf("test.pdf")
' Create list for barcodes
Private barcodeList As New List(Of AnyBitmap)()
For Each barcode As BarcodeResult In result
barcodeList.Add(barcode.BarcodeImage)
Next barcode
' Create multi-page TIFF
AnyBitmap.CreateMultiFrameTiff(barcodeList).SaveAs("barcodeImages.tif")Imports IronBarCode
Imports IronSoftware.Drawing
Imports System.Collections.Generic
' Read barcode from PDF file
Private result As BarcodeResults = BarcodeReader.ReadPdf("test.pdf")
' Create list for barcodes
Private barcodeList As New List(Of AnyBitmap)()
For Each barcode As BarcodeResult In result
barcodeList.Add(barcode.BarcodeImage)
Next barcode
' Create multi-page TIFF
AnyBitmap.CreateMultiFrameTiff(barcodeList).SaveAs("barcodeImages.tif")上のコード・スニペットは、この出力形式の使用例を示しています。 具体的には、PDF文書内で検出されたBarCodeから複数ページのTIFF画像を作成します。 最初に、サンプルPDFでバーコードをスキャンまたは検出します。 次に、BarcodeImageプロパティから情報を格納するAnyBitmapのリストを作成します。 最後に、このリストを使用してCreateMultiFrameTiffメソッドを使って複数ページのTIFFを生成します。 このテクニックは、マルチページGIFとTIFFファイルの処理に特に有用です。
BarcodeImageプロパティは、BarcodeResultの読み取り中に見つかったバーコードの画像だけを保存し、入力画像全体は保存しません。異なるバーコードタイプをプログラムで識別するにはどうすればよいですか?
このプロパティは、入力画像または文書に存在するバーコードのタイプを判別するのに役立ちます。 ただし、画像内のバーコードタイプがIronBarcodeでサポートされ、読み取り可能でなければならないという制限があります。 IronBarcodeでサポートされているバーコードタイプについて詳しくは、この記事を参照してください。 さらに、特定の要件に対しての互換性を確保するために、サポートされているバーコード形式の完全なリストを確認してください。
以下のコードスニペットは、コンソールに値を出力することによって、画像内のバーコード値とバーコードタイプを取得する方法を示しています。
using IronBarCode;
using System;
// Read barcode from PNG
BarcodeResults result = BarcodeReader.Read("bc3.png");
// Output barcode type to console
foreach (BarcodeResult barcode in result)
{
Console.WriteLine("The barcode value is " + barcode.ToString() + " and the barcode type is " + barcode.BarcodeType);
}using IronBarCode;
using System;
// Read barcode from PNG
BarcodeResults result = BarcodeReader.Read("bc3.png");
// Output barcode type to console
foreach (BarcodeResult barcode in result)
{
Console.WriteLine("The barcode value is " + barcode.ToString() + " and the barcode type is " + barcode.BarcodeType);
}Imports IronBarCode
Imports System
' Read barcode from PNG
Private result As BarcodeResults = BarcodeReader.Read("bc3.png")
' Output barcode type to console
For Each barcode As BarcodeResult In result
Console.WriteLine("The barcode value is " & barcode.ToString() & " and the barcode type is " & barcode.BarcodeType)
Next barcodeImports IronBarCode
Imports System
' Read barcode from PNG
Private result As BarcodeResults = BarcodeReader.Read("bc3.png")
' Output barcode type to console
For Each barcode As BarcodeResult In result
Console.WriteLine("The barcode value is " & barcode.ToString() & " and the barcode type is " & barcode.BarcodeType)
Next barcode上記のコードスニペットから、入力画像でBarcodeReader.Read()メソッドを呼び出してバーコード読み取りを行います。 これは、画像内のすべてのバーコードを読み取ることで得られるすべてのBarcodeResultを保存するBarcodeResultsオブジェクトを返します。 次に、BarcodeResultsオブジェクトを繰り返し処理してBarcodeResultを取得し、バーコードのvalueとtypeをコンソールに出力します。 この方法は、Code 39バーコードのような特殊な形式を含むさまざまなバーコードタイプで動作します。
いつバイナリ値の出力を使用すべきですか?
IronBarcodeを使用すると、ユーザーはBarcodeResultオブジェクトのBinaryValueプロパティにアクセスすることで、バーコードvalueのバイト配列を取得できます。 これにより、プログラム内でバーコードvalueをさらに操作することができます。 バイナリvalue出力は、暗号化されたデータやバーコードにエンコードされている添付ファイル、あるいはバイトレベルのデータ処理を要求するシステムと統合する場合に特に有用です。
下のコードスニペットは、バーコードvalueをバイナリデータとして取得する使用例を示しています:
using IronBarCode;
// Read barcode from PNG
BarcodeResults result = BarcodeReader.Read("multiple-barcodes.png");
int i = 1;
foreach (BarcodeResult barcode in result)
{
var binaryValue = barcode.BinaryValue;
var barcodeType = IronBarCode.BarcodeEncoding.QRCode;
// Create QR code
GeneratedBarcode generatedBarcode = BarcodeWriter.CreateBarcode(binaryValue, barcodeType);
// Export QR code
generatedBarcode.SaveAsPng($"qrFromBinary{i}.png");
i++;
}using IronBarCode;
// Read barcode from PNG
BarcodeResults result = BarcodeReader.Read("multiple-barcodes.png");
int i = 1;
foreach (BarcodeResult barcode in result)
{
var binaryValue = barcode.BinaryValue;
var barcodeType = IronBarCode.BarcodeEncoding.QRCode;
// Create QR code
GeneratedBarcode generatedBarcode = BarcodeWriter.CreateBarcode(binaryValue, barcodeType);
// Export QR code
generatedBarcode.SaveAsPng($"qrFromBinary{i}.png");
i++;
}Imports IronBarCode
' Read barcode from PNG
Private result As BarcodeResults = BarcodeReader.Read("multiple-barcodes.png")
Private i As Integer = 1
For Each barcode As BarcodeResult In result
Dim binaryValue = barcode.BinaryValue
Dim barcodeType = IronBarCode.BarcodeEncoding.QRCode
' Create QR code
Dim generatedBarcode As GeneratedBarcode = BarcodeWriter.CreateBarcode(binaryValue, barcodeType)
' Export QR code
generatedBarcode.SaveAsPng($"qrFromBinary{i}.png")
i += 1
Next barcodeImports IronBarCode
' Read barcode from PNG
Private result As BarcodeResults = BarcodeReader.Read("multiple-barcodes.png")
Private i As Integer = 1
For Each barcode As BarcodeResult In result
Dim binaryValue = barcode.BinaryValue
Dim barcodeType = IronBarCode.BarcodeEncoding.QRCode
' Create QR code
Dim generatedBarcode As GeneratedBarcode = BarcodeWriter.CreateBarcode(binaryValue, barcodeType)
' Export QR code
generatedBarcode.SaveAsPng($"qrFromBinary{i}.png")
i += 1
Next barcode上記のコードスニペットを観察すると、画像内の複数のバーコードを新しいバイナリエンコードファイルに変換する直感的なプログラムを作成しました。 最初に、サンプルのPNG画像でバーコードをスキャンします。 これらのバーコードを検出すると、反復処理を行い、BinaryValueプロパティにアクセスして新しいバイナリファイルを作成します。 このテクニックは複数のバーコードを読み取り、それぞれのバイナリデータを個別に処理する必要があるときに特に価値があります。
バーコードの位置と寸法にアクセスするにはどうすればよいですか?
BarcodeResultオブジェクトでは、バーコードの各頂点の座標を表すPointF[]を格納したPointsプロパティから位置を取得できるほか、画像ファイルや文書内でのHeightとWidthも取得できます。 これらのプロパティは、ユーザーがバーコードの位置や寸法に関する情報を取得する必要がある場合に役立ちます。 この空間情報は、バーコードスキャンを最適化するための切り取り領域を実装する場合や、自動化ドキュメント処理、品質管理システムに必要な正確な位置特定にとって重要です。
バーコードの位置と寸法を示しましょう。
using IronBarCode;
using IronSoftware.Drawing;
using System.Linq;
// Read barcode from PNG
BarcodeResults result = BarcodeReader.Read("multiple-barcodes.png");
AnyBitmap bitmap = AnyBitmap.FromFile("multiple-barcodes.png");
foreach (BarcodeResult barcode in result)
{
PointF[] barcodePoints = barcode.Points;
float x1 = barcodePoints.Select(b => b.X).Min();
float y1 = barcodePoints.Select(b => b.Y).Min();
Rectangle rectangle = new Rectangle((int)x1, (int)y1, (int)barcode.Width!, (int)barcode.Height!);
bitmap = bitmap.Redact(rectangle, Color.Magenta);
// Save the image
bitmap.SaveAs("redacted.png", AnyBitmap.ImageFormat.Png);
}using IronBarCode;
using IronSoftware.Drawing;
using System.Linq;
// Read barcode from PNG
BarcodeResults result = BarcodeReader.Read("multiple-barcodes.png");
AnyBitmap bitmap = AnyBitmap.FromFile("multiple-barcodes.png");
foreach (BarcodeResult barcode in result)
{
PointF[] barcodePoints = barcode.Points;
float x1 = barcodePoints.Select(b => b.X).Min();
float y1 = barcodePoints.Select(b => b.Y).Min();
Rectangle rectangle = new Rectangle((int)x1, (int)y1, (int)barcode.Width!, (int)barcode.Height!);
bitmap = bitmap.Redact(rectangle, Color.Magenta);
// Save the image
bitmap.SaveAs("redacted.png", AnyBitmap.ImageFormat.Png);
}Imports System
Imports IronBarCode
Imports IronSoftware.Drawing
Imports System.Linq
' Read barcode from PNG
Private result As BarcodeResults = BarcodeReader.Read("multiple-barcodes.png")
Private bitmap As AnyBitmap = AnyBitmap.FromFile("multiple-barcodes.png")
For Each barcode As BarcodeResult In result
Dim barcodePoints() As PointF = barcode.Points
Dim x1 As Single = barcodePoints.Select(Function(b) b.X).Min()
Dim y1 As Single = barcodePoints.Select(Function(b) b.Y).Min()
'INSTANT VB TODO TASK: There is no VB equivalent to the C# 'null-forgiving operator':
'ORIGINAL LINE: Rectangle rectangle = new Rectangle((int)x1, (int)y1, (int)barcode.Width!, (int)barcode.Height!);
Dim rectangle As New Rectangle(CInt(Math.Truncate(x1)), CInt(Math.Truncate(y1)), CInt(barcode.Width), CInt(barcode.Height))
bitmap = bitmap.Redact(rectangle, Color.Magenta)
' Save the image
bitmap.SaveAs("redacted.png", AnyBitmap.ImageFormat.Png)
Next barcodeImports System
Imports IronBarCode
Imports IronSoftware.Drawing
Imports System.Linq
' Read barcode from PNG
Private result As BarcodeResults = BarcodeReader.Read("multiple-barcodes.png")
Private bitmap As AnyBitmap = AnyBitmap.FromFile("multiple-barcodes.png")
For Each barcode As BarcodeResult In result
Dim barcodePoints() As PointF = barcode.Points
Dim x1 As Single = barcodePoints.Select(Function(b) b.X).Min()
Dim y1 As Single = barcodePoints.Select(Function(b) b.Y).Min()
'INSTANT VB TODO TASK: There is no VB equivalent to the C# 'null-forgiving operator':
'ORIGINAL LINE: Rectangle rectangle = new Rectangle((int)x1, (int)y1, (int)barcode.Width!, (int)barcode.Height!);
Dim rectangle As New Rectangle(CInt(Math.Truncate(x1)), CInt(Math.Truncate(y1)), CInt(barcode.Width), CInt(barcode.Height))
bitmap = bitmap.Redact(rectangle, Color.Magenta)
' Save the image
bitmap.SaveAs("redacted.png", AnyBitmap.ImageFormat.Png)
Next barcode
墨消し前

墨消し後
上記のコード・スニペットは、画像ファイル内の複数のバーコードを墨消ししています。これを実現するために、IronBarcodeとIronDrawingという2つのライブラリを組み合わせて使用しています。 BarcodeResultオブジェクトを取得し、そのプロパティを抽出するために、最初にBarcodeReader.Read()メソッドを使用して画像ファイル内で利用可能なバーコードを読み取ります。 同時に、入力画像ファイルをAnyBitmapオブジェクトに変換する必要があり、画像に墨消しメソッドを適用できるようにします。 BarcodeResults オブジェクトが得られたら、ループを適用してそれを反復処理し、イメージ内のすべてのバーコードに対して Points、Width、Height を取得します(各バーコードの左上隅の x1/y1 座標を Points から算出し)、CropRectangle プロパティとして AnyBitmap.Redact() メソッド内で使用します。
なぜ複数ページの文書でページ番号が重要なのですか?
ユーザーは、BarCodeが見つかったページ番号を取得することができます。 これは、複数の BarCode を含む複数ページのドキュメントを使用し、さらに処理するためにドキュメント内で見つかったバーコードの場所を知る必要があるユーザーに役立つ機能です。 この機能は、PDFドキュメントからバーコードを読み取ったり、企業のアプリケーションでバッチ文書を処理するときに不可欠です。
下のコードを見てください:
using IronBarCode;
using System;
// Read barcode from PDF
BarcodeResults result = BarcodeReader.ReadPdf("test.pdf");
// Output page number to console
foreach (BarcodeResult barcode in result)
{
Console.WriteLine("The barcode value " + barcode.ToString() + " is found on page number " + barcode.PageNumber);
}using IronBarCode;
using System;
// Read barcode from PDF
BarcodeResults result = BarcodeReader.ReadPdf("test.pdf");
// Output page number to console
foreach (BarcodeResult barcode in result)
{
Console.WriteLine("The barcode value " + barcode.ToString() + " is found on page number " + barcode.PageNumber);
}Imports IronBarCode
Imports System
' Read barcode from PDF
Private result As BarcodeResults = BarcodeReader.ReadPdf("test.pdf")
' Output page number to console
For Each barcode As BarcodeResult In result
Console.WriteLine("The barcode value " & barcode.ToString() & " is found on page number " & barcode.PageNumber)
Next barcodeImports IronBarCode
Imports System
' Read barcode from PDF
Private result As BarcodeResults = BarcodeReader.ReadPdf("test.pdf")
' Output page number to console
For Each barcode As BarcodeResult In result
Console.WriteLine("The barcode value " & barcode.ToString() & " is found on page number " & barcode.PageNumber)
Next barcode上記のコードスニペットは、プログラムがマルチページPDFドキュメントで見つかるバーコードのvalueとそれぞれのページ番号を返す必要がある場合の使用例を示しています。 このコードはBarcodeReader.ReadPdf()メソッドを使用して、多ページのPDFドキュメント内のバーコードを読み取り、BarcodeResultsオブジェクトを返してドキュメント内で見つかったすべてのBarcodeResultを保存します。 オブジェクト内の各項目を取得するためにループを適用し、バーコードのvalueを取得し、バーコードが見つかったページ番号を取得します。 この使用例とは別に、ユーザーはこのプロパティを使用して、ドキュメント内のすべての BarCode が読み取られたかどうかをデバッグできます。
バーコードの回転とページの向きを検出するにはどうすればよいですか?
IronBarcodeを使用すると、ユーザーはバーコードの向きやバーコードが見つかったページの向きの情報を取得することができます。 この2つの情報を抽出するには、BarcodeResultオブジェクトのRotationとPageOrientationプロパティにアクセスします。 Rotationは見つかったバーコードの回転角を表す整数を返します。 この機能は画像の向き補正能力と連携し、スキャン角にかかわらず正確なバーコード読み取りを保証します。
下のコードを見てください:
using IronBarCode;
using System;
// Read barcode from PDF
BarcodeResults result = BarcodeReader.ReadPdf("test.pdf");
// Output page orientation and rotation to console
foreach (BarcodeResult barcode in result)
{
Console.WriteLine(barcode.Value);
Console.WriteLine(barcode.PageOrientation);
Console.WriteLine(barcode.Rotation);
}using IronBarCode;
using System;
// Read barcode from PDF
BarcodeResults result = BarcodeReader.ReadPdf("test.pdf");
// Output page orientation and rotation to console
foreach (BarcodeResult barcode in result)
{
Console.WriteLine(barcode.Value);
Console.WriteLine(barcode.PageOrientation);
Console.WriteLine(barcode.Rotation);
}Imports IronBarCode
Imports System
' Read barcode from PDF
Private result As BarcodeResults = BarcodeReader.ReadPdf("test.pdf")
' Output page orientation and rotation to console
For Each barcode As BarcodeResult In result
Console.WriteLine(barcode.Value)
Console.WriteLine(barcode.PageOrientation)
Console.WriteLine(barcode.Rotation)
Next barcodeImports IronBarCode
Imports System
' Read barcode from PDF
Private result As BarcodeResults = BarcodeReader.ReadPdf("test.pdf")
' Output page orientation and rotation to console
For Each barcode As BarcodeResult In result
Console.WriteLine(barcode.Value)
Console.WriteLine(barcode.PageOrientation)
Console.WriteLine(barcode.Rotation)
Next barcode上記のコードスニペットは、サンプルのPDF入力を使用して実行され、ユーザーがページの向きとバーコードの回転をそれぞれpageOrientationとrotationを取得して確認できることを証明しました。 この機能は主にデバッグ目的で役立ちます。
BarcodeResult.PageOrientation、BarcodeResult.Rotation、0、90、180、270度の回転を持つバーコードのみを読み取ることができます。 指定した以外の回転値がある場合、IronBarcodeは値を返しません。 PageOrientationは、PortraitまたはLandscapeから成るPageOrientationオブジェクトを返します。テキストプロパティと値プロパティの違いは何ですか?
もちろん、IronBarcodeを使用する際にユーザーが取得したい主なプロパティは、valueとtextです。 これら2つのプロパティは一般に同じように使用でき、同じvalueを返します。 それとは別に、ユーザーはBarcodeResult.ToString()メソッドを使用して同じ結果を達成できます。 特殊なアプリケーションで作業している場合やストリームとしてバーコードデータをエクスポートする場合、これらのプロパティはバーコードコンテンツに柔軟にアクセスする方法を提供します。
以下のコードスニペットはデモンストレーションを示しています:
using IronBarCode;
using System;
// Read barcode from PDF
BarcodeResults result = BarcodeReader.ReadPdf("barcodestamped3.pdf");
// Output text value to console
foreach (BarcodeResult barcode in result)
{
Console.WriteLine(barcode.Value);
Console.WriteLine(barcode.Text);
Console.WriteLine(barcode.ToString());
}using IronBarCode;
using System;
// Read barcode from PDF
BarcodeResults result = BarcodeReader.ReadPdf("barcodestamped3.pdf");
// Output text value to console
foreach (BarcodeResult barcode in result)
{
Console.WriteLine(barcode.Value);
Console.WriteLine(barcode.Text);
Console.WriteLine(barcode.ToString());
}Imports IronBarCode
Imports System
' Read barcode from PDF
Private result As BarcodeResults = BarcodeReader.ReadPdf("barcodestamped3.pdf")
' Output text value to console
For Each barcode As BarcodeResult In result
Console.WriteLine(barcode.Value)
Console.WriteLine(barcode.Text)
Console.WriteLine(barcode.ToString())
Next barcodeImports IronBarCode
Imports System
' Read barcode from PDF
Private result As BarcodeResults = BarcodeReader.ReadPdf("barcodestamped3.pdf")
' Output text value to console
For Each barcode As BarcodeResult In result
Console.WriteLine(barcode.Value)
Console.WriteLine(barcode.Text)
Console.WriteLine(barcode.ToString())
Next barcode上記のコードスニペットから、ユーザーはIronBarcodeを使用して画像内のバーコードを読み取るために必要なコードはわずか数行です。 BarcodeReader.Read()メソッドによって返されたBarcodeResultsを繰り返し処理した後、ValueとTextプロパティを取得し、BarcodeResult.ToString()メソッドを呼び出して、それらすべてが同じvalueを返すことを示す結果をコンソールに出力します。
要するに、IronBarcodeはユーザーがバーコードに関するさまざまな操作を行うための完璧なAPIです。書き込みやデコードに限りません。 様々な出力データ形式をサポートしているため、ユーザーはIronBarcodeから返されるBarcodeResultオブジェクトを使用してさらに多くのことができます。
よくある質問
IronBarcodeで利用可能なバーコード出力形式は何ですか?
IronBarcodeは、BarcodeImage、BarcodeType、BinaryValue、座標、寸法、ページ番号、方向、テキスト、値プロパティなど、複数の出力形式を提供します。これらの形式は、.NETアプリケーションの様々なデータ処理ニーズに対応します。
バーコードの値とタイプを読み取り、すぐに印刷するにはどうすればよいですか?
IronBarcodeを使用すると、画像からバーコードを読み取り、その値とタイプを即座にコード1行で印刷できます。例: var result = IronBarCode.BarcodeReader.Read("input.png"); Console.WriteLine($"Value: {result[0].Value}, Type: {result[0].BarcodeType}");
IronBarcodeを使用してバーコード画像を抽出して保存するにはどうすればよいですか?
BarcodeImageプロパティを用いて、読み取ったバーコードの画像にアクセスすることができます。この画像は、IronBarcodeのツールを使って必要に応じて処理または保存できます。
バーコード処理におけるBinaryValue出力の目的は何ですか?
BinaryValueを使用すると、ユーザーはバーコードのバイト配列を取得できます。これは、暗号化されたデータの処理やバイトレベルのデータ操作を必要とするシステム統合に特に役立ちます。
画像内のバーコードの位置と寸法をどのように判断できますか?
IronBarcodeは、バーコードの位置と寸法を特定するためのPoints、Height、およびWidthといったプロパティを提供し、正確な空間データを必要とするアプリケーションを可能にします。
なぜ複数ページのドキュメントを読むときにページ番号情報が重要なのですか?
ページ番号情報は、各バーコードが多ページのドキュメント内のどこに位置するかを特定するのに役立ち、効率的な処理と多数のバーコードを含むドキュメントのデバッグを可能にします。
IronBarcodeはバーコードの回転やページの向きをどのように処理しますか?
IronBarcodeは、RotationおよびPageOrientationプロパティを提供し、回転しているバーコードや異なる向きのページ上のバーコードを正しく認識して処理することができます。
IronBarcodeにおけるTextとValueプロパティの違いは何ですか?
TextとValueプロパティは通常同じデータを返し、バーコードの内容を表します。しかし、これらはバーコード情報を好みの形式で利用するための柔軟性を提供します。
IronBarcodeの出力データ形式から恩恵を受けるアプリケーションはどのようなものですか?
在庫管理、ドキュメント処理、品質管理のアプリケーションは、IronBarcodeの多様なデータ形式から大きな恩恵を受け、幅広いバーコードデータ処理オプションを提供します。
IronBarcodeは複数ページのPDFドキュメントからバーコードを読み取ることができますか?
はい、IronBarcodeはBarcodeReader.ReadPdf()のようなメソッドを使用して、複数ページのPDFドキュメントからバーコードを読み取ることができ、各バーコードが見つかったページ番号も知らせます。