C#を使用してPDFにバーコードをスタンプする方法
既存のPDFドキュメントにバーコードをスタンプするには、IronBarcodeのCreateBarcodeメソッドを使用し、単一ページの場合はStampToExistingPdfPage、複数ページの場合はStampToExistingPdfPagesを使用し、座標とページ番号を指定します。
この例は、IronBarcodeのCreateBarcodeを使用してバーコードを生成し、それを既存のPDFページにスタンプする方法を示しています。 PDFのパス、位置座標、ページ番号を提供してください。
-
1IronBarcode を NuGet Package Manager でインストールします
-
2このコード スニペットをコピーして実行します。
IronBarCode.BarcodeWriter.CreateBarcode("https://my.site", IronBarCode.BarcodeEncoding.QRCode, 150, 150) .StampToExistingPdfPage("report.pdf", x: 50, y: 50, pageNumber: 1);IronBarCode.BarcodeWriter.CreateBarcode("https://my.site", IronBarCode.BarcodeEncoding.QRCode, 150, 150) _ .StampToExistingPdfPage("report.pdf", x:=50, y:=50, pageNumber:=1)IronBarCode.BarcodeWriter.CreateBarcode("https://my.site", IronBarCode.BarcodeEncoding.QRCode, 150, 150) _ .StampToExistingPdfPage("report.pdf", x:=50, y:=50, pageNumber:=1) -
3実際の環境でテストするためにデプロイする
今日からご自身のプロジェクトでIronBarcodeを使い始めるには、無料トライアルをお試しください。
StampToExistingPdfPage
StampToExistingPdfPages
最小限のワークフロー(5ステップ)
- PDFにバーコードをスタンプするためのC#ライブラリをダウンロード
- 指定されたバーコードタイプと値でバーコードを作成します
- バーコードのサイズを指定します
StampToExistingPdfPageメソッドを使用して、単一のPDFページにバーコードをスタンプします。StampToExistingPdfPagesメソッドを使用して、複数のPDFページにバーコードをスタンプします。
既存のPDFページにバーコードをスタンプする方法は?
バーコードをPDFとしてエクスポートする以外に、IronBarcodeはGeneratedBarcodeを既存のPDFドキュメントに直接スタンプすることができます。 この機能は、既存のレポート、請求書、フォームにトラッキングコード、在庫ラベル、またはドキュメント識別子を追加する場合に便利です。 次のコード・スニペットは、このタスクを示しています。
using IronBarCode;
GeneratedBarcode myBarcode = BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode/", BarcodeEncoding.Code128, 200, 100);
myBarcode.StampToExistingPdfPage("pdf_file_path.pdf", x: 200, y: 100, 3, "password");using IronBarCode;
GeneratedBarcode myBarcode = BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode/", BarcodeEncoding.Code128, 200, 100);
myBarcode.StampToExistingPdfPage("pdf_file_path.pdf", x: 200, y: 100, 3, "password");Imports IronBarCode
Private myBarcode As GeneratedBarcode = BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode/", BarcodeEncoding.Code128, 200, 100)
myBarcode.StampToExistingPdfPage("pdf_file_path.pdf", x:= 200, y:= 100, 3, "password")Imports IronBarCode
Private myBarcode As GeneratedBarcode = BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode/", BarcodeEncoding.Code128, 200, 100)
myBarcode.StampToExistingPdfPage("pdf_file_path.pdf", x:= 200, y:= 100, 3, "password")StampToExistingPdfPageにはどのようなパラメーターが必要ですか?
StampToExistingPdfPage()
GeneratedBarcode
コードスニペットは、PDFドキュメントにオブジェクトをスタンプするためにStampToExistingPdfPageメソッドを呼び出します。 この方法は、シンプルさを維持しながら、柔軟性を提供します。 以下はメソッドのパラメータです:
pdfFilePath: PDFドキュメントパスを表すSystem.String(相対または絶対)。x: 左端からピクセル単位での水平位置のSystem.Double。y: 下端からピクセル単位での垂直位置のSystem.Double。pageNumber: ページを示すSystem.Int32(1-indexed、最初のページは1)。password: パスワード保護されたPDF用のSystem.String(オプション)。
StampToExistingPdfPageを使用するのはいつですか?
コードスニペットを実行すると、GeneratedBarcodeが中間保存なしで直接PDFドキュメントにスタンプされます。 この方法は、以下のようなシナリオに適しています:
StampToExistingPdfPages()
GeneratedBarcode
- 出荷ラベルや配送ドキュメント上のユニークな追跡コード
- 製造レポート上のロット番号
- 法的または規制フォーム上のドキュメント管理番号
- デジタル認証またはクイックアクセスリンク用のQRコード
ダイレクトスタンプ方式は、処理時間を節約し、一時ファイルを排除します。 さまざまなバーコードタイプに関する情報は、サポートされているバーコード形式ガイドをご覧ください。
複数のPDFページにバーコードをスタンプする方法は?
同じ BarCode を複数のページにスタンプする必要がある場合があります。 一般的な用途としては、複数ページのレポートの各ページに文書識別子を適用したり、技術文書全体にバージョン管理コードを追加したり、機密資料の各ページにセキュリティ BarCode を挿入したりすることが挙げられます。 単一ページメソッドをループする代わりに、GeneratedBarcodeオブジェクトでStampToExistingPdfPagesメソッドを使用します。 次のコード・スニペットは、この方法を示しています。
using IronBarCode;
using System.Collections.Generic;
GeneratedBarcode myBarcode = BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode/", BarcodeEncoding.Code128, 200, 100);
List<int> pages = new List<int>();
pages.Add(1);
pages.Add(2);
pages.Add(3);
myBarcode.StampToExistingPdfPages("pdf_file_path.pdf", x: 200, y: 100, pages, "password");using IronBarCode;
using System.Collections.Generic;
GeneratedBarcode myBarcode = BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode/", BarcodeEncoding.Code128, 200, 100);
List<int> pages = new List<int>();
pages.Add(1);
pages.Add(2);
pages.Add(3);
myBarcode.StampToExistingPdfPages("pdf_file_path.pdf", x: 200, y: 100, pages, "password");Imports IronBarCode
Imports System.Collections.Generic
Private myBarcode As GeneratedBarcode = BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode/", BarcodeEncoding.Code128, 200, 100)
Private pages As New List(Of Integer)()
pages.Add(1)
pages.Add(2)
pages.Add(3)
myBarcode.StampToExistingPdfPages("pdf_file_path.pdf", x:= 200, y:= 100, pages, "password")Imports IronBarCode
Imports System.Collections.Generic
Private myBarcode As GeneratedBarcode = BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode/", BarcodeEncoding.Code128, 200, 100)
Private pages As New List(Of Integer)()
pages.Add(1)
pages.Add(2)
pages.Add(3)
myBarcode.StampToExistingPdfPages("pdf_file_path.pdf", x:= 200, y:= 100, pages, "password")柔軟性を持たせるために、LINQを使用してページ範囲を動的に生成します:
// Stamp on all even pages from 2 to 10
var evenPages = Enumerable.Range(1, 10).Where(x => x % 2 == 0).ToList();
myBarcode.StampToExistingPdfPages("pdf_file_path.pdf", x: 200, y: 100, evenPages, "password");
// Stamp on the first and last 3 pages of a 20-page document
var selectedPages = new List<int> { 1, 2, 3, 18, 19, 20 };
myBarcode.StampToExistingPdfPages("pdf_file_path.pdf", x: 200, y: 100, selectedPages, "password");// Stamp on all even pages from 2 to 10
var evenPages = Enumerable.Range(1, 10).Where(x => x % 2 == 0).ToList();
myBarcode.StampToExistingPdfPages("pdf_file_path.pdf", x: 200, y: 100, evenPages, "password");
// Stamp on the first and last 3 pages of a 20-page document
var selectedPages = new List<int> { 1, 2, 3, 18, 19, 20 };
myBarcode.StampToExistingPdfPages("pdf_file_path.pdf", x: 200, y: 100, selectedPages, "password");Imports System.Linq
' Stamp on all even pages from 2 to 10
Dim evenPages = Enumerable.Range(1, 10).Where(Function(x) x Mod 2 = 0).ToList()
myBarcode.StampToExistingPdfPages("pdf_file_path.pdf", x:=200, y:=100, evenPages, "password")
' Stamp on the first and last 3 pages of a 20-page document
Dim selectedPages = New List(Of Integer) From {1, 2, 3, 18, 19, 20}
myBarcode.StampToExistingPdfPages("pdf_file_path.pdf", x:=200, y:=100, selectedPages, "password")Imports System.Linq
' Stamp on all even pages from 2 to 10
Dim evenPages = Enumerable.Range(1, 10).Where(Function(x) x Mod 2 = 0).ToList()
myBarcode.StampToExistingPdfPages("pdf_file_path.pdf", x:=200, y:=100, evenPages, "password")
' Stamp on the first and last 3 pages of a 20-page document
Dim selectedPages = New List(Of Integer) From {1, 2, 3, 18, 19, 20}
myBarcode.StampToExistingPdfPages("pdf_file_path.pdf", x:=200, y:=100, selectedPages, "password")StampToExistingPdfPagesはどのパラメーターを受け入れますか?
以下はメソッドのパラメータです:
pdfFilePath: PDFドキュメントパスを表すSystem.String。x: ピクセル単位での水平位置のSystem.Double。y: ピクセル単位での垂直位置のSystem.Double。pageNumbers: スタンプするページを示すIEnumerable<System.Int32>(1-indexed)。password: パスワード保護されたPDF用のSystem.String(オプション)。
StampToExistingPdfPages()
StampToExistingPdfPage()
GeneratedBarcode
なぜループを使わずにStampToExistingPdfPagesを使うのですか?
この方法では、手作業による反復作業を行うことなく、複数のページに効率的に BarCode をスタンプすることができ、コードの可読性とパフォーマンスが向上します。 内部実装は、PDF処理を最適化し、以下のような結果をもたらします:
- 実行速度の向上: PDFが1回だけ開かれ、処理されるため、複数回処理されません
- メモリ使用量の削減: 大規模PDFに対する効率的なリソース管理
- コードの簡潔化: 手動のループやエラーハンドリング管理が不要
- アトミック操作: 全ページが単一の操作でスタンプされます
高度なスタンピング技術
スタンピング前のバーコードの外観カスタマイズ
バーコードをPDFにスタンプする前に、その外観をカスタマイズしてください。 IronBarcodeは、広範なカスタマイズオプションを提供しています。
GeneratedBarcode myBarcode = BarcodeWriter.CreateBarcode("INVOICE-2024-001", BarcodeEncoding.Code128, 250, 80);
// Customize the appearance
myBarcode.AddAnnotationTextAboveBarcode("Invoice Number");
myBarcode.AddAnnotationTextBelowBarcode("Scan for digital copy");
myBarcode.SetMargins(10);
myBarcode.ChangeBarCodeColor(IronSoftware.Drawing.Color.DarkBlue);
// Now stamp the customized barcode
myBarcode.StampToExistingPdfPage("invoice.pdf", x: 450, y: 700, pageNumber: 1);GeneratedBarcode myBarcode = BarcodeWriter.CreateBarcode("INVOICE-2024-001", BarcodeEncoding.Code128, 250, 80);
// Customize the appearance
myBarcode.AddAnnotationTextAboveBarcode("Invoice Number");
myBarcode.AddAnnotationTextBelowBarcode("Scan for digital copy");
myBarcode.SetMargins(10);
myBarcode.ChangeBarCodeColor(IronSoftware.Drawing.Color.DarkBlue);
// Now stamp the customized barcode
myBarcode.StampToExistingPdfPage("invoice.pdf", x: 450, y: 700, pageNumber: 1);Dim myBarcode As GeneratedBarcode = BarcodeWriter.CreateBarcode("INVOICE-2024-001", BarcodeEncoding.Code128, 250, 80)
' Customize the appearance
myBarcode.AddAnnotationTextAboveBarcode("Invoice Number")
myBarcode.AddAnnotationTextBelowBarcode("Scan for digital copy")
myBarcode.SetMargins(10)
myBarcode.ChangeBarCodeColor(IronSoftware.Drawing.Color.DarkBlue)
' Now stamp the customized barcode
myBarcode.StampToExistingPdfPage("invoice.pdf", x:=450, y:=700, pageNumber:=1)Dim myBarcode As GeneratedBarcode = BarcodeWriter.CreateBarcode("INVOICE-2024-001", BarcodeEncoding.Code128, 250, 80)
' Customize the appearance
myBarcode.AddAnnotationTextAboveBarcode("Invoice Number")
myBarcode.AddAnnotationTextBelowBarcode("Scan for digital copy")
myBarcode.SetMargins(10)
myBarcode.ChangeBarCodeColor(IronSoftware.Drawing.Color.DarkBlue)
' Now stamp the customized barcode
myBarcode.StampToExistingPdfPage("invoice.pdf", x:=450, y:=700, pageNumber:=1)異なるバーコードタイプの操作
シナリオによって、必要なBarCodeの種類は異なります。QRコードはURLや大きなデータセットに適しており、Code128は英数字の識別子に適しています。 QRコードの作成について学ぶか、他の形式を探索してください。
// QR Code for contact information
var qrCode = BarcodeWriter.CreateBarcode("BEGIN:VCARD\nFN:John Doe\nTEL:555-1234\nEND:VCARD",
BarcodeEncoding.QRCode, 150, 150);
qrCode.StampToExistingPdfPage("businesscard.pdf", x: 400, y: 50, pageNumber: 1);
// Data Matrix for product tracking
var dataMatrix = BarcodeWriter.CreateBarcode("PROD-2024-BATCH-789",
BarcodeEncoding.DataMatrix, 100, 100);
dataMatrix.StampToExistingPdfPage("product_sheet.pdf", x: 50, y: 750, pageNumber: 1);// QR Code for contact information
var qrCode = BarcodeWriter.CreateBarcode("BEGIN:VCARD\nFN:John Doe\nTEL:555-1234\nEND:VCARD",
BarcodeEncoding.QRCode, 150, 150);
qrCode.StampToExistingPdfPage("businesscard.pdf", x: 400, y: 50, pageNumber: 1);
// Data Matrix for product tracking
var dataMatrix = BarcodeWriter.CreateBarcode("PROD-2024-BATCH-789",
BarcodeEncoding.DataMatrix, 100, 100);
dataMatrix.StampToExistingPdfPage("product_sheet.pdf", x: 50, y: 750, pageNumber: 1);' QR Code for contact information
Dim qrCode = BarcodeWriter.CreateBarcode("BEGIN:VCARD" & vbLf & "FN:John Doe" & vbLf & "TEL:555-1234" & vbLf & "END:VCARD",
BarcodeEncoding.QRCode, 150, 150)
qrCode.StampToExistingPdfPage("businesscard.pdf", x:=400, y:=50, pageNumber:=1)
' Data Matrix for product tracking
Dim dataMatrix = BarcodeWriter.CreateBarcode("PROD-2024-BATCH-789",
BarcodeEncoding.DataMatrix, 100, 100)
dataMatrix.StampToExistingPdfPage("product_sheet.pdf", x:=50, y:=750, pageNumber:=1)' QR Code for contact information
Dim qrCode = BarcodeWriter.CreateBarcode("BEGIN:VCARD" & vbLf & "FN:John Doe" & vbLf & "TEL:555-1234" & vbLf & "END:VCARD",
BarcodeEncoding.QRCode, 150, 150)
qrCode.StampToExistingPdfPage("businesscard.pdf", x:=400, y:=50, pageNumber:=1)
' Data Matrix for product tracking
Dim dataMatrix = BarcodeWriter.CreateBarcode("PROD-2024-BATCH-789",
BarcodeEncoding.DataMatrix, 100, 100)
dataMatrix.StampToExistingPdfPage("product_sheet.pdf", x:=50, y:=750, pageNumber:=1)エラーハンドリングとベストプラクティス
PDFのスタンピング操作の際に、適切なエラー処理を実装すること:
try
{
GeneratedBarcode myBarcode = BarcodeWriter.CreateBarcode("DOCUMENT-ID-12345",
BarcodeEncoding.Code128, 200, 60);
// Verify the PDF exists before attempting to stamp
if (File.Exists("target.pdf"))
{
myBarcode.StampToExistingPdfPage("target.pdf", x: 100, y: 100, pageNumber: 1);
Console.WriteLine("Barcode stamped successfully!");
}
else
{
Console.WriteLine("PDF file not found!");
}
}
catch (Exception ex)
{
Console.WriteLine($"Error stamping barcode: {ex.Message}");
// Log the error or handle it appropriately
}try
{
GeneratedBarcode myBarcode = BarcodeWriter.CreateBarcode("DOCUMENT-ID-12345",
BarcodeEncoding.Code128, 200, 60);
// Verify the PDF exists before attempting to stamp
if (File.Exists("target.pdf"))
{
myBarcode.StampToExistingPdfPage("target.pdf", x: 100, y: 100, pageNumber: 1);
Console.WriteLine("Barcode stamped successfully!");
}
else
{
Console.WriteLine("PDF file not found!");
}
}
catch (Exception ex)
{
Console.WriteLine($"Error stamping barcode: {ex.Message}");
// Log the error or handle it appropriately
}Imports System
Imports System.IO
Try
Dim myBarcode As GeneratedBarcode = BarcodeWriter.CreateBarcode("DOCUMENT-ID-12345", BarcodeEncoding.Code128, 200, 60)
' Verify the PDF exists before attempting to stamp
If File.Exists("target.pdf") Then
myBarcode.StampToExistingPdfPage("target.pdf", x:=100, y:=100, pageNumber:=1)
Console.WriteLine("Barcode stamped successfully!")
Else
Console.WriteLine("PDF file not found!")
End If
Catch ex As Exception
Console.WriteLine($"Error stamping barcode: {ex.Message}")
' Log the error or handle it appropriately
End TryImports System
Imports System.IO
Try
Dim myBarcode As GeneratedBarcode = BarcodeWriter.CreateBarcode("DOCUMENT-ID-12345", BarcodeEncoding.Code128, 200, 60)
' Verify the PDF exists before attempting to stamp
If File.Exists("target.pdf") Then
myBarcode.StampToExistingPdfPage("target.pdf", x:=100, y:=100, pageNumber:=1)
Console.WriteLine("Barcode stamped successfully!")
Else
Console.WriteLine("PDF file not found!")
End If
Catch ex As Exception
Console.WriteLine($"Error stamping barcode: {ex.Message}")
' Log the error or handle it appropriately
End Tryパフォーマンスの考慮事項
大きなPDFや複数のスタンプ操作を行う場合は、以下のヒントを考慮してください:
- バッチ操作:
StampToExistingPdfPageをループする代わりにStampToExistingPdfPagesを使用してください。 - バーコードキャッシング: 一度作成して
GeneratedBarcodeオブジェクトを再利用してください - 座標計算: 一貫性のある位置座標を事前計算してください
- メモリ管理: 非常に大きなPDFをバッチで処理してください
スタンプ後にPDFからバーコードを読み取る高度なシナリオについては、PDFドキュメントからバーコードを読み取るガイドをご覧ください。
他のIronBarcode機能との統合
PDFスタンピング機能は、他のIronBarcode機能と連携します。 非同期処理と組み合わせて、Webアプリケーションのパフォーマンスを向上させてください。
// Asynchronous PDF stamping
public async Task StampBarcodeAsync(string pdfPath, string barcodeData)
{
await Task.Run(() =>
{
var barcode = BarcodeWriter.CreateBarcode(barcodeData, BarcodeEncoding.QRCode, 200, 200);
barcode.StampToExistingPdfPage(pdfPath, x: 100, y: 100, pageNumber: 1);
});
}// Asynchronous PDF stamping
public async Task StampBarcodeAsync(string pdfPath, string barcodeData)
{
await Task.Run(() =>
{
var barcode = BarcodeWriter.CreateBarcode(barcodeData, BarcodeEncoding.QRCode, 200, 200);
barcode.StampToExistingPdfPage(pdfPath, x: 100, y: 100, pageNumber: 1);
});
}Imports System.Threading.Tasks
' Asynchronous PDF stamping
Public Async Function StampBarcodeAsync(pdfPath As String, barcodeData As String) As Task
Await Task.Run(Sub()
Dim barcode = BarcodeWriter.CreateBarcode(barcodeData, BarcodeEncoding.QRCode, 200, 200)
barcode.StampToExistingPdfPage(pdfPath, x:=100, y:=100, pageNumber:=1)
End Sub)
End FunctionImports System.Threading.Tasks
' Asynchronous PDF stamping
Public Async Function StampBarcodeAsync(pdfPath As String, barcodeData As String) As Task
Await Task.Run(Sub()
Dim barcode = BarcodeWriter.CreateBarcode(barcodeData, BarcodeEncoding.QRCode, 200, 200)
barcode.StampToExistingPdfPage(pdfPath, x:=100, y:=100, pageNumber:=1)
End Sub)
End Functionさらに、バーコードスタンピング前後に向上が必要かもしれないスキャンされたPDFを扱う際には、IronBarcodeの画像補正機能を活用してください。
一般的な問題のトラブルシューティング
PDFにBarCodeをスタンプする際に問題が発生した場合の解決策をご紹介します:
- 座標の問題: PDFの座標は左上角からではなく、左下角から始まります
- パスワード保護されたPDF: 暗号化されたPDFのため、正しいパスワードパラメーターを確認してください
- 大きなファイルサイズ: 最適化と取り扱いについてのヒントは、トラブルシューティングガイドを参照してください
- フォントまたはエンコーディングの問題: 特殊文字やUnicodeについては、Unicodeバーコードの書き込みガイドを確認してください
これらのガイドラインに従い、IronBarcodeのPDFスタンプ機能を活用することで、高いパフォーマンスとコード品質を維持しながら、既存のPDFドキュメントに効率的にバーコードを追加することができます。
よくある質問
IronBarcodeを使用してPDFにバーコードをスタンプするための主要な方法は何ですか?
IronBarcodeを使用してPDFにバーコードをスタンプする主要な方法は、StampToExistingPdfPage メソッドです。
IronBarcodeは複数のPDFページに一度にバーコードをスタンプできますか?
はい、IronBarcodeはStampToExistingPdfPagesメソッドを使用して複数のPDFページにバーコードをスタンプできます。
PDFにバーコードをスタンプする一般的な使用例は何ですか?
PDFにバーコードをスタンプする一般的な使用例には、レポート、請求書、またはフォームに追跡コード、在庫ラベル、または文書識別子を追加することが含まれます。
IronBarcodeでPDFページ上のバーコードの位置をどのように指定しますか?
IronBarcodeでは、xとyパラメーターを使用して、ピクセルでの座標を表し、PDFページ上のバーコードの位置を指定します。
IronBarcodeはバーコードをスタンプする際にパスワード保護されたPDFをサポートしていますか?
はい、IronBarcodeはパスワード保護されたPDFをサポートしています。StampToExistingPdfPageまたはStampToExistingPdfPagesメソッドを使用する際に、オプションのパラメーターとしてパスワードを指定できます。
PDFスタンプに使用するためにIronBarcodeで生成可能なバーコードタイプは何ですか?
IronBarcodeは様々なバーコードタイプを生成でき、QRコードやCode128などがPDFにスタンプできます。
IronBarcodeでPDFにスタンプする前にバーコードの外観をどのようにカスタマイズできますか?
AddAnnotationTextAboveBarcode、AddAnnotationTextBelowBarcode、およびChangeBarCodeColorなどのメソッドを使用して、IronBarcodeでバーコードの外観をカスタマイズできます。
なぜ複数のページに対してループ処理を行う代わりにStampToExistingPdfPagesメソッドを使用するべきなのですか?
StampToExistingPdfPagesメソッドは、複数のページへのスタンプに推奨され、手動でページをループする場合よりも効率的で、処理時間を短縮し、リソース使用を最適化します。
IronBarcodeで大きなPDFにバーコードをスタンプする際に考慮すべきパフォーマンス上の事項はありますか?
はい、大きなPDFにバーコードをスタンプする際は、バッチ操作を使用し、バーコードをキャッシュし、メモリを効率的に管理することがIronBarcodeでのパフォーマンス向上に役立ちます。
IronBarcodeでバーコードスタンプ操作が失敗した場合、何をすべきですか?
バーコードスタンピング操作が失敗した場合、エラーハンドリングをtry-catchブロックで実装し、IronBarcodeでスタンピングする前にPDFファイルが存在することを確認してください。