IRONSOFTWAREHOME
PDFバーコードリーダーオプションの設定
using IronBarCode;

PdfBarcodeReaderOptions myPdfOptionsExample = new PdfBarcodeReaderOptions()
{
    // The password string to open the PDF if there is one
    Password = "password123",

    // Pages of the PDF you want to scan
    PageNumbers = new[] { 1, 3 },

    // By default, all barcode formats are scanned for
    // Specifying a subset of barcode types to search for would improve performance
    ExpectBarcodeTypes = BarcodeEncoding.AllOneDimensional,

    // The DPI (dots per inch) to render each barcode image for reading
    DPI = 72,

    // The scaling factor to scale the width and height when converting the PDF to image
    // Default is 3.5 for both dimensions
    Scale = 4
};

// Read the pdf with the options applied
var results = BarcodeReader.ReadPdf("barcode.pdf", myPdfOptionsExample);
Imports IronBarCode

Dim myPdfOptionsExample As New PdfBarcodeReaderOptions() With {
    .Password = "password123",
    .PageNumbers = {1, 3},
    .ExpectBarcodeTypes = BarcodeEncoding.AllOneDimensional,
    .DPI = 72,
    .Scale = 4
}

' Read the pdf with the options applied
Dim results = BarcodeReader.ReadPdf("barcode.pdf", myPdfOptionsExample)
NuGet Download
PM > Install-Package BarCode
PDFバーコードリーダーオプションの設定

PDFバーコードリーダーオプションの設定

IronBarcodeにはPDF専用のカスタマイズと最適化された読み取りをサポートするためのPdfBarcodeReaderOptionsクラスにさまざまなオプションがあります。 これではPDFのパスワード、スキャンするページの選択、PDFを解析するDpi、読み取り品質向上のために必要な追加のスケーリングを処理します。

重要なポイント

  1. PdfBarcodeReaderOptionsの作成
    • PDF処理のためのさまざまなオプションを設定するPdfBarcodeReaderOptionsのインスタンスを作成します:
      • Dpi:PDF解析の解像度を設定します。 より高いDpiはバーコード検出精度を向上させることができます。
      • PageNumbers:スキャンすべきPDFページを指定します。 これは特定のページをターゲットにカスタマイズできます。
      • Password:PDFがパスワードで保護されている場合、正しいパスワードをこのオプションを使用して入力できます。
      • ScaleToY:これらのオプションは、PDF画像のスケールを調整してバーコード検出精度を向上させるのに役立ちます。
  2. バーコードの読み取り:
    • PDFファイルからバーコードを読み取り解読するためにReadPdfBarcodesメソッドが使用されます。指定されたオプションを利用します。
  3. 結果の繰り返しと表示:
    • Valueをコンソールに表示します。
  • これにより、指定されたページから検出されたすべてのバーコードが検証またはさらなる処理のために出力されることが保証されます。
C# で PDF からバーコードを読み取る方法を学ぶ
GitHubで見る

準備はできましたか?

Nuget Downloads 2,422,100バージョン:2026.9リリースされたばかり

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

世界中の数百万人のエンジニアから信頼されています。

ライセンスはより安く
義務のない相談を受ける
下記のフォームを記入するか、sales@ironsoftware.comにメールしてください。
あなたの詳細は常に守秘されます。
世界中の数百万人のエンジニアから信頼されています。
ライセンスはより安く
あなたの無料30日間の試用キーをすぐに入手。
クレジットカードやアカウントの作成は不要です。