GetBarcodes

GetBarcodes()

ドキュメントからバーコードを抽出します。

public IEnumerable<PageBarcodeArea> GetBarcodes()

戻り値

のコレクションPageBarcodeAreaオブジェクト; ヌルバーコード抽出がサポートされていない場合.

次の例は、ドキュメントからバーコードを抽出する方法を示しています:

// Parser クラスのインスタンスを作成します
using (Parser parser = new Parser(filePath))
{
    // ドキュメントからバーコードを抽出します。
    IEnumerable<PageBarcodeArea> barcodes = parser.GetBarcodes();

    // バーコードを繰り返す
    foreach(PageBarcodeArea barcode in barcodes)
    {
        // ページ インデックスを出力します
        Console.WriteLine("Page: " + barcode.Page.Index.ToString());
        // バーコード値を出力
        Console.WriteLine("Value: " + barcode.Value);
    }
}

関連項目


GetBarcodes(int)

ドキュメント ページからバーコードを抽出します。

public IEnumerable<PageBarcodeArea> GetBarcodes(int pageIndex)
パラメータ タイプ 説明
pageIndex Int32 ゼロベースのページ インデックス。

戻り値

のコレクションPageBarcodeAreaオブジェクト; ヌルバーコード抽出がサポートされていない場合.

次の例は、ドキュメント ページからバーコードを抽出する方法を示しています:

// Parser クラスのインスタンスを作成します
using (Parser parser = new Parser(filePath))
{
    // ドキュメントの 2 ページ目からバーコードを抽出します。
    IEnumerable<PageBarcodeArea> barcodes = parser.GetBarcodes(1);

    // バーコードを繰り返す
    foreach(PageBarcodeArea barcode in barcodes)
    {
        // ページ インデックスを出力します
        Console.WriteLine("Page: " + barcode.Page.Index.ToString());
        // バーコード値を出力
        Console.WriteLine("Value: " + barcode.Value);
    }
}

関連項目


GetBarcodes(PageAreaOptions)

カスタマイズ オプション を使用してドキュメントからバーコードを抽出します (バーコードを含む四角形の領域を設定します)。

public IEnumerable<PageBarcodeArea> GetBarcodes(PageAreaOptions options)
パラメータ タイプ 説明
options PageAreaOptions バーコード抽出のオプション。

戻り値

のコレクションPageBarcodeAreaオブジェクト; ヌルバーコード抽出がサポートされていない場合.

次の例は、右上隅からバーコードを抽出する方法を示しています。

// Parser クラスのインスタンスを作成します
using (Parser parser = new Parser(filePath))
{
    // バーコード抽出に使用されるオプションを作成します
    PageAreaOptions options = new PageAreaOptions(new Rectangle(new Point(590, 80), new Size(150, 150)));
    // 右上隅からバーコードを抽出します。
    IEnumerable<PageBarcodeArea> barcodes = parser.GetBarcodes(options);

    // バーコードを繰り返す
    foreach (PageBarcodeArea barcode in barcodes)
    {
        // ページ インデックスを出力します
        Console.WriteLine("Page: " + barcode.Page.Index.ToString());
        // バーコード値を出力
        Console.WriteLine("Value: " + barcode.Value);
    }
}

関連項目


GetBarcodes(int, PageAreaOptions)

カスタマイズ オプション (バーコードを含む長方形の領域を設定するため) を使用して、ドキュメント ページからバーコードを抽出します。

public IEnumerable<PageBarcodeArea> GetBarcodes(int pageIndex, PageAreaOptions options)
パラメータ タイプ 説明
pageIndex Int32 ゼロベースのページ インデックス。
options PageAreaOptions バーコード抽出のオプション。

戻り値

のコレクションPageBarcodeAreaオブジェクト; ヌルバーコード抽出がサポートされていない場合.

関連項目