プロパティ/メタデータの抽出
Documentize PDF Extractor for .NET は、PDF ドキュメントからメタデータを抽出する作業を簡素化します。 利用可能なプロパティは次のとおりです:タイトル、著者、サブジェクト、キーワード、ページ数。
PDF ファイルからメタデータを抽出する方法
この例では、PDF ファイルからプロパティ(タイトル、著者、サブジェクト、キーワード、ページ数)を抽出する方法を示します。
PDF ドキュメントからメタデータを抽出する手順は次の通りです。
ExtractPropertiesOptionsのインスタンスを作成し、抽出オプションと入力 PDF ファイルを設定します。PdfExtractorのExtractメソッドを実行してメタデータを抽出します。PdfPropertiesを使用して抽出したプロパティにアクセスします。
1// Create ExtractPropertiesOptions object to set input file
2var options = new ExtractPropertiesOptions("path_to_your_pdf_file.pdf");
3// Perform the process and get Properties
4var pdfProperties = PdfExtractor.Extract(options);
5var title = pdfProperties.Title;
6var author = pdfProperties.Author;
7var subject = pdfProperties.Subject;
8var keywords = pdfProperties.Keywords;
9var numberOfPages = pdfProperties.NumberOfPages;PDF ストリームからメタデータを抽出する方法
ストリームは任意のタイミングで開くことができます。
1// Create ExtractPropertiesOptions object to set input stream
2var stream = File.OpenRead("path_to_your_pdf_file.pdf");
3var options = new ExtractPropertiesOptions(stream);
4// Perform the process and get Properties
5var pdfProperties = PdfExtractor.Extract(options);
6var title = pdfProperties.Title;
7var author = pdfProperties.Author;
8var subject = pdfProperties.Subject;
9var keywords = pdfProperties.Keywords;
10var numberOfPages = pdfProperties.NumberOfPages;PDF ファイルから最短スタイルでメタデータを抽出する方法
1// Perform the process and get Properties
2var pdfProperties = PdfExtractor.Extract(new ExtractPropertiesOptions("path_to_your_pdf_file.pdf"));主な機能:
- 利用可能なメタデータ: タイトル、著者、サブジェクト、キーワード、ページ数。