既存のPDFファイルのXMPメタデータを取得する - ファサード
Contents
[
Hide
]
PDFファイルからXMPメタデータを取得するには、PdfXmpMetadataオブジェクトを作成し、bindPdf(..)メソッドを使用してPDFファイルをバインドする必要があります。特定のXMPメタデータプロパティをPdfXmpMetadataオブジェクトに渡して、その値を取得することができます。
次のコードスニペットは、PDFファイルからXMPメタデータを取得する方法を示しています。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Java | |
// create PdfXmpMetadata object | |
PdfXmpMetadata xmpMetaData = new PdfXmpMetadata(); | |
// bind PDF file to the object | |
xmpMetaData.bindPdf("TextAnnotation_output.pdf"); | |
// get XMP Meta Data properties | |
System.out.println("Creation Date : " + xmpMetaData.getByDefaultMetadataProperties(DefaultMetadataProperties.CreateDate)); | |
System.out.println("MetaData Date : " + xmpMetaData.getByDefaultMetadataProperties(DefaultMetadataProperties.MetadataDate)); | |
System.out.println("Creator Tool : " + xmpMetaData.getByDefaultMetadataProperties(DefaultMetadataProperties.CreatorTool)); | |
System.out.println("User Property Name : " + xmpMetaData.getXmpMetadata("customNamespace:UserPropertyName")); |