기존 PDF 파일의 XMP 메타데이터 가져오기 - facades
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")); |