Class PdfExtractor
Namespace: Aspose.Pdf.Plugins
Assembly: Aspose.PDF.dll
PDF ドキュメントのページに存在する可能性のあるテキスト、画像、およびその他の種類のコンテンツを抽出するための基本機能を表します。
public abstract class PdfExtractor : IPlugin, IDisposable
継承
派生
実装
継承メンバー
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
例
この例では、PDF ドキュメントのテキストコンテンツを抽出する方法を示します。
// PDF コンテンツを抽出するための TextExtractor オブジェクトを作成
using (TextExtractor extractor = new TextExtractor())
{
// 指示を設定するための TextExtractorOptions オブジェクトを作成
textExtractorOptions = new TextExtractorOptions();
// データソースに入力ファイルパスを追加
textExtractorOptions.AddInput(new FileDataSource(inputPath));
// 抽出プロセスを実行
ResultContainer resultContainer = extractor.Process(textExtractorOptions);
// ResultContainer オブジェクトから抽出されたテキストを取得
string textExtracted = resultContainer.ResultCollection[0].ToString();
}
備考
Aspose.Pdf.Plugins.TextExtractor オブジェクトはテキストを抽出するために使用され、Aspose.Pdf.Plugins.ImageExtractor は画像を抽出するために使用されます。
コンストラクタ
PdfExtractor()
protected PdfExtractor()
メソッド
Dispose()
IDisposable の実装。実際には、PdfExtractor にとっては必要ありません。
public void Dispose()
Process(IPluginOptions)
指定されたパラメータで PdfExtractor 処理を開始します。
public ResultContainer Process(IPluginOptions pdfExtractorOptions)
パラメータ
pdfExtractorOptions
IPluginOptions
PdfExtractor に対する指示を含むオプションオブジェクト。
戻り値
抽出の結果を含む ResultContainer オブジェクト。