C# PDFパーサー
適切なツールを使用することで、C#でPDFを取り扱い、.NETアプリケーションに必要なすべての機能を活用することが簡単になります。C#のPDFファイル解析機能を使用することも含まれます。 このチュートリアルでは、IronPDF(C#ライブラリ)を使用して、それをいくつかの簡単なステップで実行します。



IronPDFを始めましょう
今日から無料トライアルでIronPDFをあなたのプロジェクトで使い始めましょう。
C#でPDFファイルを解析する方法
- C# PDFパーサーライブラリをダウンロード
- Visual Studioにインストールする
- 以下を使用
全てのテキストを抽出
すべてのテキスト行を抽出する方法 - 単一ページからすべてのテキストを抽出してください
ページからテキストを抽出
メソッド - 解析されたPDFコンテンツを表示
C# PDF ファイル解析
PDFファイルのパースは比較的簡単です。 以下のコードで、ExtractAllText
メソッドを使用してPDF文書全体からすべてのテキスト行を抽出します。 後で、抽出されたPDFコンテンツを横に並べて、出力として確認できます。
:path=/static-assets/pdf/content-code-examples/how-to/csharp-parse-pdf-parse-pdf.cs
using IronPdf;
// Select the desired PDF File
PdfDocument pdf = PdfDocument.FromFile("sample.pdf");
// Extract all text from an pdf
string allText = pdf.ExtractAllText();
// Extract all text from page 1
string page1Text = pdf.ExtractTextFromPage(0);
Imports IronPdf
' Select the desired PDF File
Private pdf As PdfDocument = PdfDocument.FromFile("sample.pdf")
' Extract all text from an pdf
Private allText As String = pdf.ExtractAllText()
' Extract all text from page 1
Private page1Text As String = pdf.ExtractTextFromPage(0)
解析されたPDFコンテンツを表示
上記のコード実行から解析されたPDFコンテンツを表示するために、C#フォームを使用しました。 この出力はPDFからの正確なテキストを提供するため、個人用または顧客のドキュメントのニーズに使用できます。